Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Triaged
-
1
-
Unknown
-
KV 2021-Nov
Description
Need to update affects versions.
The nextHLC() function (https://github.com/couchbase/kv_engine/blob/15b36716b5cd32f337b0a58251071ad953b9911c/engines/ep/src/hlc.h#L81) may be called concurrently for two (or more) different docs in a vBucket if those docs belong to different HashBuckets. Generally this is updated under the checkpoint manager lock, but getLocked calls also update the cas in some situtations which is where we hit this. If two threads call it concurrently, get the same time, and we are not in logical clock mode, then the two items end up having the same cas (and we update the maxHLC once). Really we should be checking the result of the maxHLC update and only returning the cas if true.
This is probably benign, we can already set cas freely via set with meta and this is for two different documents, but it's worth correcting before something falls afoul of it.