|
| MobileRecoveryUnit (MobileSessionPool *sessionPool) |
|
virtual | ~MobileRecoveryUnit () |
|
void | beginUnitOfWork (OperationContext *opCtx) override |
| Marks the beginning of a unit of work. More...
|
|
void | commitUnitOfWork () override |
| Marks the end of a unit of work and commits all changes registered by calls to onCommit or registerChange, in order. More...
|
|
void | abortUnitOfWork () override |
| Marks the end of a unit of work and rolls back all changes registered by calls to onRollback or registerChange, in reverse order. More...
|
|
bool | waitUntilDurable () override |
| Waits until all commits that happened before this call are durable in the journal. More...
|
|
void | abandonSnapshot () override |
| If there is an open transaction, it is closed. More...
|
|
void | registerChange (Change *change) override |
| The RecoveryUnit takes ownership of the change. More...
|
|
void * | writingPtr (void *data, size_t len) override |
| Declare that the data at [x, x + len) is being written. More...
|
|
void | setRollbackWritesDisabled () override |
| Sets a flag that declares this RecoveryUnit will skip rolling back writes, for the duration of the current outermost WriteUnitOfWork. More...
|
|
SnapshotId | getSnapshotId () const override |
| Gets the local SnapshotId. More...
|
|
MobileSession * | getSession (OperationContext *opCtx) |
|
MobileSession * | getSessionNoTxn (OperationContext *opCtx) |
|
bool | inActiveTxn () const |
|
void | assertInActiveTxn () const |
|
void | enqueueFailedDrop (std::string &dropQuery) |
|
void | setOrderedCommit (bool orderedCommit) override |
|
virtual | ~RecoveryUnit () |
|
virtual void | prepareUnitOfWork () |
| Transitions the active unit of work to the "prepared" state. More...
|
|
virtual void | setIgnorePrepared (bool ignore) |
| Sets whether or not to ignore prepared transactions if supported by this storage engine. More...
|
|
virtual bool | waitUntilUnjournaledWritesDurable () |
| Unlike waitUntilDurable , this method takes a stable checkpoint, making durable any writes on unjournaled tables that are behind the current stable timestamp. More...
|
|
virtual void | preallocateSnapshot () |
| Informs the RecoveryUnit that a snapshot will be needed soon, if one was not already established. More...
|
|
virtual Status | obtainMajorityCommittedSnapshot () |
| Obtains a majority committed snapshot. More...
|
|
virtual boost::optional< Timestamp > | getPointInTimeReadTimestamp () const |
| Returns the Timestamp being used by this recovery unit or boost::none if not reading from a point in time. More...
|
|
virtual Status | setTimestamp (Timestamp timestamp) |
| Sets a timestamp to assign to future writes in a transaction. More...
|
|
virtual void | setCommitTimestamp (Timestamp timestamp) |
| Sets a timestamp that will be assigned to all future writes on this RecoveryUnit until clearCommitTimestamp() is called. More...
|
|
virtual void | clearCommitTimestamp () |
|
virtual Timestamp | getCommitTimestamp () |
|
virtual void | setPrepareTimestamp (Timestamp timestamp) |
| Sets a prepare timestamp for the current transaction. More...
|
|
virtual void | setTimestampReadSource (ReadSource source, boost::optional< Timestamp > provided=boost::none) |
| Sets which timestamp to use for read transactions. More...
|
|
virtual ReadSource | getTimestampReadSource () const |
|
template<typename Callback > |
void | onRollback (Callback callback) |
| Registers a callback to be called if the current WriteUnitOfWork rolls back. More...
|
|
template<typename Callback > |
void | onCommit (Callback callback) |
| Registers a callback to be called if the current WriteUnitOfWork commits. More...
|
|
int & | writingInt (int &d) |
| Declare write intent for an int. More...
|
|
template<typename T > |
T * | writing (T *x) |
| A templated helper for writingPtr. More...
|
|
void mongo::MobileRecoveryUnit::setRollbackWritesDisabled |
( |
| ) |
|
|
inlineoverridevirtual |
Sets a flag that declares this RecoveryUnit will skip rolling back writes, for the duration of the current outermost WriteUnitOfWork.
This function can only be called between a pair of unnested beginUnitOfWork() / endUnitOfWork() calls. The flag is cleared when endUnitOfWork() is called. While the flag is set, rollback will skip rolling back writes, but custom rollback change functions are still called. Clearly, this functionality should only be used when writing to temporary collections that can be cleaned up externally. For example, foreground index builds write to a temporary collection; if something goes wrong that normally requires a rollback, we can instead clean up the index by dropping the entire index. Setting the flag may permit increased performance.
Implements mongo::RecoveryUnit.
bool mongo::MobileRecoveryUnit::waitUntilDurable |
( |
| ) |
|
|
inlineoverridevirtual |
Waits until all commits that happened before this call are durable in the journal.
Returns true, unless the storage engine cannot guarantee durability, which should never happen when isDurable() returned true. This cannot be called from inside a unit of work, and should fail if it is.
- Returns
- Whether or not the storage engine can guarantee durability.
Implements mongo::RecoveryUnit.