Storage Engine API
dur_journal.h
Go to the documentation of this file.
1 // @file dur_journal.h
2 
31 #pragma once
32 
33 #include <cstdint>
34 
35 namespace mongo {
36 
37 class AlignedBuilder;
38 class ClockSource;
39 class JSectHeader;
40 
41 namespace dur {
42 
45 extern bool okToCleanUp;
46 
52 void journalCleanup(bool log = false);
53 
55 void journalMakeDir(ClockSource* cs, int64_t serverStartMs);
56 
61 uint64_t generateNextSeqNumber(ClockSource* cs, int64_t serverStartMs);
62 
67 void setLastSeqNumberWrittenToSharedView(uint64_t seqNumber);
68 
72 void journalingFailure(const char* msg);
73 
75 unsigned long long journalReadLSN();
76 
83 bool haveJournalFiles(bool anyFiles = false);
84 
88 void WRITETOJOURNAL(const JSectHeader& h, const AlignedBuilder& uncompressed);
89 
90 // in case disk controller buffers writes
91 const long long ExtraKeepTimeMs = 10000;
92 
99 } // namespace dur
100 } // namespace mongo
void journalCleanup(bool log)
at termination after db files closed & fsynced also after recovery closes and removes journal files ...
Definition: dur_journal.cpp:288
bool okToCleanUp
at clean shutdown
Definition: dur_journal.cpp:272
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
unsigned long long journalReadLSN()
called during recovery (the error message text below assumes that)
Definition: dur_journal.cpp:587
void notifyPostDataFileFlush()
Definition: dur_journal.cpp:684
void WRITETOJOURNAL(const JSectHeader &h, const AlignedBuilder &uncompressed)
write (append) the buffer we have built to the journal and fsync it.
Definition: dur_journal.cpp:760
bool haveJournalFiles(bool anyFiles)
never throws
Definition: dur_journal.cpp:216
void setLastSeqNumberWrittenToSharedView(uint64_t seqNumber)
Informs the journaling system that all writes on or before the passed in sequence number have been wr...
Definition: dur_journal.cpp:676
void notifyPreDataFileFlush()
Call these before (pre) and after (post) the datafiles are flushed to disk by the DataFileSync thread...
Definition: dur_journal.cpp:680
void journalMakeDir(ClockSource *cs, int64_t serverStartMs)
assure journal/ dir exists.
Definition: dur_journal.cpp:498
uint64_t generateNextSeqNumber(ClockSource *cs, int64_t serverStartMs)
Generates the next sequence number for use in the journal, guaranteed to be greater than all prior se...
Definition: dur_journal.cpp:663
const long long ExtraKeepTimeMs
Definition: dur_journal.h:91
void journalingFailure(const char *msg)
this should be called when something really bad happens so that we can flag appropriately ...
Definition: dur_journal.cpp:123