Repository: cassandra-dtest Updated Branches: refs/heads/master 7f5d9c0f3 -> 1888c4048
Add test for CASSANDRA-14294 Patch by Blake Eggleston; Reviewed by Marcus Eriksson for CASSANDRA-14294 Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/1888c404 Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/1888c404 Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/1888c404 Branch: refs/heads/master Commit: 1888c4048b65c447733a2759f32472a7004eb46f Parents: 7f5d9c0 Author: Blake Eggleston <bdeggles...@gmail.com> Authored: Wed Mar 7 09:54:27 2018 -0800 Committer: Blake Eggleston <bdeggles...@gmail.com> Committed: Wed Mar 14 15:32:46 2018 -0700 ---------------------------------------------------------------------- repair_tests/incremental_repair_test.py | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/1888c404/repair_tests/incremental_repair_test.py ---------------------------------------------------------------------- diff --git a/repair_tests/incremental_repair_test.py b/repair_tests/incremental_repair_test.py index 37ee64a..e913a7c 100644 --- a/repair_tests/incremental_repair_test.py +++ b/repair_tests/incremental_repair_test.py @@ -812,7 +812,7 @@ class TestIncRepair(Tester): for i in range(10): session.execute(stmt, (i, i)) - node2.stop() + node2.stop(wait_other_notice=True) # repair should fail because node2 is down with pytest.raises(ToolError): @@ -826,6 +826,34 @@ class TestIncRepair(Tester): self.assertNoRepairedSSTables(node2, 'ks') @since('4.0') + def test_force_with_none_down(self): + """ + if we force an incremental repair, but all the involved nodes are up, + we should run normally and promote sstables afterwards + """ + self.fixture_dtest_setup.setup_overrides.cluster_options = ImmutableMapping({'hinted_handoff_enabled': 'false', + 'num_tokens': 1, + 'commitlog_sync_period_in_ms': 500}) + self.cluster.populate(3).start() + node1, node2, node3 = self.cluster.nodelist() + + session = self.patient_exclusive_cql_connection(node3) + session.execute("CREATE KEYSPACE ks WITH REPLICATION={'class':'SimpleStrategy', 'replication_factor': 3}") + session.execute("CREATE TABLE ks.tbl (k INT PRIMARY KEY, v INT)") + stmt = SimpleStatement("INSERT INTO ks.tbl (k,v) VALUES (%s, %s)") + stmt.consistency_level = ConsistencyLevel.ALL + for i in range(10): + session.execute(stmt, (i, i)) + + # run with force flag + node1.repair(options=['ks', '--force']) + + # ... and verify everything was still promoted + self.assertAllRepairedSSTables(node1, 'ks') + self.assertAllRepairedSSTables(node2, 'ks') + self.assertAllRepairedSSTables(node3, 'ks') + + @since('4.0') def test_hosts(self): """ running an incremental repair with hosts specified should incrementally repair --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org