Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-31581: Fix incorrect formatting of 'vbucket-seqno' stats
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") } [ 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. Fix by adding the missing .get() call. Change-Id: I2d90ddc2855874035d7d8877a678f89dfb0a0c9d Reviewed-on: http://review.couchbase.org/100403 Reviewed-by: Chris Farman <[email protected]> Tested-by: Build Bot <[email protected]>
- Loading branch information