Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • None
    • 1.1.0-dp1, 1.1.0-dp2
    • library
    • Security Level: Public
    • None

    Description

      Zlib compression is broken. This means large payloads are never compressed on the network.

      class Compression extends CouchbaseTestCommon {
      function testCompression() {

      if (!extension_loaded('zlib'))

      { $this->markTestSkipped("Need Zlib extension"); }

      $h = make_handle();
      $hnc = make_handle();

      $curcomp = couchbase_get_option($h, COUCHBASE_OPT_COMPRESSION);
      $this->assertEquals(COUCHBASE::COMPRESSION_NONE, $curcomp);

      couchbase_set_option($h, COUCHBASE_OPT_COMPRESSION,
      COUCHBASE::COMPRESSION_ZLIB);
      $curcomp = couchbase_get_option($h, COUCHBASE_OPT_COMPRESSION);
      $this->assertEquals(COUCHBASE_COMPRESSION_ZLIB, $curcomp);

      couchbase_set_option($hnc, COUCHBASE_OPT_COMPRESSION,
      COUCHBASE::COMPRESSION_NONE);

      $inikey = "couchbase.compression_threshold";
      $this->assertGreaterThan(0, ini_get($inikey));
      $this->assertTrue((bool)ini_alter($inikey,"10"));
      $this->assertEquals(10, ini_get($inikey));

      1. Set a compressed value
        $v = str_repeat("long_value", 500);
        $ol = strlen($v);
        //$key = $this->mk_key();
        $key = "compressed_data";

      $rv = couchbase_set($h, $key, $v);
      $this->assertNotEmpty($rv);

      $comp = couchbase_get_option($h, COUCHBASE_OPT_COMPRESSION);
      print $comp . "\n";

      1. Hack, append resets the flags, clearing the compression state.
        $rv = couchbase_append($hnc, $key, '_');
        $this->assertNotEmpty($rv);

      $ret = couchbase_get($hnc, $key);
      $this->assertNotNull($ret);
      $this->assertLessThan($ol, strlen($ret));
      }
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mnunberg Mark Nunberg (Inactive)
            mnunberg Mark Nunberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty