diff options
author | mathisbessamdb <mathis.bessa@mongodb.com> | 2022-12-13 21:01:00 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-12-13 21:34:48 +0000 |
commit | 2310a312d7dfdb5934ca2bc2a5277b5f6270a6a5 (patch) | |
tree | dfdf7966f17a4c38fd6d2b8f18b36113bc8acf10 /src/mongo/db/serverless | |
parent | 4a5d4e67fc8994c8cb8825c8c50514e632e82801 (diff) | |
download | mongo-2310a312d7dfdb5934ca2bc2a5277b5f6270a6a5.tar.gz |
SERVER-71186 Tenant migration access blocker registry to use TenantId object for Shard Split
Diffstat (limited to 'src/mongo/db/serverless')
-rw-r--r-- | src/mongo/db/serverless/shard_split_donor_op_observer_test.cpp | 30 | ||||
-rw-r--r-- | src/mongo/db/serverless/shard_split_test_utils.cpp | 3 |
2 files changed, 12 insertions, 21 deletions
diff --git a/src/mongo/db/serverless/shard_split_donor_op_observer_test.cpp b/src/mongo/db/serverless/shard_split_donor_op_observer_test.cpp index a31d987da16..a7501803c16 100644 --- a/src/mongo/db/serverless/shard_split_donor_op_observer_test.cpp +++ b/src/mongo/db/serverless/shard_split_donor_op_observer_test.cpp @@ -180,18 +180,15 @@ private: const std::vector<TenantId>& tenants, const std::function<void(std::shared_ptr<TenantMigrationAccessBlocker>)>& mtabVerifier) { for (const auto& tenantId : tenants) { - // TODO SERVER-71186 use tenantId directly instead of a string conversion. - auto mtab = - TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) - .getTenantMigrationAccessBlockerForTenantId( - tenantId.toString(), TenantMigrationAccessBlocker::BlockerType::kDonor); + auto mtab = TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) + .getTenantMigrationAccessBlockerForTenantId( + tenantId, TenantMigrationAccessBlocker::BlockerType::kDonor); mtabVerifier(mtab); } for (const auto& tenantId : tenants) { - // TODO SERVER-71186 use tenantId directly instead of a string conversion. TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) - .remove(tenantId.toString(), TenantMigrationAccessBlocker::BlockerType::kDonor); + .remove(tenantId, TenantMigrationAccessBlocker::BlockerType::kDonor); } } // Creates a reasonable set of ReplSettings for most tests. We need to be able to @@ -258,10 +255,9 @@ TEST_F(ShardSplitDonorOpObserverTest, InsertValidAbortedDocument) { } for (const auto& tenant : _tenantIds) { - // TODO SERVER-71186 use tenantId directly instead of a string conversion. ASSERT_FALSE(TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) .getTenantMigrationAccessBlockerForTenantId( - tenant.toString(), TenantMigrationAccessBlocker::BlockerType::kDonor)); + tenant, TenantMigrationAccessBlocker::BlockerType::kDonor)); } } @@ -489,11 +485,9 @@ TEST_F(ShardSplitDonorOpObserverTest, DeleteAbortedDocumentDoesNotRemoveBlockers // Verify blockers have not been removed for (const auto& tenantId : _tenantIds) { - // TODO SERVER-71186 use tenantId directly instead of a string conversion. - ASSERT_TRUE( - TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) - .getTenantMigrationAccessBlockerForTenantId( - tenantId.toString(), TenantMigrationAccessBlocker::BlockerType::kDonor)); + ASSERT_TRUE(TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) + .getTenantMigrationAccessBlockerForTenantId( + tenantId, TenantMigrationAccessBlocker::BlockerType::kDonor)); } } @@ -529,11 +523,9 @@ TEST_F(ShardSplitDonorOpObserverTest, DeleteCommittedDocumentRemovesBlockers) { // Verify blockers have been removed for (const auto& tenantId : _tenantIds) { - // TODO SERVER-71186 use tenantId directly instead of a string conversion. - ASSERT_FALSE( - TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) - .getTenantMigrationAccessBlockerForTenantId( - tenantId.toString(), TenantMigrationAccessBlocker::BlockerType::kDonor)); + ASSERT_FALSE(TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) + .getTenantMigrationAccessBlockerForTenantId( + tenantId, TenantMigrationAccessBlocker::BlockerType::kDonor)); } } diff --git a/src/mongo/db/serverless/shard_split_test_utils.cpp b/src/mongo/db/serverless/shard_split_test_utils.cpp index a8eb70ddb01..5c459edf228 100644 --- a/src/mongo/db/serverless/shard_split_test_utils.cpp +++ b/src/mongo/db/serverless/shard_split_test_utils.cpp @@ -43,9 +43,8 @@ ScopedTenantAccessBlocker::ScopedTenantAccessBlocker(const std::vector<TenantId> ScopedTenantAccessBlocker::~ScopedTenantAccessBlocker() { for (const auto& tenant : _tenants) { - // TODO SERVER-71186 use tenantId directly instead of a string conversion. TenantMigrationAccessBlockerRegistry::get(_opCtx->getServiceContext()) - .remove(tenant.toString(), TenantMigrationAccessBlocker::BlockerType::kDonor); + .remove(tenant, TenantMigrationAccessBlocker::BlockerType::kDonor); } } |