Minor bug fix
This commit is contained in:
parent
1fb3c33b3f
commit
f321933bc9
|
@ -9009,16 +9009,17 @@ private:
|
|||
|
||||
void StorageServer::insertTenant(TenantMapEntry const& tenant, Version version, bool persist) {
|
||||
if (version >= tenantMap.getLatestVersion()) {
|
||||
TenantSSInfo tenantSSInfo{ tenant.tenantName, tenant.tenantLockState };
|
||||
int64_t tenantId = TenantAPI::prefixToId(tenant.prefix);
|
||||
tenantMap.createNewVersion(version);
|
||||
tenantMap.insert(tenant.id, TenantSSInfo{ tenant.tenantName, tenant.tenantLockState });
|
||||
tenantMap.insert(tenant.id, tenantSSInfo);
|
||||
|
||||
if (persist) {
|
||||
auto& mLV = addVersionToMutationLog(version);
|
||||
addMutationToMutationLog(mLV,
|
||||
MutationRef(MutationRef::SetValue,
|
||||
tenant.prefix.withPrefix(persistTenantMapKeys.begin),
|
||||
tenant.tenantName));
|
||||
ObjectWriter::toValue(tenantSSInfo, IncludeVersion())));
|
||||
}
|
||||
|
||||
TraceEvent("InsertTenant", thisServerID).detail("Tenant", tenantId).detail("Version", version);
|
||||
|
|
|
@ -1727,12 +1727,24 @@ struct TenantManagementWorkload : TestWorkload {
|
|||
}
|
||||
}
|
||||
|
||||
ACTOR static Future<Void> delayedTrace(int opCode) {
|
||||
state double start = now();
|
||||
loop {
|
||||
wait(delay(1.0));
|
||||
TraceEvent("TenantManagementOpNotFinishedAfter")
|
||||
.detail("Duration", now() - start)
|
||||
.detail("OpCode", opCode)
|
||||
.log();
|
||||
}
|
||||
}
|
||||
|
||||
ACTOR Future<Void> _start(Database cx, TenantManagementWorkload* self) {
|
||||
state double start = now();
|
||||
|
||||
// Run a random sequence of tenant management operations for the duration of the test
|
||||
while (now() < start + self->testDuration) {
|
||||
state int operation = deterministicRandom()->randomInt(0, 8);
|
||||
state Future<Void> logger = delayedTrace(operation);
|
||||
if (operation == 0) {
|
||||
wait(createTenant(self));
|
||||
} else if (operation == 1) {
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
[configuration]
|
||||
allowDefaultTenant = false
|
||||
tenantModes = ['optional', 'required']
|
||||
|
||||
[[test]]
|
||||
testTitle = 'TenantCreation'
|
||||
|
||||
[[test.workload]]
|
||||
testName = 'CreateTenant'
|
||||
name = 'First'
|
||||
|
||||
[[test.workload]]
|
||||
testName = 'CreateTenant'
|
||||
name = 'Second'
|
||||
|
||||
[[test]]
|
||||
testTitle = 'TenantLock'
|
||||
|
||||
[[test.workload]]
|
||||
testName = 'TenantLock'
|
||||
tenant1 = 'First'
|
||||
tenant2 = 'Second'
|
Loading…
Reference in New Issue