@@ -37,12 +37,11 @@ def matches_op(op, target_op):
3737 op == target_op
3838 or op == target_op + "_SNAPSHOT"
3939 or op == target_op + "_DATABASE"
40- or op == target_op + "_TENANT"
4140 )
4241
4342
4443def is_non_transaction_op (op ):
45- return op .endswith ("_DATABASE" ) or op . endswith ( "_TENANT" )
44+ return op .endswith ("_DATABASE" )
4645
4746
4847class ApiTest (Test ):
@@ -77,7 +76,6 @@ def setup(self, args):
7776 args .max_int_bits , args .api_version , args .types
7877 )
7978 self .api_version = args .api_version
80- self .allocated_tenants = set ()
8179
8280 def add_stack_items (self , num ):
8381 self .stack_size += num
@@ -164,15 +162,6 @@ def wait_for_reads(self, instructions):
164162 test_util .to_front (instructions , self .stack_size - read [0 ])
165163 instructions .append ("WAIT_FUTURE" )
166164
167- def choose_tenant (self , new_tenant_probability ):
168- if len (self .allocated_tenants ) == 0 or random .random () < new_tenant_probability :
169- return self .random .random_string (random .randint (0 , 30 ))
170- else :
171- tenant_list = list (self .allocated_tenants )
172- # sort to ensure deterministic selection of a tenant
173- tenant_list .sort ()
174- return random .choice (tenant_list )
175-
176165 def generate (self , args , thread_number ):
177166 instructions = InstructionSet ()
178167
@@ -195,8 +184,6 @@ def generate(self, args, thread_number):
195184 snapshot_reads = [x + "_SNAPSHOT" for x in reads ]
196185 database_reads = [x + "_DATABASE" for x in reads ]
197186 database_mutations = [x + "_DATABASE" for x in mutations ]
198- tenant_reads = [x + "_TENANT" for x in reads ]
199- tenant_mutations = [x + "_TENANT" for x in mutations ]
200187 mutations += ["VERSIONSTAMP" ]
201188 versions = ["GET_READ_VERSION" , "SET_READ_VERSION" , "GET_COMMITTED_VERSION" ]
202189 snapshot_versions = ["GET_READ_VERSION_SNAPSHOT" ]
@@ -222,14 +209,6 @@ def generate(self, args, thread_number):
222209 ]
223210 txn_sizes = ["GET_APPROXIMATE_SIZE" ]
224211 storage_metrics = ["GET_ESTIMATED_RANGE_SIZE" , "GET_RANGE_SPLIT_POINTS" ]
225- tenants = [
226- "TENANT_CREATE" ,
227- "TENANT_DELETE" ,
228- "TENANT_SET_ACTIVE" ,
229- "TENANT_CLEAR_ACTIVE" ,
230- "TENANT_LIST" ,
231- "TENANT_GET_ID" ,
232- ]
233212
234213 op_choices += reads
235214 op_choices += mutations
@@ -245,11 +224,6 @@ def generate(self, args, thread_number):
245224 op_choices += txn_sizes
246225 op_choices += storage_metrics
247226
248- if not args .no_tenants :
249- op_choices += tenants
250- op_choices += tenant_reads
251- op_choices += tenant_mutations
252-
253227 idempotent_atomic_ops = [
254228 "BIT_AND" ,
255229 "BIT_OR" ,
@@ -281,8 +255,6 @@ def generate(self, args, thread_number):
281255
282256 if args .concurrency == 1 and (
283257 op in database_mutations
284- or op in tenant_mutations
285- or op in ["TENANT_CREATE" , "TENANT_DELETE" ]
286258 ):
287259 self .wait_for_reads (instructions )
288260 test_util .blocking_commit (instructions )
@@ -698,56 +670,20 @@ def generate(self, args, thread_number):
698670 instructions .push_args (key1 , key2 , chunkSize )
699671 instructions .append (op )
700672 self .add_strings (1 )
701- elif op == "TENANT_CREATE" :
702- tenant_name = self .choose_tenant (0.8 )
703- self .allocated_tenants .add (tenant_name )
704- instructions .push_args (tenant_name )
705- instructions .append (op )
706- self .add_strings (1 )
707- elif op == "TENANT_DELETE" :
708- tenant_name = self .choose_tenant (0.2 )
709- if tenant_name in self .allocated_tenants :
710- self .allocated_tenants .remove (tenant_name )
711- instructions .push_args (tenant_name )
712- instructions .append (op )
713- self .add_strings (1 )
714- elif op == "TENANT_SET_ACTIVE" :
715- tenant_name = self .choose_tenant (0.8 )
716- instructions .push_args (tenant_name )
717- instructions .append (op )
718- self .add_strings (1 )
719- elif op == "TENANT_CLEAR_ACTIVE" :
720- instructions .append (op )
721- elif op == "TENANT_LIST" :
722- self .ensure_string (instructions , 2 )
723- instructions .push_args (self .random .random_int ())
724- test_util .to_front (instructions , 2 )
725- test_util .to_front (instructions , 2 )
726- instructions .append (op )
727- self .add_strings (1 )
728- elif op == "TENANT_GET_ID" :
729- instructions .append (op )
730- self .add_strings (1 )
731673 else :
732674 assert False , "Unknown operation: " + op
733675
734- if read_performed and op not in database_reads and op not in tenant_reads :
676+ if read_performed and op not in database_reads :
735677 self .outstanding_ops .append ((self .stack_size , len (instructions ) - 1 ))
736678
737679 if args .concurrency == 1 and (
738680 op in database_reads
739681 or op in database_mutations
740- or op in tenant_reads
741- or op in tenant_mutations
742- or op in ["TENANT_CREATE" , "TENANT_DELETE" ]
743682 ):
744683 instructions .append ("WAIT_FUTURE" )
745684
746685 instructions .begin_finalization ()
747686
748- if not args .no_tenants :
749- instructions .append ("TENANT_CLEAR_ACTIVE" )
750-
751687 if args .concurrency == 1 :
752688 self .wait_for_reads (instructions )
753689 test_util .blocking_commit (instructions )
0 commit comments