summaryrefslogtreecommitdiff
path: root/src/mongo/db/s
diff options
context:
space:
mode:
authorSophia Tan <sophia_tll@hotmail.com>2022-08-18 21:54:32 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-18 22:27:33 +0000
commit10c79d0d4392aefbe1f94c698f4839ea91cc904e (patch)
treeab04e05d3717b99cc9f588eef65dd0b120642a14 /src/mongo/db/s
parent6092b42d5c563e70cc7b5653716ecbb2dc4b5d50 (diff)
downloadmongo-10c79d0d4392aefbe1f94c698f4839ea91cc904e.tar.gz
SERVER-67409 Change mongo::createCollection to take db name
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r--src/mongo/db/s/auto_split_vector_test.cpp4
-rw-r--r--src/mongo/db/s/collection_sharding_runtime_test.cpp2
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp8
-rw-r--r--src/mongo/db/s/migration_util_test.cpp4
-rw-r--r--src/mongo/db/s/range_deleter_service_test.cpp4
-rw-r--r--src/mongo/db/s/range_deletion_util_test.cpp3
-rw-r--r--src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp2
-rw-r--r--src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp6
-rw-r--r--src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp11
-rw-r--r--src/mongo/db/s/split_vector_test.cpp8
10 files changed, 25 insertions, 27 deletions
diff --git a/src/mongo/db/s/auto_split_vector_test.cpp b/src/mongo/db/s/auto_split_vector_test.cpp
index e17fd7b70ca..c98deebbced 100644
--- a/src/mongo/db/s/auto_split_vector_test.cpp
+++ b/src/mongo/db/s/auto_split_vector_test.cpp
@@ -78,8 +78,8 @@ public:
{
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE
unsafeCreateCollection(opCtx);
- uassertStatusOK(createCollection(
- operationContext(), kNss.db().toString(), BSON("create" << kNss.coll())));
+ uassertStatusOK(
+ createCollection(operationContext(), kNss.dbName(), BSON("create" << kNss.coll())));
}
DBDirectClient client(opCtx);
diff --git a/src/mongo/db/s/collection_sharding_runtime_test.cpp b/src/mongo/db/s/collection_sharding_runtime_test.cpp
index 4f7c9560ab1..90feb20de01 100644
--- a/src/mongo/db/s/collection_sharding_runtime_test.cpp
+++ b/src/mongo/db/s/collection_sharding_runtime_test.cpp
@@ -363,7 +363,7 @@ public:
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE
unsafeCreateCollection(operationContext());
uassertStatusOK(createCollection(
- operationContext(), kTestNss.db().toString(), BSON("create" << kTestNss.coll())));
+ operationContext(), kTestNss.dbName(), BSON("create" << kTestNss.coll())));
}
AutoGetCollection autoColl(operationContext(), kTestNss, MODE_IX);
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp
index e09ba6b8fd7..6ffb1547204 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp
@@ -152,8 +152,8 @@ protected:
{
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE
unsafeCreateCollection(operationContext());
- uassertStatusOK(createCollection(
- operationContext(), kNss.db().toString(), BSON("create" << kNss.coll())));
+ uassertStatusOK(
+ createCollection(operationContext(), kNss.dbName(), BSON("create" << kNss.coll())));
}
const auto uuid = [&] {
@@ -631,8 +631,8 @@ TEST_F(MigrationChunkClonerSourceLegacyTest, ShardKeyIndexNotFound) {
{
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE unsafeCreateCollection(
operationContext());
- uassertStatusOK(createCollection(
- operationContext(), kNss.db().toString(), BSON("create" << kNss.coll())));
+ uassertStatusOK(
+ createCollection(operationContext(), kNss.dbName(), BSON("create" << kNss.coll())));
}
const ShardsvrMoveRange req =
diff --git a/src/mongo/db/s/migration_util_test.cpp b/src/mongo/db/s/migration_util_test.cpp
index 90a1e9016a1..ed990aa73d3 100644
--- a/src/mongo/db/s/migration_util_test.cpp
+++ b/src/mongo/db/s/migration_util_test.cpp
@@ -438,8 +438,8 @@ public:
{
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE
unsafeCreateCollection(operationContext());
- uassertStatusOK(createCollection(
- operationContext(), nss.db().toString(), BSON("create" << nss.coll())));
+ uassertStatusOK(
+ createCollection(operationContext(), nss.dbName(), BSON("create" << nss.coll())));
}
AutoGetCollection autoColl(operationContext(), nss, MODE_IX);
diff --git a/src/mongo/db/s/range_deleter_service_test.cpp b/src/mongo/db/s/range_deleter_service_test.cpp
index e736cad8984..30258ecb081 100644
--- a/src/mongo/db/s/range_deleter_service_test.cpp
+++ b/src/mongo/db/s/range_deleter_service_test.cpp
@@ -47,9 +47,9 @@ void RangeDeleterServiceTest::setUp() {
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE unsafeCreateCollection(
opCtx);
uassertStatusOK(
- createCollection(opCtx, nsCollA.db().toString(), BSON("create" << nsCollA.coll())));
+ createCollection(opCtx, nsCollA.dbName(), BSON("create" << nsCollA.coll())));
uassertStatusOK(
- createCollection(opCtx, nsCollB.db().toString(), BSON("create" << nsCollB.coll())));
+ createCollection(opCtx, nsCollB.dbName(), BSON("create" << nsCollB.coll())));
}
{
diff --git a/src/mongo/db/s/range_deletion_util_test.cpp b/src/mongo/db/s/range_deletion_util_test.cpp
index 43eba92c307..d80290d1e19 100644
--- a/src/mongo/db/s/range_deletion_util_test.cpp
+++ b/src/mongo/db/s/range_deletion_util_test.cpp
@@ -74,8 +74,7 @@ public:
{
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE
unsafeCreateCollection(_opCtx);
- uassertStatusOK(
- createCollection(_opCtx, kNss.db().toString(), BSON("create" << kNss.coll())));
+ uassertStatusOK(createCollection(_opCtx, kNss.dbName(), BSON("create" << kNss.coll())));
}
AutoGetCollection autoColl(_opCtx, kNss, MODE_IX);
diff --git a/src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp b/src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp
index 833444ca8cd..eac110c154f 100644
--- a/src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp
@@ -121,7 +121,7 @@ protected:
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE unsafeCreateCollection(
operationContext());
uassertStatusOK(createCollection(
- operationContext(), tempNss.db().toString(), BSON("create" << tempNss.coll())));
+ operationContext(), tempNss.dbName(), BSON("create" << tempNss.coll())));
}
void tearDown() override {
diff --git a/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp b/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
index 0d901bd17dc..614accf368a 100644
--- a/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
@@ -188,8 +188,8 @@ protected:
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE unsafeCreateCollection(
opCtx);
- Status status = createCollection(
- operationContext(), kNss.db().toString(), BSON("create" << kNss.coll()));
+ Status status =
+ createCollection(operationContext(), kNss.dbName(), BSON("create" << kNss.coll()));
if (status != ErrorCodes::NamespaceExists) {
uassertStatusOK(status);
}
@@ -204,7 +204,7 @@ protected:
env.sourceUuid.toString()));
uassertStatusOK(createCollection(
- operationContext(), env.tempNss.db().toString(), BSON("create" << env.tempNss.coll())));
+ operationContext(), env.tempNss.dbName(), BSON("create" << env.tempNss.coll())));
TypeCollectionReshardingFields reshardingFields;
reshardingFields.setReshardingUUID(UUID::gen());
diff --git a/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp
index 620ccd969d5..ca9e05e8c92 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp
@@ -136,7 +136,7 @@ public:
uassertStatusOK(createCollection(
operationContext(),
- NamespaceString::kSessionTransactionsTableNamespace.db().toString(),
+ NamespaceString::kSessionTransactionsTableNamespace.dbName(),
BSON("create" << NamespaceString::kSessionTransactionsTableNamespace.coll())));
DBDirectClient client(operationContext());
client.createIndexes(NamespaceString::kSessionTransactionsTableNamespace.ns(),
@@ -144,13 +144,12 @@ public:
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE unsafeCreateCollection(
operationContext());
- uassertStatusOK(createCollection(operationContext(),
- kAppliedToNs.db().toString(),
- BSON("create" << kAppliedToNs.coll())));
uassertStatusOK(createCollection(
- operationContext(), kStashNs.db().toString(), BSON("create" << kStashNs.coll())));
+ operationContext(), kAppliedToNs.dbName(), BSON("create" << kAppliedToNs.coll())));
+ uassertStatusOK(createCollection(
+ operationContext(), kStashNs.dbName(), BSON("create" << kStashNs.coll())));
uassertStatusOK(createCollection(operationContext(),
- kOtherDonorStashNs.db().toString(),
+ kOtherDonorStashNs.dbName(),
BSON("create" << kOtherDonorStashNs.coll())));
_cm = createChunkManagerForOriginalColl();
diff --git a/src/mongo/db/s/split_vector_test.cpp b/src/mongo/db/s/split_vector_test.cpp
index f5588677e85..d1e7ae54829 100644
--- a/src/mongo/db/s/split_vector_test.cpp
+++ b/src/mongo/db/s/split_vector_test.cpp
@@ -63,8 +63,8 @@ public:
{
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE
unsafeCreateCollection(opCtx);
- uassertStatusOK(createCollection(
- operationContext(), kNss.db().toString(), BSON("create" << kNss.coll())));
+ uassertStatusOK(
+ createCollection(operationContext(), kNss.dbName(), BSON("create" << kNss.coll())));
}
setUnshardedFilteringMetadata(opCtx, kNss);
DBDirectClient client(opCtx);
@@ -308,7 +308,7 @@ public:
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE
unsafeCreateCollection(opCtx);
uassertStatusOK(createCollection(
- operationContext(), kJumboNss.db().toString(), BSON("create" << kJumboNss.coll())));
+ operationContext(), kJumboNss.dbName(), BSON("create" << kJumboNss.coll())));
}
setUnshardedFilteringMetadata(opCtx, kJumboNss);
DBDirectClient client(opCtx);
@@ -371,7 +371,7 @@ public:
OperationShardingState::ScopedAllowImplicitCollectionCreate_UNSAFE
unsafeCreateCollection(opCtx);
uassertStatusOK(createCollection(operationContext(),
- kMaxResponseNss.db().toString(),
+ kMaxResponseNss.dbName(),
BSON("create" << kMaxResponseNss.coll())));
}
setUnshardedFilteringMetadata(opCtx, kMaxResponseNss);