Account for 'tenant_locked' error in MetaclusterManagementWorkload (#10175)
In MetaclusterManagementWorkload, if we lock a tenant that has already been locked with a different lockId, it's possible that a tenant_locked error is thrown. We need to account for this instead of terminating the test.
Test plan:
Regular simulation and a deterministic reproduction
Branch: https://github.com/sfc-gh-yajin/foundationdb/tree/snow-791039
Commit hash: 7356504723
Profile: team
Command: devRetryCorrectnessTest bin/fdbserver -r simulation -f tests/slow/MetaclusterManagement.toml -s 3475230174 -b off --crash --trace_format json
This commit is contained in:
parent
63354f68ad
commit
f1e22f9a1e
|
@ -1378,6 +1378,8 @@ struct MetaclusterManagementWorkload : TestWorkload {
|
||||||
auto tenantData = self->createdTenants.find(tenant);
|
auto tenantData = self->createdTenants.find(tenant);
|
||||||
ASSERT(tenantData != self->createdTenants.end());
|
ASSERT(tenantData != self->createdTenants.end());
|
||||||
|
|
||||||
|
ASSERT(!tenantData->second->lockId.present() || lockId == tenantData->second->lockId.get());
|
||||||
|
|
||||||
auto& dataDb = self->dataDbs[tenantData->second->cluster];
|
auto& dataDb = self->dataDbs[tenantData->second->cluster];
|
||||||
ASSERT(dataDb->registered);
|
ASSERT(dataDb->registered);
|
||||||
|
|
||||||
|
@ -1398,12 +1400,15 @@ struct MetaclusterManagementWorkload : TestWorkload {
|
||||||
if (e.code() == error_code_tenant_not_found) {
|
if (e.code() == error_code_tenant_not_found) {
|
||||||
ASSERT(!exists);
|
ASSERT(!exists);
|
||||||
return Void();
|
return Void();
|
||||||
} else if (e.code() == error_code_invalid_tenant_configuration) {
|
|
||||||
ASSERT(exists);
|
|
||||||
return Void();
|
|
||||||
} else if (e.code() == error_code_invalid_metacluster_operation) {
|
} else if (e.code() == error_code_invalid_metacluster_operation) {
|
||||||
ASSERT(!self->metaclusterCreated);
|
ASSERT(!self->metaclusterCreated);
|
||||||
return Void();
|
return Void();
|
||||||
|
} else if (e.code() == error_code_tenant_locked) {
|
||||||
|
ASSERT(exists);
|
||||||
|
auto tenantData = self->createdTenants.find(tenant);
|
||||||
|
ASSERT(tenantData != self->createdTenants.end());
|
||||||
|
ASSERT(tenantData->second->lockId.present() && lockId != tenantData->second->lockId.get());
|
||||||
|
return Void();
|
||||||
}
|
}
|
||||||
|
|
||||||
TraceEvent(SevError, "LockTenantFailure")
|
TraceEvent(SevError, "LockTenantFailure")
|
||||||
|
|
Loading…
Reference in New Issue