Details
-
Bug
-
Resolution: Fixed
-
Major
-
master
-
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
For Gerrit Dashboard: MB-31581 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
100403,3 | MB-31581: Fix incorrect formatting of 'vbucket-seqno' stats | master | kv_engine | Status: MERGED | +2 | +1 |
100410,2 | MB-31581: Fix missing .get() for formatting of backfillItems.sent stat | master | kv_engine | Status: MERGED | +2 | +1 |
100411,2 | MB-31581: Add CB_FORMAT_PRINTF check with checked_snprintf | master | platform | Status: MERGED | +2 | +1 |
100464,2 | MB-31581: Cast nanoseconds.count() to int64_t for checked_snprintf | master | kv_engine | Status: MERGED | +2 | +1 |