diff options
author | jannaerin <golden.janna@gmail.com> | 2021-12-06 16:19:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-04 18:06:22 +0000 |
commit | da82e5278ca717d3228e4837a3e815c5ced876e0 (patch) | |
tree | 4a3bdda5c9a9d3d39a15dbcce1264a9e34dc72d2 /src/mongo/db/repl/tenant_migration_util.h | |
parent | 863684a584bfa5b4beeffb8d2a79e735299c1de7 (diff) | |
download | mongo-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.h | 16 |
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. |