diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2021-03-24 09:47:09 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-24 18:41:04 +0000 |
commit | 7c850a9595c4cc1a719c93f9328920645f9e5ff8 (patch) | |
tree | bc599867bd2270d2da2f34ca51c9929e23d968dd /src/mongo/db/repl | |
parent | d18d6234db7e647b0615df8de01a027df151a97d (diff) | |
download | mongo-7c850a9595c4cc1a719c93f9328920645f9e5ff8.tar.gz |
SERVER-51334: Only allow the temporary resharding collection on FCV 4.7+
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/database_cloner.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/oplog_applier_impl.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/repl/storage_interface_impl.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/repl/storage_interface_impl_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/repl/tenant_database_cloner.cpp | 4 |
5 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/repl/database_cloner.cpp b/src/mongo/db/repl/database_cloner.cpp index e4c2772e0be..adeeeb0afb6 100644 --- a/src/mongo/db/repl/database_cloner.cpp +++ b/src/mongo/db/repl/database_cloner.cpp @@ -84,7 +84,7 @@ BaseCloner::AfterStageBehavior DatabaseCloner::listCollectionsStage() { .reason()); } NamespaceString collectionNamespace(_dbName, result.getName()); - if (collectionNamespace.isSystem() && !collectionNamespace.isLegalClientSystemNS()) { + if (collectionNamespace.isSystem() && !collectionNamespace.isReplicated()) { LOGV2_DEBUG(21146, 1, "Skipping 'system' collection: {namespace}", diff --git a/src/mongo/db/repl/oplog_applier_impl.cpp b/src/mongo/db/repl/oplog_applier_impl.cpp index 2b443cffc81..5e7e7d43e78 100644 --- a/src/mongo/db/repl/oplog_applier_impl.cpp +++ b/src/mongo/db/repl/oplog_applier_impl.cpp @@ -522,6 +522,7 @@ StatusWith<OpTime> OplogApplierImpl::_applyOplogBatch(OperationContext* opCtx, // This code path is only executed on secondaries and initial syncing nodes, // so it is safe to exclude any writes from Flow Control. opCtx->setShouldParticipateInFlowControl(false); + opCtx->setEnforceConstraints(false); status = opCtx->runWithoutInterruptionExceptAtGlobalShutdown([&] { return applyOplogBatchPerWorker(opCtx.get(), &writer, &multikeyVector); diff --git a/src/mongo/db/repl/storage_interface_impl.cpp b/src/mongo/db/repl/storage_interface_impl.cpp index 6a3c13df976..4bc7a881232 100644 --- a/src/mongo/db/repl/storage_interface_impl.cpp +++ b/src/mongo/db/repl/storage_interface_impl.cpp @@ -220,6 +220,7 @@ StorageInterfaceImpl::createCollectionForBulkLoading( Client::setCurrent( getGlobalServiceContext()->makeClient(str::stream() << nss.ns() << " loader")); auto opCtx = cc().makeOperationContext(); + opCtx->setEnforceConstraints(false); // DocumentValidationSettings::kDisableInternalValidation is currently inert. // But, it's logically ok to disable internal validation as this function gets called diff --git a/src/mongo/db/repl/storage_interface_impl_test.cpp b/src/mongo/db/repl/storage_interface_impl_test.cpp index 8e626e10f25..f3a71cd5dee 100644 --- a/src/mongo/db/repl/storage_interface_impl_test.cpp +++ b/src/mongo/db/repl/storage_interface_impl_test.cpp @@ -2148,7 +2148,7 @@ TEST_F(StorageInterfaceImplTest, // Checks that we can update collections with namespaces not considered "legal client system" // namespaces. NamespaceString nss("local.system.rollback.docs"); - ASSERT_FALSE(nss.isLegalClientSystemNS()); + ASSERT_FALSE(nss.isLegalClientSystemNS(serverGlobalParams.featureCompatibility)); auto opCtx = getOperationContext(); auto options = generateOptionsWithUuid(); @@ -2441,7 +2441,7 @@ TEST_F(StorageInterfaceImplTest, DeleteByFilterRemovesDocumentsInIllegalClientSy // Checks that we can remove documents from collections with namespaces not considered "legal // client system" namespaces. NamespaceString nss("local.system.rollback.docs"); - ASSERT_FALSE(nss.isLegalClientSystemNS()); + ASSERT_FALSE(nss.isLegalClientSystemNS(serverGlobalParams.featureCompatibility)); auto opCtx = getOperationContext(); StorageInterfaceImpl storage; diff --git a/src/mongo/db/repl/tenant_database_cloner.cpp b/src/mongo/db/repl/tenant_database_cloner.cpp index 7ee0594e672..a955b15e973 100644 --- a/src/mongo/db/repl/tenant_database_cloner.cpp +++ b/src/mongo/db/repl/tenant_database_cloner.cpp @@ -141,7 +141,7 @@ BaseCloner::AfterStageBehavior TenantDatabaseCloner::listCollectionsStage() { .reason()); } NamespaceString collectionNamespace(_dbName, result.getName()); - if (collectionNamespace.isSystem() && !collectionNamespace.isLegalClientSystemNS()) { + if (collectionNamespace.isSystem() && !collectionNamespace.isReplicated()) { LOGV2_DEBUG(4881602, 1, "Database cloner skipping 'system' collection", @@ -194,7 +194,7 @@ BaseCloner::AfterStageBehavior TenantDatabaseCloner::listExistingCollectionsStag .reason()); } NamespaceString collectionNamespace(_dbName, result.getName()); - if (collectionNamespace.isSystem() && !collectionNamespace.isLegalClientSystemNS()) { + if (collectionNamespace.isSystem() && !collectionNamespace.isReplicated()) { LOGV2_DEBUG(5271600, 1, "Tenant database cloner skipping 'system' collection", |