summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2020-09-16 15:57:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-21 18:23:56 +0000
commit4a362919e211b8f88853796c936b4c9157d05b16 (patch)
treed9fe4394defe3ef818ee8b58d530961c5373c8d1 /src/mongo/s/catalog
parent1ccff1fdee9edfd99109e1e508ecdddbe06c3bc4 (diff)
downloadmongo-4a362919e211b8f88853796c936b4c9157d05b16.tar.gz
SERVER-50957 Move anonymous functions which run writes to config docs in txns onto the ShardingCatalogManager
Diffstat (limited to 'src/mongo/s/catalog')
-rw-r--r--src/mongo/s/catalog/sharding_catalog_client_impl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
index 334bb82504d..42b374565bd 100644
--- a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
@@ -94,8 +94,6 @@ const ReadPreferenceSetting kConfigPrimaryPreferredSelector(ReadPreference::Prim
const int kMaxReadRetry = 3;
const int kMaxWriteRetry = 3;
-const int kRetryableBatchWriteBSONSizeOverhead = kWriteCommandBSONArrayPerElementOverheadBytes * 2;
-
const NamespaceString kSettingsNamespace("config", "settings");
void toBatchError(const Status& status, BatchedCommandResponse* response) {
@@ -869,7 +867,8 @@ void ShardingCatalogClientImpl::insertConfigDocumentsAsRetryableWrite(
BSONObj toAdd = docs.back();
docs.pop_back();
- const int docSizePlusOverhead = toAdd.objsize() + kRetryableBatchWriteBSONSizeOverhead;
+ const int docSizePlusOverhead =
+ toAdd.objsize() + write_ops::kRetryableAndTxnBatchWriteBSONSizeOverhead;
// Check if pushing this object will exceed the batch size limit or the max object size
if ((workingBatchItemSize + 1 > write_ops::kMaxWriteBatchSize) ||
(workingBatchDocSize + docSizePlusOverhead > BSONObjMaxUserSize)) {