Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-16246

Unexpected warning "Ignoring Unrecognized strategy option" for NetworkTopologyStrategy when restarting

    XMLWordPrintableJSON

Details

    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());
          }
      }
      

      Attachments

        Activity

          People

            yifanc Yifan Cai
            yifanc Yifan Cai
            Yifan Cai
            Sam Tunnicliffe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m