Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASSANDRA-19103 fix counter test #246

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

smiklosovic
Copy link
Contributor

No description provided.

@@ -114,8 +114,11 @@ def test_counter_leader_with_partial_view(self):

# Now stop the node and restart but first install a rule to slow down how fast node 2 will update the list
# 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.

@@ -7,8 +7,8 @@ RULE election counter leader cheat
CLASS org.apache.cassandra.service.StorageProxy
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