diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
| commit | 4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch) | |
| tree | 1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/db/s/sessions_collection_config_server.cpp | |
| parent | aa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff) | |
| parent | 8f0827553e09872941945a093b647a4211a9db7f (diff) | |
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0'
with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/db/s/sessions_collection_config_server.cpp')
| -rw-r--r-- | src/mongo/db/s/sessions_collection_config_server.cpp | 31 |
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 |
