summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/util/namespace_string_util.cpp5
-rw-r--r--src/mongo/util/namespace_string_util_test.cpp5
2 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/util/namespace_string_util.cpp b/src/mongo/util/namespace_string_util.cpp
index 698ea8fad4d..2952e24ce35 100644
--- a/src/mongo/util/namespace_string_util.cpp
+++ b/src/mongo/util/namespace_string_util.cpp
@@ -64,14 +64,13 @@ NamespaceString NamespaceStringUtil::deserialize(boost::optional<TenantId> tenan
gFeatureFlagRequireTenantID.isEnabled(serverGlobalParams.featureCompatibility)) {
// TODO SERVER-62491: Invariant for all databases. Remove the invariant bypass for
// admin, local, config dbs.
- // TODO SERVER-70742 Uncomment out the massert below.
- /* StringData dbName = ns.substr(0, ns.find('.'));
+ StringData dbName = ns.substr(0, ns.find('.'));
if (!(dbName == NamespaceString::kAdminDb) && !(dbName == NamespaceString::kLocalDb) &&
!(dbName == NamespaceString::kConfigDb)) {
massert(6972100,
str::stream() << "TenantId must be set on nss " << ns,
tenantId != boost::none);
- } */
+ }
return NamespaceString(std::move(tenantId), ns);
}
diff --git a/src/mongo/util/namespace_string_util_test.cpp b/src/mongo/util/namespace_string_util_test.cpp
index 6074b8fc167..66af53401eb 100644
--- a/src/mongo/util/namespace_string_util_test.cpp
+++ b/src/mongo/util/namespace_string_util_test.cpp
@@ -67,14 +67,13 @@ TEST(NamespaceStringUtilTest, SerializeMultitenancySupportOff) {
}
// Assert that if multitenancySupport and featureFlagRequireTenantID are on, then tenantId is set.
-// TODO SERVER-70742 Uncomment out the massert below.
-/* TEST(NamespaceStringUtilTest,
+TEST(NamespaceStringUtilTest,
DeserializeAssertTenantIdSetMultitenancySupportOnFeatureFlagRequireTenantIDOn) {
RAIIServerParameterControllerForTest multitenanyController("multitenancySupport", true);
RAIIServerParameterControllerForTest featureFlagController("featureFlagRequireTenantID", true);
ASSERT_THROWS_CODE(
NamespaceStringUtil::deserialize(boost::none, "foo.bar"), AssertionException, 6972100);
-} */
+}
// Deserialize NamespaceString using the tenantID as a parameter to the NamespaceString constructor
// when multitenancySupport and featureFlagRequireTenantID are enabled and ns does not have prefixed