Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-31581

Incorrect formatting of 'vbucket-seqno' stats in debug build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.5.0
    • master
    • couchbase-bucket
    • None
    • Untriaged
    • Yes

    Description

      As part of the Vbid refactoring (MB-30552), VBucket::getId()'s return type was changed from uint16_t to the strong type Vbid. However, EventuallyPersistentEngine::addSeqnoVbStats() was not updated to extract the raw uint16_t from the Vbid when printing. When building in Debug mode, this results in a corrupt vbid - for example see the following test failure:

      [ RUN      ] StatTest.vbucket_seqno_stats_test
      ../kv_engine/engines/ep/tests/module_tests/stats_test.cc:96: Failure
      Value of: vals
      Expected: has 7 elements and there exists some permutation of elements such that:
       - element #0 has a key that is equal to "vb_0:uuid", and
       - element #1 has a first field that is equal to "vb_0:high_seqno", and has a second field that is equal to "0", and
       - element #2 has a first field that is equal to "vb_0:abs_high_seqno", and has a second field that is equal to "0", and
       - element #3 has a first field that is equal to "vb_0:last_persisted_seqno", and has a second field that is equal to "0", and
       - element #4 has a first field that is equal to "vb_0:purge_seqno", and has a second field that is equal to "0", and
       - element #5 has a first field that is equal to "vb_0:last_persisted_snap_start", and has a second field that is equal to "0", and
       - element #6 has a first field that is equal to "vb_0:last_persisted_snap_end", and has a second field that is equal to "0"
        Actual: { ("vb_0:high_seqno", "0"), ("vb_0:last_persisted_snap_start", "0"), ("vb_258146304:abs_high_seqno", "0"), ("vb_258146304:last_persisted_seqno", "0"), ("vb_258146304:last_persisted_snap_end", "0"), ("vb_258146304:purge_seqno", "0"), ("vb_258146304:uuid", "87176786588641") }, where the following matchers don't match any elements:
      matcher #0: has a key that is equal to "vb_0:uuid",
      matcher #2: has a first field that is equal to "vb_0:abs_high_seqno", and has a second field that is equal to "0",
      matcher #3: has a first field that is equal to "vb_0:last_persisted_seqno", and has a second field that is equal to "0",
      matcher #4: has a first field that is equal to "vb_0:purge_seqno", and has a second field that is equal to "0",
      matcher #6: has a first field that is equal to "vb_0:last_persisted_snap_end", and has a second field that is equal to "0"
      and where the following elements don't match any matchers:
      element #2: ("vb_258146304:abs_high_seqno", "0"),
      element #3: ("vb_258146304:last_persisted_seqno", "0"),
      element #4: ("vb_258146304:last_persisted_snap_end", "0"),
      element #5: ("vb_258146304:purge_seqno", "0"),
      element #6: ("vb_258146304:uuid", "87176786588641")
      [  FAILED  ] StatTest.vbucket_seqno_stats_test (4 ms)
      

      Note this doesn't manifest under a release build (hence CV passing) - mostly likely because the address of the raw uint16_t is the same as the Vbid object itself; and the optimizer effectively hides the bug.

      Attachments

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

        Activity

          People

            drigby Dave Rigby (Inactive)
            drigby Dave Rigby (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                PagerDuty