Cassandra version 3.11.3
I have a record with some set and list collections. Using the sets with adding/removing data seems to have no or very limited tombstone creation. Using a list column however seems to be creating a tombstone per query.
I was under the impression this was fixed in this bug.
Am I doing something wrong?
Doing this 10k times generates no tombstones: (assume partition doesn't exist prior)
update "Record" Set "AllSetItems" = "AllSetItems" + {'abc'} where "RecordId" = 5 and "Field" = 'xyz';
update "Record" Set "AllSetItems" = "AllSetItems" - {'abc'} where "RecordId" = 5 and "Field" = 'xyz';
Thus this query works fine:
Select * from "Record" where "RecordId" = 5 and "Field" = 'xyz';
Doing this 10k times generates a lot of tombstones: (assume partition doesn't exist prior)
update "Record" Set "AllListItems" = "AllListItems" + ['abc'] where "RecordId" = 5 and "Field" = 'xyz';
update "Record" Set "AllListItems" = "AllListItems" - ['abc'] where "RecordId" = 5 and "Field" = 'xyz';
After the updates this query fails due to too many tombstones:
Select * from "Record" where "RecordId" = 5 and "Field" = 'xyz';
I believe this is working as expected. Read this article (although it's a bit dated) and see if it explains your situation.
https://jsravn.com/2015/05/13/cassandra-tombstones-collections/#lists