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