You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2021/09/22 20:47:55 UTC

[cassandra-dtest] branch trunk updated: Add test that seeds won't replace.

This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 10dd53f  Add test that seeds won't replace.
10dd53f is described below

commit 10dd53fcaceabec556f43f67d90dfaf75f2dbbfc
Author: Brandon Williams <br...@apache.org>
AuthorDate: Wed Sep 22 15:47:18 2021 -0500

    Add test that seeds won't replace.
    
    Patch by brandonwilliams, reviewed by edimitrova for CASSANDRA-14463
---
 replace_address_test.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/replace_address_test.py b/replace_address_test.py
index 75758c8..c0e50f3 100644
--- a/replace_address_test.py
+++ b/replace_address_test.py
@@ -359,6 +359,31 @@ class TestReplaceAddress(BaseReplaceAddressTest):
             node3.watch_log_for('Use cassandra.replace_address if you want to replace this node', from_mark=mark, timeout=20)
             mark = node3.mark_log()
 
+    @since('3.0')
+    def test_fail_when_seed(self):
+        """
+        When a node is a seed replace should fail
+        @jira_ticket CASSANDRA-14463
+        """
+        self.fixture_dtest_setup.ignore_log_patterns = list(self.fixture_dtest_setup.ignore_log_patterns) + [
+            r'Exception encountered during startup']
+
+        self._setup(n=3)
+        node1, node2, node3 = self.cluster.nodelist()
+        self.cluster.seeds.append(node3.address())
+
+        node3.stop(gently=False)
+        mark = node3.mark_log()
+
+        for d in chain([os.path.join(node3.get_path(), "commitlogs")],
+                       [os.path.join(node3.get_path(), "saved_caches")],
+                       node3.data_directories()):
+            if os.path.exists(d):
+                rmtree(d)
+
+        node3.start(jvm_args=["-Dcassandra.replace_address=" + node3.address()], wait_other_notice=False)
+        node3.watch_log_for('Replacing a node without bootstrapping risks invalidating consistency guarantees', from_mark=mark, timeout=20)
+
     @since('3.6')
     def test_unsafe_replace(self):
         """

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