summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/tenant_migration_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/tenant_migration_util.h')
-rw-r--r--src/mongo/db/repl/tenant_migration_util.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/repl/tenant_migration_util.h b/src/mongo/db/repl/tenant_migration_util.h
index f3350458182..dff6e245c3c 100644
--- a/src/mongo/db/repl/tenant_migration_util.h
+++ b/src/mongo/db/repl/tenant_migration_util.h
@@ -59,7 +59,8 @@ namespace tenant_migration_util {
inline Status validateDatabasePrefix(const std::string& tenantId) {
const bool isPrefixSupported =
- kUnsupportedTenantIds.find(tenantId) == kUnsupportedTenantIds.end();
+ kUnsupportedTenantIds.find(tenantId) == kUnsupportedTenantIds.end() &&
+ tenantId.find("_") == std::string::npos;
return isPrefixSupported
? Status::OK()
@@ -69,10 +70,9 @@ inline Status validateDatabasePrefix(const std::string& tenantId) {
inline Status validateDatabasePrefix(const std::vector<std::string>& tenantsId) {
for (const auto& tenantId : tenantsId) {
- if (kUnsupportedTenantIds.find(tenantId) != kUnsupportedTenantIds.end()) {
- return Status(ErrorCodes::BadValue,
- str::stream()
- << "cannot migrate databases for tenant \'" << tenantId << "'");
+ auto status = validateDatabasePrefix(tenantId);
+ if (!status.isOK()) {
+ return status;
}
}