You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jacek Lewandowski (Jira)" <ji...@apache.org> on 2022/09/12 16:28:00 UTC

[jira] [Comment Edited] (CASSANDRA-17883) Node will not get schema updates if it replaces a removed node with the same address

    [ https://issues.apache.org/jira/browse/CASSANDRA-17883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17603178#comment-17603178 ] 

Jacek Lewandowski edited comment on CASSANDRA-17883 at 9/12/22 4:27 PM:
------------------------------------------------------------------------

We used this test to reproduce on 4.0

{code:java}
try (Cluster cluster = init(Cluster.build(2).withConfig(cfg -> cfg.with(Feature.GOSSIP, Feature.NETWORK)).start()))
        {
            cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk INT PRIMARY KEY, v TEXT)");

            assertTrue(cluster.get(1).callOnInstance(() -> Schema.instance.getTableMetadata(KEYSPACE, "tbl") != null));
            assertTrue(cluster.get(2).callOnInstance(() -> Schema.instance.getTableMetadata(KEYSPACE, "tbl") != null));

            UUID hostId2 = cluster.get(2).callOnInstance(() -> Gossiper.instance.getHostId(FBUtilities.getBroadcastAddressAndPort()));

            cluster.get(2).shutdown().get();

            Awaitility.await()
                      .atMost(ofSeconds(30))
                      .until(() -> cluster
                                   .get(1)
                                   .callOnInstance(() -> Gossiper.instance
                                                         .getLiveMembers()
                                                         .stream()
                                                         .allMatch(addr -> addr.equals(FBUtilities.getBroadcastAddressAndPort()))));

            int result = cluster.get(1).nodetool("removenode", hostId2.toString());
            Assertions.assertThat(result).isZero();

            Awaitility.await()
                      .atMost(ofSeconds(30))
                      .until(() -> cluster.get(1).callOnInstance(() -> Gossiper.instance.getUnreachableMembers().isEmpty()));

            cluster.get(2).startup();

            Awaitility.await()
                      .atMost(ofSeconds(30))
                      .until(() -> cluster
                                   .get(1)
                                   .callOnInstance(() -> Gossiper.instance
                                                         .getLiveMembers()
                                                         .size() == 2));

            cluster.filters().verbs(Verb.SCHEMA_PUSH_REQ.id).drop();
            cluster.coordinator(2).execute("CREATE TABLE " + KEYSPACE + ".tbl2 (pk INT PRIMARY KEY, v TEXT)", ConsistencyLevel.ONE);

            Thread.sleep(30000);

            cluster.filters().reset();

            Awaitility.waitAtMost(ofMinutes(3))
                      .pollDelay(ofSeconds(1))
                      .until(() -> cluster.get(1).callOnInstance(() -> Schema.instance.getTableMetadata(KEYSPACE, "tbl2") != null));
{code}



was (Author: jlewandowski):
We used this test to reproduce

{code:java}
try (Cluster cluster = init(Cluster.build(2).withConfig(cfg -> cfg.with(Feature.GOSSIP, Feature.NETWORK)).start()))
        {
            cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk INT PRIMARY KEY, v TEXT)");

            assertTrue(cluster.get(1).callOnInstance(() -> Schema.instance.getTableMetadata(KEYSPACE, "tbl") != null));
            assertTrue(cluster.get(2).callOnInstance(() -> Schema.instance.getTableMetadata(KEYSPACE, "tbl") != null));

            UUID hostId2 = cluster.get(2).callOnInstance(() -> Gossiper.instance.getHostId(FBUtilities.getBroadcastAddressAndPort()));

            cluster.get(2).shutdown().get();

            Awaitility.await()
                      .atMost(ofSeconds(30))
                      .until(() -> cluster
                                   .get(1)
                                   .callOnInstance(() -> Gossiper.instance
                                                         .getLiveMembers()
                                                         .stream()
                                                         .allMatch(addr -> addr.equals(FBUtilities.getBroadcastAddressAndPort()))));

            int result = cluster.get(1).nodetool("removenode", hostId2.toString());
            Assertions.assertThat(result).isZero();

            Awaitility.await()
                      .atMost(ofSeconds(30))
                      .until(() -> cluster.get(1).callOnInstance(() -> Gossiper.instance.getUnreachableMembers().isEmpty()));

            cluster.get(2).startup();

            Awaitility.await()
                      .atMost(ofSeconds(30))
                      .until(() -> cluster
                                   .get(1)
                                   .callOnInstance(() -> Gossiper.instance
                                                         .getLiveMembers()
                                                         .size() == 2));

            cluster.filters().verbs(Verb.SCHEMA_PUSH_REQ.id).drop();
            cluster.coordinator(2).execute("CREATE TABLE " + KEYSPACE + ".tbl2 (pk INT PRIMARY KEY, v TEXT)", ConsistencyLevel.ONE);

            Thread.sleep(30000);

            cluster.filters().reset();

            Awaitility.waitAtMost(ofMinutes(3))
                      .pollDelay(ofSeconds(1))
                      .until(() -> cluster.get(1).callOnInstance(() -> Schema.instance.getTableMetadata(KEYSPACE, "tbl2") != null));
{code}


> Node will not get schema updates if it replaces a removed node with the same address
> ------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17883
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17883
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Distributed Metadata
>            Reporter: Jacek Lewandowski
>            Priority: Normal
>             Fix For: 3.0.x, 3.11.x, 4.0.x, 4.x
>
>
> If a node is removed and then a node with the same address is added, it is ignored by migration coordinator - that is, when that node fails to push the schema change, the other nodes will not be able pull it later during periodic update.
> Such situation will last until the other nodes gets restarted.
> This is caused by permanently adding the address of the node being removed to the ignore list in migration coordinator.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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