summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Noma <gregory.noma@gmail.com>2023-02-09 15:11:09 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-16 17:31:05 +0000
commit855410a37a74b6382d5fcf2ecf31266c918f02ca (patch)
tree11eef9caba2a5db82a4332a97933eca356b85a76
parent3e35e9121f8d8d47539e115d477a1a684b773381 (diff)
downloadmongo-855410a37a74b6382d5fcf2ecf31266c918f02ca.tar.gz
SERVER-72063 Throw on attempt to create overly small oplog
(cherry picked from commit ac38b8ebe46bdd3ca3010c09956c8099424c6c1a)
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index 8eea2af5250..3daf61646bb 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -221,7 +221,9 @@ WiredTigerRecordStore::OplogStones::OplogStones(OperationContext* opCtx, WiredTi
unsigned long long numStones = maxSize / oplogStoneSize;
size_t numStonesToKeep = std::min(kMaxStonesToKeep, std::max(kMinStonesToKeep, numStones));
_minBytesPerStone = maxSize / numStonesToKeep;
- invariant(_minBytesPerStone > 0);
+ uassert(7206300,
+ fmt::format("Cannot create oplog of size less than {} bytes", numStonesToKeep),
+ _minBytesPerStone > 0);
_calculateStones(opCtx, numStonesToKeep);
_pokeReclaimThreadIfNeeded(); // Reclaim stones if over the limit.