@@ -1019,6 +1019,56 @@ def test_bootstrap_binary_disabled(self):
1019
1019
assert_bootstrap_state (self , node3 , 'COMPLETED' , user = 'cassandra' , password = 'cassandra' )
1020
1020
node3 .wait_for_binary_interface ()
1021
1021
1022
+ @since ('4.0' )
1023
+ @pytest .mark .no_vnodes
1024
+ def test_simple_bootstrap_with_everywhere_strategy (self ):
1025
+ cluster = self .cluster
1026
+ tokens = cluster .balanced_tokens (2 )
1027
+ cluster .set_configuration_options (values = {'num_tokens' : 1 })
1028
+
1029
+ logger .debug ("[node1, node2] tokens: %r" % (tokens ,))
1030
+
1031
+ keys = 10000
1032
+
1033
+ # Create a single node cluster
1034
+ cluster .populate (1 )
1035
+ node1 = cluster .nodelist ()[0 ]
1036
+ node1 .set_configuration_options (values = {'initial_token' : tokens [0 ]})
1037
+ cluster .start ()
1038
+
1039
+ session = self .patient_cql_connection (node1 )
1040
+ create_ks (session , 'ks' , 'EverywhereStrategy' )
1041
+ create_cf (session , 'cf' , columns = {'c1' : 'text' , 'c2' : 'text' })
1042
+
1043
+ insert_statement = session .prepare ("INSERT INTO ks.cf (key, c1, c2) VALUES (?, 'value1', 'value2')" )
1044
+ execute_concurrent_with_args (session , insert_statement , [['k%d' % k ] for k in range (keys )])
1045
+
1046
+ node1 .flush ()
1047
+ node1 .compact ()
1048
+
1049
+ # Reads inserted data all during the bootstrap process. We shouldn't
1050
+ # get any error
1051
+ query_c1c2 (session , random .randint (0 , keys - 1 ), ConsistencyLevel .ONE )
1052
+ session .shutdown ()
1053
+
1054
+ # Bootstrapping a new node in the current version
1055
+ node2 = new_node (cluster )
1056
+ node2 .set_configuration_options (values = {'initial_token' : tokens [1 ]})
1057
+ node2 .start (wait_for_binary_proto = True )
1058
+ node2 .compact ()
1059
+
1060
+ node1 .cleanup ()
1061
+ logger .debug ("node1 size for ks.cf after cleanup: %s" % float (data_size (node1 ,'ks' ,'cf' )))
1062
+ node1 .compact ()
1063
+ logger .debug ("node1 size for ks.cf after compacting: %s" % float (data_size (node1 ,'ks' ,'cf' )))
1064
+
1065
+ logger .debug ("node2 size for ks.cf after compacting: %s" % float (data_size (node2 ,'ks' ,'cf' )))
1066
+
1067
+ size1 = float (data_size (node1 ,'ks' ,'cf' ))
1068
+ size2 = float (data_size (node2 ,'ks' ,'cf' ))
1069
+ assert_almost_equal (size1 , size2 , error = 0.3 )
1070
+
1071
+ assert_bootstrap_state (self , node2 , 'COMPLETED' )
1022
1072
1023
1073
class TestBootstrap (BootstrapTester ):
1024
1074
"""
0 commit comments