When executing an unsupported operation (insert & delete in the same mutation) cassandra blocks the connection and appears as dead. Only removing commit log and restart will restore the cluster.
yes, but only after restarting cassandra.
unsupportedexception : "Index manager cannot support deleting and inserting into a row in the same mutation"
yes. Cassandra stops responding and restart alone does not fix the problem.
standard configuration using HECTOR as the client
1. create mutator by using hector api (feature start)
2. Insert a few columns into the mutator for key "key1", cf "standard". (file write)
3. add a deletion to the mutator to delete the record of "key1", cf "standard". (file write)
4. execute the mutator (feature start)
In hector, the user tries to send an unsupported command (both insert and delete in 1 mutation) to cassandra. Cassandra stops responding. Restart does not fix the problem unless commitlog is deleted.
No backwards inference needed. It is unsupported operation. We found race condition between delete and insert. However the developer has a workaround to fix the problem.
Race condition with insert and delete. An unsupported operation exception is thrown.
incorrect handling (you can detect the failure once you trigger the handler -- statement coverage is enough)
Instead of throwing an exception, fix is the separate mutation into two separate mutation. First insert, then mark as delete.
if (newColumn != null && cf.isMarkedForDelete())
- throw new UnsupportedOperationException("Index manager cannot support deleting and inserting into a row in the same mutation");
+ // row is marked for delete, but column was also updated. if column is timestamped less than
+ // the row tombstone, treat it as if it didn't exist. Otherwise we don't care about row
+ // tombstone for the purpose of the index update and we can proceed as usual.
+ if (newColumn.timestamp() <= cf.getMarkedForDeleteAt())
+ // don't remove from the cf object; that can race w/ CommitLog write. Leaving it is harmless.
+ newColumn = null;
watch out for unsupported / undefined function crashing the program.
7. Scope of the failure