Skip to content

Conversation

@smiklosovic
Copy link
Contributor

No description provided.

# nodes that are alive
nodes[1].stop(wait=True, wait_other_notice=False)
nodes[1].update_startup_byteman_script(mk_bman_path('gossip_alive_callback_sleep.btm'))
nodes[1].stop(wait=True, wait_other_notice=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is here to tell nodes which are still up that the second node went offline. Without that, it will still think that the second node is up.

if cluster.version() < '5.1':
nodes[1].update_startup_byteman_script(mk_bman_path('gossip_alive_callback_sleep.btm'))

nodes[1].start(no_wait=True, wait_other_notice=False)
Copy link
Contributor Author

@smiklosovic smiklosovic Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we do not wait for other nodes to notice the second one is up, it will be detected on their own when the logic is correct. Until they see the second node JOINED after we started it, they will never select that on their own.

METHOD findSuitableEndpoint
AT EXIT
BIND isthere:boolean = $localEndpoints.contains(org.apache.cassandra.locator.InetAddressAndPort.getByName("127.0.0.2"));
BIND isthere:boolean = $localReplicas.stream().anyMatch(r -> { try { return r.endpoint().equals(org.apache.cassandra.locator.InetAddressAndPort.getByName("127.0.0.2")); } catch (Throwable t) { return false; } });
Copy link
Contributor Author

@smiklosovic smiklosovic Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localEndpoints are called localReplicas in 4.0+ and it is a collection of Replicas, not InetAddress(WithPort)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant