Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
7.1.0
-
None
-
Untriaged
-
1
-
Yes
Description
(I've filed this as a bug, but please change that if desired - as below, it's something of a grey area on whether this is a bug or improvement. It was originally raised on #kv-eng in March here)
The behaviour of the CreateAsDeleted flag (a feature added for - and almost certainly exclusively used by - transactions) changed in 7.1.
Given this code:
String id = UUID.randomUUID().toString();
|
|
// Insert a tombstone |
coll.mutateIn(id, Arrays.asList(
|
MutateInSpec.upsert("dummy", JsonObject.create()).xattr() |
),
|
MutateInOptions.mutateInOptions()
|
.storeSemantics(StoreSemantics.INSERT)
|
.createAsDeleted(true)); |
|
// Insert the same tombstone again |
coll.mutateIn(id, Arrays.asList(
|
MutateInSpec.upsert("dummy", JsonObject.create()).xattr() |
),
|
MutateInOptions.mutateInOptions()
|
.storeSemantics(StoreSemantics.INSERT)
|
.createAsDeleted(true)); |
On 7.0.3 both mutations succeed. On 7.1 the 2nd mutation returns a NOT_STORED.
I've filed as a bug because it's a behaviour change, but also - the new behaviour maybe seems correct. It's trying to insert a tombstone that already exists, it feels that should fail. It's just than in 7.0 we had to also enable the AccessDeleted flag for that failure to occur.
I'm mostly filing this for tracking purposes. Both behaviours make sense to me, and this does not affect transactions (since we've always used the AccessDeleted flag with the CreateAsDeleted flag, so we've always had the 2nd insert fail.)
Project https://github.com/programmatix/cbse-9714 (branch create-as-deleted-change) replicates the issue. Instructions and expected output are in the README.