You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/04/06 01:30:51 UTC

[GitHub] [cassandra] fibersel commented on a change in pull request #952: [CASSANDRA-14582] Add a system property to set the cassandra hostId if not yet initialized

fibersel commented on a change in pull request #952:
URL: https://github.com/apache/cassandra/pull/952#discussion_r607427606



##########
File path: test/distributed/org/apache/cassandra/distributed/test/ring/BootstrapTest.java
##########
@@ -95,6 +97,38 @@ public void autoBootstrapTest() throws Throwable
                 Assert.assertEquals("Node " + e.getKey() + " has incorrect row state", e.getValue().longValue(), 100L);
         }
     }
+    
+    @Test
+    public void hostIdOverrideTest() throws Throwable
+    {
+    	int nodeCount = 3;
+    	try (Cluster cluster = builder().withNodes(nodeCount).start()) {
+    		for (int i = 1; i <= cluster.size(); ++i) {
+    			IInvokableInstance instance = cluster.get(i);
+    			instance.config().set("cassandra.cassandra.host_id_first_boot", String.valueOf(i));
+    		} 		
+    		
+    		for (int i = 1; i <= cluster.size(); ++i) {
+    			IInvokableInstance instance = cluster.get(i);
+    			Assert.assertEquals(instance.config().getString("cassandra.cassandra.host_id_first_boot"), String.valueOf(i));
+    		}
+    	
+    		for (int i = 1; i <= cluster.size(); ++i) {
+    			IInvokableInstance instance = cluster.get(i);
+    			instance.shutdown().wait();
+    		}
+    		
+    		
+    		cluster.startup();
+    		
+    		for (int i = 1; i <= cluster.size(); ++i) {
+    			IInvokableInstance instance = cluster.get(i);
+    			Assert.assertEquals(instance.config().getString("cassandra.cassandra.host_id_first_boot"), String.valueOf(i));

Review comment:
       Can I retrieve Host ID from cassandra node?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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