summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2018-08-22 18:23:38 -0400
committerLouis Williams <louis.williams@mongodb.com>2018-08-24 15:51:29 -0400
commitfa0ed40e73e65a1d8715a2dcd0be22f254787bb0 (patch)
treebe31c781743ca893380ed8cd4065413cc3ee4f0e /src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h
parent70882697008a4f52782ec20953790cbecd1b7add (diff)
downloadmongo-fa0ed40e73e65a1d8715a2dcd0be22f254787bb0.tar.gz
SERVER-35657 Do not delay journal flushes when operations are waiting for oplog visibility
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h
index 435b6b31f20..819faf80907 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h
@@ -76,7 +76,7 @@ public:
// Waits until all committed writes at this point to become visible (that is, no holes exist in
// the oplog.)
void waitForAllEarlierOplogWritesToBeVisible(const WiredTigerRecordStore* oplogRecordStore,
- OperationContext* opCtx) const;
+ OperationContext* opCtx);
// Returns the all committed timestamp. All transactions with timestamps earlier than the
// all committed timestamp are committed.
@@ -103,6 +103,10 @@ private:
RecordId _oplogMaxAtStartup = RecordId(0); // Guarded by oplogVisibilityStateMutex.
bool _opsWaitingForJournal = false; // Guarded by oplogVisibilityStateMutex.
+ // When greater than 0, indicates that there are operations waiting for oplog visibility, and
+ // journal flushing should not be delayed.
+ std::int64_t _opsWaitingForVisibility = 0; // Guarded by oplogVisibilityStateMutex.
+
AtomicUInt64 _oplogReadTimestamp;
};
} // namespace mongo