summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp13
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp6
2 files changed, 13 insertions, 6 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index ca705dbcd9d..9c94932c070 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -1342,10 +1342,15 @@ void WiredTigerKVEngine::syncSizeInfo(bool sync) const {
if (!_sizeStorer)
return;
- try {
- _sizeStorer->flush(sync);
- } catch (const WriteConflictException&) {
- // ignore, we'll try again later.
+ while (true) {
+ try {
+ return _sizeStorer->flush(sync);
+ } catch (const WriteConflictException&) {
+ if (!sync) {
+ // ignore, we'll try again later.
+ return;
+ }
+ }
}
}
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
index 0259e5d50d1..e4b2e3935e2 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
@@ -34,6 +34,7 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
+#include "mongo/db/concurrency/exception_util.h"
#include "mongo/db/service_context.h"
#include "mongo/db/storage/wiredtiger/wiredtiger_begin_transaction_block.h"
#include "mongo/db/storage/wiredtiger/wiredtiger_customization_hooks.h"
@@ -178,8 +179,9 @@ void WiredTigerSizeStorer::flush(bool syncToDisk) {
// One of the code paths calling this function is when a session is checked back
// into the session cache. This could involve read-only operations which don't
// except write conflicts. If WiredTiger returns WT_ROLLBACK during the flush, we
- // skip flushing.
- return;
+ // return an exception here and let the caller decide whether to ignore it or retry
+ // flushing.
+ throwWriteConflictException("Size storer flush received a rollback.");
}
invariantWTOK(ret, cursor->session);
}