Merge pull request #9753 from sfc-gh-ajbeamon/fix-tenant-list-infinite-loop

Do not list renaming tenants twice when listing tenant metadata
This commit is contained in:
A.J. Beamon 2023-03-20 16:05:56 -07:00 committed by GitHub
commit d324afe1bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -2936,7 +2936,12 @@ Future<std::vector<std::pair<TenantName, MetaclusterTenantMapEntry>>> listTenant
results.reserve(futures.size());
for (int i = 0; i < futures.size(); ++i) {
const MetaclusterTenantMapEntry& entry = futures[i].get().get();
results.emplace_back(entry.tenantName, entry);
// Tenants being renamed show up in tenantIds twice, once under each name. The destination name will be
// different from the tenant entry and is filtered from the list
if (entry.tenantName == tenantIds[i].first) {
results.emplace_back(entry.tenantName, entry);
}
}
return results;