2015-12-21 46 views
0

我们有2个cassandra数据中心,每个数据中心有3个节点。cassandra批量更新不执行

后进行以下查询一个接一个的结果不一致:

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)。

为什么批处理查询在没有异常的情况下会失败,为什么它们不一致?

回答

0

问题是节点时间不同步。