Commit d567856
committed
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]>1 parent df99171 commit d567856
1 file changed
+20
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3928 | 3928 | | |
3929 | 3929 | | |
3930 | 3930 | | |
3931 | | - | |
3932 | | - | |
| 3931 | + | |
| 3932 | + | |
3933 | 3933 | | |
3934 | | - | |
3935 | | - | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
3936 | 3938 | | |
3937 | | - | |
3938 | | - | |
| 3939 | + | |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
3939 | 3943 | | |
3940 | 3944 | | |
3941 | | - | |
| 3945 | + | |
| 3946 | + | |
3942 | 3947 | | |
3943 | | - | |
3944 | | - | |
| 3948 | + | |
| 3949 | + | |
3945 | 3950 | | |
3946 | 3951 | | |
3947 | | - | |
| 3952 | + | |
| 3953 | + | |
3948 | 3954 | | |
3949 | | - | |
| 3955 | + | |
3950 | 3956 | | |
3951 | | - | |
| 3957 | + | |
| 3958 | + | |
3952 | 3959 | | |
3953 | | - | |
| 3960 | + | |
3954 | 3961 | | |
3955 | 3962 | | |
3956 | 3963 | | |
| |||
0 commit comments