Skip to content

Commit 983c133

Browse files
authored
XDB-476 merge from apple main (#207)
* XDB-476 update main from upstream * XDB-476 update main and repair old commits * XDB-476 fixed tests tenantModes was removed
1 parent 0fab563 commit 983c133

443 files changed

Lines changed: 7050 additions & 36566 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ flow/coveragetool/obj
9797
/.cache
9898
TAGS
9999

100-
# Openway fork build
101-
/bld/
102-
/ide-projects/*/nbproject/private/
103-
/Testing/Temporary/
104-
105100
# Temporary and user configuration files
106101
*~
107102
*.orig

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ else()
270270
add_subdirectory(fdbservice)
271271
endif()
272272
add_subdirectory(fdbbackup)
273-
add_subdirectory(metacluster)
274273
add_subdirectory(tests)
275274
if(NOT FOUNDATIONDB_CROSS_COMPILING) # FIXME(swift): make this work when
276275
# x-compiling.

bindings/bindingtester/bindingtester.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,6 @@ def __init__(self, args):
314314
[not tester.directory_snapshot_ops_enabled for tester in self.testers]
315315
)
316316
)
317-
self.args.no_tenants = (
318-
self.args.no_tenants
319-
or any([not tester.tenants_enabled for tester in self.testers])
320-
or self.args.api_version < 710
321-
)
322317

323318
def print_test(self):
324319
test_instructions = self._generate_test()
@@ -431,19 +426,6 @@ def _insert_instructions(self, test_instructions):
431426
util.get_logger().info("\nInserting test into database...")
432427
del self.db[:]
433428

434-
if not self.args.no_tenants:
435-
while True:
436-
tr = self.db.create_transaction()
437-
try:
438-
tr.options.set_special_key_space_enable_writes()
439-
del tr[
440-
b"\xff\xff/management/tenant/map/":b"\xff\xff/management/tenant/map0"
441-
]
442-
tr.commit().wait()
443-
break
444-
except fdb.FDBError as e:
445-
tr.on_error(e).wait()
446-
447429
for subspace, thread in test_instructions.items():
448430
thread.insert_operations(self.db, subspace)
449431

bindings/bindingtester/known_testers.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def __init__(
4848
threads_enabled=True,
4949
types=COMMON_TYPES,
5050
directory_snapshot_ops_enabled=True,
51-
tenants_enabled=False,
5251
):
5352
self.name = name
5453
self.cmd = cmd
@@ -58,7 +57,6 @@ def __init__(
5857
self.threads_enabled = threads_enabled
5958
self.types = types
6059
self.directory_snapshot_ops_enabled = directory_snapshot_ops_enabled
61-
self.tenants_enabled = tenants_enabled
6260

6361
def supports_api_version(self, api_version):
6462
return (
@@ -91,7 +89,6 @@ def _absolute_path(path):
9189
23,
9290
MAX_API_VERSION,
9391
types=ALL_TYPES,
94-
tenants_enabled=True,
9592
),
9693
"ruby": Tester(
9794
"ruby", _absolute_path("ruby/tests/tester.rb"), 2040, 23, MAX_API_VERSION
@@ -103,7 +100,6 @@ def _absolute_path(path):
103100
510,
104101
MAX_API_VERSION,
105102
types=ALL_TYPES,
106-
tenants_enabled=True,
107103
),
108104
"java_async": Tester(
109105
"java",
@@ -112,7 +108,6 @@ def _absolute_path(path):
112108
510,
113109
MAX_API_VERSION,
114110
types=ALL_TYPES,
115-
tenants_enabled=True,
116111
),
117112
"go": Tester(
118113
"go",

bindings/bindingtester/spec/tenantTester.md

Lines changed: 0 additions & 93 deletions
This file was deleted.

bindings/bindingtester/tests/api.py

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4443
def is_non_transaction_op(op):
45-
return op.endswith("_DATABASE") or op.endswith("_TENANT")
44+
return op.endswith("_DATABASE")
4645

4746

4847
class 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)

bindings/c/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ if(NOT WIN32)
116116
test/mako/process.hpp
117117
test/mako/shm.hpp
118118
test/mako/stats.hpp
119-
test/mako/tenant.cpp
120-
test/mako/tenant.hpp
121119
test/mako/time.hpp
122120
test/mako/utils.cpp
123121
test/mako/utils.hpp)
@@ -223,7 +221,7 @@ if(NOT WIN32)
223221

224222
# do not set RPATH for mako
225223
set_property(TARGET mako PROPERTY SKIP_BUILD_RPATH TRUE)
226-
target_link_libraries(mako PRIVATE fdb_c tokensign fdbclient fmt::fmt Threads::Threads fdb_cpp boost_target rapidjson)
224+
target_link_libraries(mako PRIVATE fdb_c fdbclient fmt::fmt Threads::Threads fdb_cpp boost_target rapidjson)
227225

228226
if(NOT OPEN_FOR_IDE)
229227
# Make sure that fdb_c.h is compatible with c90
@@ -292,7 +290,7 @@ if(NOT WIN32)
292290
set(PATTERNS_TO_SKIP "XXXX")
293291
if (USE_ASAN)
294292
set(PATTERNS_TO_SKIP
295-
".*Tenant.*" # skip Tenant tests because we don't use
293+
".*ExampleDontUsePattern.*" # skip ExampleDontUsePattern tests because we don't use those files
296294
)
297295
endif()
298296
foreach(test_file ${API_TEST_FILES})

0 commit comments

Comments
 (0)