summaryrefslogtreecommitdiff
path: root/src/mongo/db/vector_clock.h
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2020-07-16 23:19:53 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-16 23:44:21 +0000
commitd760da5e25d5de81fc144e818fb612661adb4728 (patch)
tree33eb43f8c0df473ff7c7734dde4ce9e17cd3bc2d /src/mongo/db/vector_clock.h
parent550a9ee713078ec583621a0d6c368a6bc6ce43d2 (diff)
downloadmongo-d760da5e25d5de81fc144e818fb612661adb4728.tar.gz
SERVER-48717 Implement the persist/recover functionalities of the VectorClock [last additional changes]
Diffstat (limited to 'src/mongo/db/vector_clock.h')
-rw-r--r--src/mongo/db/vector_clock.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mongo/db/vector_clock.h b/src/mongo/db/vector_clock.h
index 750f3a9133c..d3e40190b22 100644
--- a/src/mongo/db/vector_clock.h
+++ b/src/mongo/db/vector_clock.h
@@ -35,10 +35,9 @@
#include "mongo/db/logical_time.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/service_context.h"
-#include "mongo/db/vector_clock_document_gen.h"
#include "mongo/platform/mutex.h"
#include "mongo/transport/session.h"
-#include "mongo/util/static_immortal.h"
+
namespace mongo {
@@ -137,8 +136,8 @@ public:
/*
* Methods to save/recover the the vector clock to/from persistent storage. Subclasses are
- * eventually expected to override those method to provide persistence mechanisms. Default
- * implementations result in a NOP.
+ * eventually expected to override these methods to provide persistence mechanisms. Default
+ * implementations do nothing.
*/
virtual SharedSemiFuture<void> persist(OperationContext* opCtx) {
return SharedSemiFuture<void>();
@@ -147,16 +146,13 @@ public:
return SharedSemiFuture<void>();
}
virtual void waitForInMemoryVectorClockToBePersisted(OperationContext* opCtx) {}
- virtual void waitForVectorClockToBeRecovered(OperationContext* opCtx){};
+ virtual void waitForVectorClockToBeRecovered(OperationContext* opCtx) {}
void resetVectorClock_forTest();
void advanceTime_forTest(Component component, LogicalTime newTime);
// Query to use when reading/writing the vector clock state document.
- static const Query& kStateQuery() {
- static StaticImmortal<Query> q{QUERY(VectorClockDocument::k_idFieldName << kDocIdKey)};
- return *q;
- }
+ static const Query& stateQuery();
// The _id value of the vector clock singleton document.
static constexpr StringData kDocIdKey = "vectorClockState"_sd;