summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/sessions_collection_config_server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/sessions_collection_config_server.cpp')
-rw-r--r--src/mongo/db/s/sessions_collection_config_server.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/mongo/db/s/sessions_collection_config_server.cpp b/src/mongo/db/s/sessions_collection_config_server.cpp
index 4cc60077aec..48374167b41 100644
--- a/src/mongo/db/s/sessions_collection_config_server.cpp
+++ b/src/mongo/db/s/sessions_collection_config_server.cpp
@@ -30,8 +30,6 @@
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kControl
#include "mongo/db/s/sessions_collection_config_server.h"
-#include "mongo/db/concurrency/d_concurrency.h"
-#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/logv2/log.h"
#include "mongo/s/client/shard_registry.h"
@@ -98,10 +96,8 @@ void SessionsCollectionConfigServer::_generateIndexesIfNeeded(OperationContext*
SessionsCollection::generateCreateIndexesCmd(),
ReadPreferenceSetting(ReadPreference::PrimaryOnly),
Shard::RetryPolicy::kNoRetry,
- BSONObj() /*query*/,
- BSONObj() /*collation*/,
- boost::none /*letParameters*/,
- boost::none /*runtimeConstants*/);
+ BSONObj() /* query */,
+ BSONObj() /* collation */);
});
}
@@ -115,29 +111,6 @@ void SessionsCollectionConfigServer::setupSessionsCollection(OperationContext* o
_shardCollectionIfNeeded(opCtx);
_generateIndexesIfNeeded(opCtx);
- static constexpr int64_t kAverageSessionDocSizeBytes = 200;
- static constexpr int64_t kDesiredDocsInChunks = 1000;
- static constexpr int64_t kMaxChunkSizeBytes =
- kAverageSessionDocSizeBytes * kDesiredDocsInChunks;
-
- Lock::GlobalLock lock(opCtx, MODE_IX);
- if (const auto replCoord = repl::ReplicationCoordinator::get(opCtx);
- replCoord->canAcceptWritesFor(opCtx, CollectionType::ConfigNS)) {
- auto filterQuery =
- BSON("_id" << NamespaceString::kLogicalSessionsNamespace.ns()
- << CollectionType::kMaxChunkSizeBytesFieldName << BSON("$exists" << false));
- auto updateQuery = BSON("$set" << BSON(CollectionType::kMaxChunkSizeBytesFieldName
- << kMaxChunkSizeBytes
- << CollectionType::kNoAutoSplitFieldName << true));
-
- uassertStatusOK(Grid::get(opCtx)->catalogClient()->updateConfigDocument(
- opCtx,
- CollectionType::ConfigNS,
- filterQuery,
- updateQuery,
- false,
- ShardingCatalogClient::kLocalWriteConcern));
- }
}
} // namespace mongo