测试Cassandras R+;W>;N

测试Cassandras R+;W>;N,cassandra,cassandra-2.0,cassandra-3.0,Cassandra,Cassandra 2.0,Cassandra 3.0,我想在演示文稿中明确显示R+W>N规则 因此,我的初步想法如下: // setup 1: Create a Docker network with 3 Cassandra Nodes. 2: Create a simple Keyspace with Replication-Factor of 3. 3: Explicitly shutdown two of the docker nodes. 4: Create a write query inserting some data wi

我想在演示文稿中明确显示
R+W>N
规则

因此,我的初步想法如下:

// setup
1: Create a Docker network with 3 Cassandra Nodes.  
2: Create a simple Keyspace with Replication-Factor of 3.  
3: Explicitly shutdown two of the docker nodes.

4: Create a write query inserting some data with W=1
   As two of the nodes are down but one is still online this should succeed

5: Bring both of the nodes back online
6: Reading the Data I just pushed to one node with R=1
如果我正确理解了
R+W>N
,我现在应该有2/3的机会获得不一致的数据。这正是我想要展示的

我的问题是:
是否有需要禁用的选项,以便在节点重新联机时停止同步?


因此,我需要禁用这些选项?

您需要禁用所有节点上的提示(在
cassandra.yaml
中设置
hinted\u handoff\u enabled
false
)-在这种情况下,只有在显式执行
nodetool修复时才会发生复制

您还需要确保将要进行测试的表的
read\u repair\u chance
dclocal\u read\u repair\u chance
设置为0。最简单的方法是在创建表时指定以下选项:

create table (

....)
WITH read_repair_chance = 0.0 and dclocal_read_repair_chance = 0.0;

那么除了
读取修复
暗示切换
之外,cassandra中的节点之间没有循环同步?这是我问自己的。因为在我看来,阅读修复和暗示切换足以在一段时间后保持一致。没有自动。。。这就是为什么nodetool修复存在只是检查了一切,它的工作:)非常感谢!