更新多个表时 Cassandra 原子批处理中的写入冲突?

Write-write conflicts in Cassandra atomic batches when updating multiple tables?

关于原子批处理的文档说:

For example, there is no batch isolation. Clients are able to read the first updated rows from the batch, while other rows are still being updated on the server.

但是,当我作为批处理的一部分更新两个不同表中的列时,是否会出现写-写冲突情况?

参考:https://en.wikipedia.org/wiki/Write%E2%80%93write_conflict

例如:

第 1 批:Table1.column = x,Table2.column = x

第 2 批:Table1.column = y,Table2.column = y

结果(写-写冲突情况):Table1.column = x, Table2.column = y

您引用的引用回答了您的问题:

For example, there is no batch isolation. Clients are able to read the first updated rows from the batch, while other rows are still being updated on the server.

但是,一旦批次被完全应用,将以正常的时间戳解析为准。两个值为 X 的单元格都有一个时间戳。值为 Y 的两个单元格都有另一个时间戳。获胜者将是 X 或 Y,但获胜者将是相同的,因为时间戳将相同:

A BATCH statement combines multiple data modification language (DML) statements (INSERT, UPDATE, DELETE) into a single logical operation, and sets a client-supplied timestamp for all columns written by the statements in the batch

在这种情况下,您是否看到 X/Y 或 Y/X 答案取决于您读取的一致性级别,以及批次完全应用所需的时间。