0
votes

I am reading Cassandra: The Definitive Guide, 3rd edition. It has the following text:

The serial consistency level can apply on reads as well. If Cassandra detects that a query is reading data that is part of an uncommitted transaction, it commits the transaction as part of the read, according to the specified serial consistency level.

Why a read is committing an uncommitted transaction and doesn't it interfere with ability of the writer to rollback?

2

2 Answers

1
votes

https://community.datastax.com/questions/5769/why-a-read-is-committing-an-uncommitted-transactio.html

  • Committed means that a mutation (INSERT, UPDATE or DELETE) is not added to commitlog.
  • Uncommitted is when a mutation is still in the process of being saved to the commitlog.
  • In oder for the LWT to provide guarantees such as IF EXISTS or IF NOT EXISTS, It has to add any data that is not written to commitlog by another in-flight operation to commitlog.
0
votes

Here Uncommitted data doesnt mean that it was a failed write. Uncommitted data is a successful data written to some node in the cluster which is not updated in the current node.

here,

it commits the transaction as part of the read

means that Cassandra will initiate a read repair and update the data in the node before sending the data back to the client.

Rollback is not in the picture here because write was successful and this concerns only the replication of data across nodes