Details
-
Bug
-
Resolution: Fixed
-
Critical
-
6.5.1, 6.6.0, 6.6.1, 6.6.2, 6.5.2, 6.5.0, 6.6.3, 7.0.0, 7.0.1, 7.0.2
-
Triaged
-
1
-
No
-
KV 2021-Oct-21, KV 2021-Nov
Description
We have an issue relating to expiring a CommittedViaPrepare when we also have xattrs.
The case observed is a crash in queueDirty due to processing a CommittedViaPrepare that has no durability-context.
TTL triggers when we fetch a doc.
In VBucket::processExpiredItem we set onlyMarkDeleted to true in the following case:
bool onlyMarkDeleted = value && mcbp::datatype::is_xattr(v.getDatatype());
|
We then call HT::unlocked_softDelete() which has the following code:
if (onlyMarkDeleted) {
|
v.markDeleted(delSource);
|
} else {
|
v.del(delSource);
|
// As part of deleting, set committedState to CommittedViaMutation -
|
// this is necessary so when we later queue this SV into
|
// CheckpoitnManager, if if was previously CommittedViaPrepare it
|
// isn't mis-interpreted for a SyncDelete.
|
v.setCommitted(CommittedState::CommittedViaMutation);
|
}
|
So we don't end up calling setCommitted
This means when we call queueDirty() we crash here:
Expects(ctx.durability.is_initialized());
|
Or in newer code (using std::optional)
Expects(ctx.durability.has_value());
|
Attachments
For Gerrit Dashboard: MB-49022 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
164059,4 | Adding test for ttl+xattr+dcp case | master | TAF | Status: NEW | 0 | +1 |
163956,4 | MB-49022: Always reset the SV committed state on expiry | 6.6.3 | kv_engine | Status: MERGED | +2 | +1 |
164000,4 | MB-49022: Merge branch '6.6.3' into mad-hatter | mad-hatter | kv_engine | Status: MERGED | +2 | +1 |
164060,9 | Adding test for ttl+xattr+dcp case | mad-hatter | TAF | Status: MERGED | +2 | +1 |
164395,4 | Adding test for ttl+xattr+dcp case | cheshire-cat | TAF | Status: MERGED | +2 | +1 |
164398,3 | Adding test for ttl+xattr+dcp case | master | TAF | Status: MERGED | +2 | +1 |
165863,2 | MB-49022: Merge branch 'mad-hatter' into cheshire-cat | cheshire-cat | kv_engine | Status: MERGED | +2 | +1 |
166251,1 | Merge branch 'cheshire-cat' | master | kv_engine | Status: MERGED | +2 | +1 |