summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/catalog/database_impl.cpp3
-rw-r--r--src/mongo/db/index/index_access_method.cpp19
-rw-r--r--src/mongo/db/ops/insert.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_shard_collection_command.cpp2
-rw-r--r--src/mongo/db/s/create_collection_coordinator.cpp2
-rw-r--r--src/mongo/db/s/shardsvr_create_collection_command.cpp2
6 files changed, 16 insertions, 14 deletions
diff --git a/src/mongo/db/catalog/database_impl.cpp b/src/mongo/db/catalog/database_impl.cpp
index 9e4ee7c16ee..dc3a991bfac 100644
--- a/src/mongo/db/catalog/database_impl.cpp
+++ b/src/mongo/db/catalog/database_impl.cpp
@@ -351,7 +351,8 @@ Status DatabaseImpl::dropCollection(OperationContext* opCtx,
} else if (!(nss.isSystemDotViews() || nss.isHealthlog() ||
nss == NamespaceString::kLogicalSessionsNamespace ||
nss == NamespaceString::kKeysCollectionNamespace ||
- nss.isTemporaryReshardingCollection())) {
+ nss.isTemporaryReshardingCollection() ||
+ nss.isTimeseriesBucketsCollection())) {
return Status(ErrorCodes::IllegalOperation,
str::stream() << "can't drop system collection " << nss);
}
diff --git a/src/mongo/db/index/index_access_method.cpp b/src/mongo/db/index/index_access_method.cpp
index 486a6740012..004fb931f75 100644
--- a/src/mongo/db/index/index_access_method.cpp
+++ b/src/mongo/db/index/index_access_method.cpp
@@ -728,16 +728,17 @@ Status AbstractIndexAccessMethod::commitBulk(OperationContext* opCtx,
// Assert that keys are retrieved from the sorter in non-decreasing order, but only in debug
// builds since this check can be expensive.
int cmpData;
- if (kDebugBuild || _descriptor->unique()) {
+ if (_descriptor->unique()) {
cmpData = data.first.compareWithoutRecordId(previousKey);
- if (cmpData < 0) {
- LOGV2_FATAL_NOTRACE(
- 31171,
- "Expected the next key to be greater than or equal to the previous key",
- "nextKey"_attr = data.first.toString(),
- "previousKey"_attr = previousKey.toString(),
- "index"_attr = _descriptor->indexName());
- }
+ }
+
+ if (kDebugBuild && data.first.compare(previousKey) < 0) {
+ LOGV2_FATAL_NOTRACE(
+ 31171,
+ "Expected the next key to be greater than or equal to the previous key",
+ "nextKey"_attr = data.first.toString(),
+ "previousKey"_attr = previousKey.toString(),
+ "index"_attr = _descriptor->indexName());
}
// Before attempting to insert, perform a duplicate key check.
diff --git a/src/mongo/db/ops/insert.cpp b/src/mongo/db/ops/insert.cpp
index ad8002a7ee2..2903bdcc6e5 100644
--- a/src/mongo/db/ops/insert.cpp
+++ b/src/mongo/db/ops/insert.cpp
@@ -229,7 +229,7 @@ Status userAllowedCreateNS(const NamespaceString& ns) {
// 'config.system.sessions', there will be a corresponding persisted chunk metadata
// collection 'config.cache.chunks.config.system.sessions'. We wish to allow writes to this
// collection.
- if (ns.coll().find(".system.sessions") != std::string::npos) {
+ if (ns.isConfigDotCacheDotChunks()) {
return Status::OK();
}
diff --git a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp
index 40344c84aa2..613aa25d6d0 100644
--- a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp
+++ b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp
@@ -84,7 +84,7 @@ void validateAndDeduceFullRequestOptions(OperationContext* opCtx,
uassert(ErrorCodes::IllegalOperation,
"can't shard system namespaces",
!nss.isSystem() || nss == NamespaceString::kLogicalSessionsNamespace ||
- nss.isTemporaryReshardingCollection());
+ nss.isTemporaryReshardingCollection() || nss.isTimeseriesBucketsCollection());
// Ensure numInitialChunks is within valid bounds.
// Cannot have more than 8192 initial chunks per shard. Setting a maximum of 1,000,000
diff --git a/src/mongo/db/s/create_collection_coordinator.cpp b/src/mongo/db/s/create_collection_coordinator.cpp
index f565463572d..705b6646b48 100644
--- a/src/mongo/db/s/create_collection_coordinator.cpp
+++ b/src/mongo/db/s/create_collection_coordinator.cpp
@@ -397,7 +397,7 @@ void CreateCollectionCoordinator::_checkCommandArguments(OperationContext* opCtx
uassert(ErrorCodes::IllegalOperation,
"can't shard system namespaces",
!_nss.isSystem() || _nss == NamespaceString::kLogicalSessionsNamespace ||
- _nss.isTemporaryReshardingCollection());
+ _nss.isTemporaryReshardingCollection() || _nss.isTimeseriesBucketsCollection());
if (_request.getNumInitialChunks()) {
// Ensure numInitialChunks is within valid bounds.
diff --git a/src/mongo/db/s/shardsvr_create_collection_command.cpp b/src/mongo/db/s/shardsvr_create_collection_command.cpp
index ba3285d398f..e1179cd0421 100644
--- a/src/mongo/db/s/shardsvr_create_collection_command.cpp
+++ b/src/mongo/db/s/shardsvr_create_collection_command.cpp
@@ -119,7 +119,7 @@ CreateCollectionResponse createCollectionLegacy(OperationContext* opCtx,
uassert(ErrorCodes::IllegalOperation,
"can't shard system namespaces",
!nss.isSystem() || nss == NamespaceString::kLogicalSessionsNamespace ||
- nss.isTemporaryReshardingCollection());
+ nss.isTemporaryReshardingCollection() || nss.isTimeseriesBucketsCollection());
auto optNumInitialChunks = request.getNumInitialChunks();
if (optNumInitialChunks) {