#include <dur.h>
◆ ~DurableInterface()
mongo::dur::DurableInterface::~DurableInterface |
( |
| ) |
|
|
virtual |
◆ DurableInterface()
mongo::dur::DurableInterface::DurableInterface |
( |
| ) |
|
|
protected |
◆ closingFileNotification()
virtual void mongo::dur::DurableInterface::closingFileNotification |
( |
| ) |
|
|
pure virtual |
Called when a DurableMappedFile is closing.
Asserts that there are no unwritten changes, because that would mean journal replay on recovery would try to write to non-existent files and fail.
◆ commitAndStopDurThread()
virtual void mongo::dur::DurableInterface::commitAndStopDurThread |
( |
OperationContext * |
opCtx | ) |
|
|
pure virtual |
Invoked at clean shutdown time.
Performs one last commit/flush and terminates the flush thread.
Must be called under the global X lock.
◆ commitIfNeeded()
virtual bool mongo::dur::DurableInterface::commitIfNeeded |
( |
| ) |
|
|
pure virtual |
Commit if enough bytes have been modified.
Current threshold is 50MB
The idea is that long running write operations that don't yield (like creating an index) can call this whenever the db is in a sane state and it will prevent commits from growing too large.
- Returns
- true if commited
◆ commitNow()
virtual bool mongo::dur::DurableInterface::commitNow |
( |
OperationContext * |
opCtx | ) |
|
|
pure virtual |
Commit immediately.
Generally, you do not want to do this often, as highly granular committing may affect performance.
Does not return until the commit is complete.
You must be at least read locked when you call this. Ideally, you are not write locked and then read operations can occur concurrently.
Do not use this. Use commitIfNeeded() instead.
- Returns
- true if –dur is on.
-
false if –dur is off. (in which case there is action)
◆ createdFile()
virtual void mongo::dur::DurableInterface::createdFile |
( |
const std::string & |
filename, |
|
|
unsigned long long |
len |
|
) |
| |
|
pure virtual |
Declare that a file has been created.
Normally writes are applied only after journaling for safety. But here the file is created first, and the journal will just replay the creation if the create didn't happen due to a crash.
◆ declareWriteIntents()
virtual void mongo::dur::DurableInterface::declareWriteIntents |
( |
const std::vector< std::pair< void *, unsigned >> & |
intents | ) |
|
|
pure virtual |
◆ getDur()
◆ isDurable()
virtual bool mongo::dur::DurableInterface::isDurable |
( |
| ) |
const |
|
pure virtual |
◆ MONGO_DISALLOW_COPYING()
◆ syncDataAndTruncateJournal()
virtual void mongo::dur::DurableInterface::syncDataAndTruncateJournal |
( |
OperationContext * |
opCtx | ) |
|
|
pure virtual |
Commits pending changes, flushes all changes to main data files, then removes the journal.
WARNING: Data must be in a crash-recoverable state when this is called and must not be inside of a write unit of work.
This is useful as a "barrier" to ensure that writes before this call will never go through recovery and be applied to files that have had changes made after this call applied.
◆ waitUntilDurable()
virtual bool mongo::dur::DurableInterface::waitUntilDurable |
( |
| ) |
|
|
pure virtual |
Wait for acknowledgement of the next group commit.
- Returns
- true if –dur is on. There will be delay.
-
false if –dur is off.
◆ startup
void startup |
( |
ClockSource * |
cs, |
|
|
int64_t |
serverStartMs |
|
) |
| |
|
friend |
Invoked at server startup.
Called during startup to startup the durability module.
Recovers the database by replaying journal files and then starts the durability thread.
Does nothing if storageGlobalParams.dur is false
◆ _impl
The documentation for this class was generated from the following files:
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/storage/mmap_v1/dur.h
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/storage/mmap_v1/dur.cpp