You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by aw...@apache.org on 2017/11/15 21:47:03 UTC

[35/50] cassandra git commit: Fix short read protection for tables with no clustering columns

Fix short read protection for tables with no clustering columns

patch by Aleksey Yeschenko; reviewed by Benedict Elliott Smith for
CASSANDRA-13880


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/163f82c2
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/163f82c2
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/163f82c2

Branch: refs/heads/master
Commit: 163f82c2db0e86d4dd8f312b291ccd094891b986
Parents: 6220394
Author: Aleksey Yeschenko <al...@yeschenko.com>
Authored: Mon Sep 18 16:14:24 2017 +0100
Committer: Aleksey Yeschenko <al...@yeschenko.com>
Committed: Mon Sep 18 17:33:11 2017 +0100

----------------------------------------------------------------------
 consistency_test.py | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/163f82c2/consistency_test.py
----------------------------------------------------------------------
diff --git a/consistency_test.py b/consistency_test.py
index 27e5d01..407873c 100644
--- a/consistency_test.py
+++ b/consistency_test.py
@@ -774,6 +774,41 @@ class TestAccuracy(TestHelper):
 class TestConsistency(Tester):
 
     @since('3.0')
+    def test_13880(self):
+        """
+        @jira_ticket CASSANDRA-13880
+        """
+        cluster = self.cluster
+
+        # disable hinted handoff and set batch commit log so this doesn't interfere with the test
+        cluster.set_configuration_options(values={'hinted_handoff_enabled': False})
+        cluster.set_batch_commitlog(enabled=True)
+
+        cluster.populate(2).start(wait_other_notice=True)
+        node1, node2 = cluster.nodelist()
+
+        session = self.patient_cql_connection(node1)
+
+        query = "CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': 2};"
+        session.execute(query)
+
+        query = "CREATE TABLE IF NOT EXISTS test.test (id int PRIMARY KEY);"
+        session.execute(query)
+
+        stmt = SimpleStatement("INSERT INTO test.test (id) VALUES (0);",
+                               consistency_level = ConsistencyLevel.ALL)
+        session.execute(stmt)
+
+        # with node2 down and hints disabled, delete the partition on node1
+        node2.stop(wait_other_notice=True)
+        session.execute("DELETE FROM test.test WHERE id = 0;");
+        node2.start(wait_other_notice=True)
+
+        # with both nodes up, do a CL.ALL query with per partition limit of 1;
+        # prior to CASSANDRA-13880 this would cause short read protection to loop forever
+        assert_none(session, "SELECT DISTINCT id FROM test.test WHERE id = 0;", cl=ConsistencyLevel.ALL)
+
+    @since('3.0')
     def test_13747(self):
         """
         @jira_ticket CASSANDRA-13747


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org