During a dry-run restore, it is possible that the tenants being restored are modified concurrently. Handle this case with an output message.
This commit is contained in:
parent
b869f5a6ac
commit
8e231f8809
|
@ -2002,7 +2002,15 @@ struct RestoreClusterImpl {
|
|||
Optional<MetaclusterTenantMapEntry> existingEntry = wait(tryGetTenantTransaction(tr, tenantEntry.tenantName));
|
||||
if (existingEntry.present()) {
|
||||
if (existingEntry.get().assignedCluster == self->clusterName) {
|
||||
ASSERT(existingEntry.get().matchesConfiguration(tenantEntry));
|
||||
if (existingEntry.get().id != tenantEntry.id ||
|
||||
!existingEntry.get().matchesConfiguration(tenantEntry)) {
|
||||
ASSERT(self->restoreDryRun);
|
||||
self->messages.push_back(
|
||||
fmt::format("The tenant `{}' was modified concurrently with the restore dry-run",
|
||||
printable(tenantEntry.tenantName)));
|
||||
throw tenant_already_exists();
|
||||
}
|
||||
|
||||
// This is a retry, so return success
|
||||
return false;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue