Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Code - Bug - Unclear Impact
-
Low
-
Low Hanging Fruit
-
User Report
-
All
-
None
-
Description
During restarting, bunch of warning messages like "AbstractReplicationStrategy.java:364 - Ignoring Unrecognized strategy option
{datacenter2} passed to NetworkTopologyStrategy for keyspace distributed_test_keyspace" are logged.
The warnings are not expected since the mentioned DC exist.
It seems to be caused by the improper order during startup, so that when opening keyspaces it is unaware of DCs.
The warning can be reproduced using the test below.
@Test public void testEmitsWarningsForNetworkTopologyStategyConfigOnRestart() throws Exception { int nodesPerDc = 2; try (Cluster cluster = builder().withConfig(c -> c.with(GOSSIP, NETWORK)) .withRacks(2, 1, nodesPerDc) .start()) { cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH replication = {'class': 'NetworkTopologyStrategy', " + "'datacenter1' : " + nodesPerDc + ", 'datacenter2' : " + nodesPerDc + " };"); cluster.get(2).nodetool("flush"); System.out.println("Stop node 2 in datacenter 1"); cluster.get(2).shutdown().get(); System.out.println("Start node 2 in datacenter 1"); cluster.get(2).startup(); List<String> result = cluster.get(2).logs().grep("Ignoring Unrecognized strategy option \\{datacenter2\\}").getResult(); Assert.assertFalse(result.isEmpty()); } }