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