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