summaryrefslogtreecommitdiff
path: root/src/mongo/db/serverless
diff options
context:
space:
mode:
authormathisbessamdb <mathis.bessa@mongodb.com>2022-03-03 22:59:27 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-03 23:25:20 +0000
commiteb5eaa886390cde3857c445360c84c9ce0f52d28 (patch)
tree9f66583a3e8f23546af1ddf9b962cec62c7d77a0 /src/mongo/db/serverless
parentcaf5eb51d40dbf7c1b10e1888ecdca124d087226 (diff)
downloadmongo-eb5eaa886390cde3857c445360c84c9ce0f52d28.tar.gz
SERVER-64103 adding feature flag check to prevent createStateDocumentTTLIndex from being called which causes multiversion tests to fail
Diffstat (limited to 'src/mongo/db/serverless')
-rw-r--r--src/mongo/db/serverless/shard_split_donor_service.cpp3
-rw-r--r--src/mongo/db/serverless/shard_split_donor_service_test.cpp20
2 files changed, 3 insertions, 20 deletions
diff --git a/src/mongo/db/serverless/shard_split_donor_service.cpp b/src/mongo/db/serverless/shard_split_donor_service.cpp
index e483a8e5c2f..ce25255e167 100644
--- a/src/mongo/db/serverless/shard_split_donor_service.cpp
+++ b/src/mongo/db/serverless/shard_split_donor_service.cpp
@@ -231,6 +231,9 @@ ExecutorFuture<void> ShardSplitDonorService::_createStateDocumentTTLIndex(
ExecutorFuture<void> ShardSplitDonorService::_rebuildService(
std::shared_ptr<executor::ScopedTaskExecutor> executor, const CancellationToken& token) {
+ if (!repl::feature_flags::gShardSplit.isEnabled(serverGlobalParams.featureCompatibility)) {
+ return ExecutorFuture(**executor);
+ }
return _createStateDocumentTTLIndex(executor, token);
}
diff --git a/src/mongo/db/serverless/shard_split_donor_service_test.cpp b/src/mongo/db/serverless/shard_split_donor_service_test.cpp
index cd8aa138499..d2cfb46d80c 100644
--- a/src/mongo/db/serverless/shard_split_donor_service_test.cpp
+++ b/src/mongo/db/serverless/shard_split_donor_service_test.cpp
@@ -64,7 +64,6 @@
#include "mongo/idl/server_parameter_test_util.h"
#include "mongo/logv2/log.h"
#include "mongo/rpc/metadata/egress_metadata_hook_list.h"
-#include "mongo/unittest/death_test.h"
#include "mongo/unittest/log_test.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/clock_source_mock.h"
@@ -402,25 +401,6 @@ TEST_F(ShardSplitDonorServiceTest, StepDownTest) {
ASSERT_FALSE(serviceInstance->isGarbageCollectable());
}
-// TODO(SERVER-62363) : Remove this test once the ticket is completed.
-DEATH_TEST_F(ShardSplitDonorServiceTest, StartWithExpireAtAlreadySet, "invariant") {
- auto opCtx = makeOperationContext();
-
- test::shard_split::ScopedTenantAccessBlocker scopedTenants(_tenantIds, opCtx.get());
-
- auto stateDocument = defaultStateDocument();
- stateDocument.setState(ShardSplitDonorStateEnum::kCommitted);
-
- auto serviceInstance = ShardSplitDonorService::DonorStateMachine::getOrCreate(
- opCtx.get(), _service, stateDocument.toBSON());
-
- ASSERT(serviceInstance.get());
-
- // this triggers an invariant updateResult.numDocsModified == 1 in _updateStateDocument when
- // going in the _handleErrorOrEnterAbortedState.
- auto result = serviceInstance->decisionFuture().get(opCtx.get());
-}
-
TEST_F(ShardSplitDonorServiceTest, StepUpWithkCommitted) {
auto opCtx = makeOperationContext();