cassandra 批量更新不执行

cassandra batch update does not perform

我们有 2 个 cassandra 数据中心,每个数据中心有 3 个节点。

接连查询后结果不一致:

BEGIN BATCH 
UPDATE t1 set units - {'u1'} where location = 'loc1';
UPDATE t1 set units - {'u1'} where location = 'loc2';
UPDATE t1 set units - {'u1'} where location = 'loc3';
...
UPDATE t1 set units - {'u1'} where location = 'loc200';
APPLY BATCH;

BEGIN BATCH 
UPDATE t1 set units + {'u1'} where location = 'loc100';
UPDATE t1 set units + {'u1'} where location = 'loc101';
UPDATE t1 set units + {'u1'} where location = 'loc102';
...
UPDATE t1 set units + {'u1'} where location = 'loc200';
APPLY BATCH;

有时它会根据需要执行,结果是 'u1' 被添加到位置为 101-200 的行的集合中,有时什么也没有发生,有时只有部分范围被设置(比如只有位置 101- 123).

为什么批量查询会无一例外地失败,为什么不一致?

问题是节点时间不同步。