summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/tenant_migration_util.h
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2021-12-06 16:19:51 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-04 18:06:22 +0000
commitda82e5278ca717d3228e4837a3e815c5ced876e0 (patch)
tree4a3bdda5c9a9d3d39a15dbcce1264a9e34dc72d2 /src/mongo/db/repl/tenant_migration_util.h
parent863684a584bfa5b4beeffb8d2a79e735299c1de7 (diff)
downloadmongo-da82e5278ca717d3228e4837a3e815c5ced876e0.tar.gz
SERVER-61474 Ban directoryPerDb and directoryForIndexes with Merge
Diffstat (limited to 'src/mongo/db/repl/tenant_migration_util.h')
-rw-r--r--src/mongo/db/repl/tenant_migration_util.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/db/repl/tenant_migration_util.h b/src/mongo/db/repl/tenant_migration_util.h
index 818ffba2649..f3350458182 100644
--- a/src/mongo/db/repl/tenant_migration_util.h
+++ b/src/mongo/db/repl/tenant_migration_util.h
@@ -186,6 +186,22 @@ inline Status protocolTenantIdCompatibilityCheck(const MigrationProtocolEnum& pr
return Status::OK();
}
+inline void protocolStorageOptionsCompatibilityCheck(OperationContext* opCtx,
+ const MigrationProtocolEnum& protocol) {
+ if (protocol != MigrationProtocolEnum::kShardMerge)
+ return;
+
+ uassert(ErrorCodes::InvalidOptions,
+ str::stream() << "protocol '" << MigrationProtocol_serializer(protocol)
+ << "' is not allowed when storage option 'directoryPerDb' is enabled",
+ !storageGlobalParams.directoryperdb);
+ uassert(
+ ErrorCodes::InvalidOptions,
+ str::stream() << "protocol '" << MigrationProtocol_serializer(protocol)
+ << "' is not allowed when storage option 'directoryForIndexes' is enabled",
+ !opCtx->getServiceContext()->getStorageEngine()->isUsingDirectoryForIndexes());
+}
+
/*
* Creates an ExternalKeysCollectionDocument representing an config.external_validation_keys
* document from the given the admin.system.keys document BSONObj.