File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ RULE election counter leader cheat
77CLASS org.apache.cassandra.service.StorageProxy
88METHOD findSuitableEndpoint
99AT EXIT
10- BIND isthere:boolean = $localEndpoints.contains( org.apache.cassandra.locator.InetAddressAndPort.getByName("127.0.0.2"));
10+ 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; } } );
1111if isthere
1212DO
13- return org.apache.cassandra.locator. InetAddressAndPort.getByName("127.0.0.2");
13+ return localReplicas.stream().filter(lr -> { try { return lr.endpoint().equals( InetAddressAndPort.getByName("127.0.0.2")); } catch (Throwable t) { return null; } }).findFirst().get( );
1414ENDRULE
Original file line number Diff line number Diff line change @@ -114,8 +114,11 @@ def test_counter_leader_with_partial_view(self):
114114
115115 # Now stop the node and restart but first install a rule to slow down how fast node 2 will update the list
116116 # nodes that are alive
117- nodes [1 ].stop (wait = True , wait_other_notice = False )
118- nodes [1 ].update_startup_byteman_script (mk_bman_path ('gossip_alive_callback_sleep.btm' ))
117+ nodes [1 ].stop (wait = True , wait_other_notice = True )
118+
119+ if cluster .version () < '5.1' :
120+ nodes [1 ].update_startup_byteman_script (mk_bman_path ('gossip_alive_callback_sleep.btm' ))
121+
119122 nodes [1 ].start (no_wait = True , wait_other_notice = False )
120123
121124 # Until node 2 is fully alive try to force other nodes to pick him as mutation leader.
You can’t perform that action at this time.
0 commit comments