void TerarkDbRecoveryUnit::beginUnitOfWork(OperationContext* opCtx) {
    invariant(!_areWriteUnitOfWorksBanned);
    invariant(!_inUnitOfWork);
    _inUnitOfWork = true;
    _everStartedWrite = true;
    _getTicket(opCtx);
}
 void WiredTigerRecoveryUnit::beginUnitOfWork(OperationContext* opCtx) {
     invariant(!_inUnitOfWork);
     invariant(!_currentlySquirreled);
     _inUnitOfWork = true;
     _everStartedWrite = true;
     _getTicket(opCtx);
 }
void TerarkDbRecoveryUnit::_txnOpen(OperationContext* opCtx) {
    invariant(!_active);
    _getTicket(opCtx);

    LOG(2) << "TerarkDb begin_transaction";
    _timer.reset();
    _active = true;
}
    void WiredTigerRecoveryUnit::_txnOpen(OperationContext* opCtx) {
        invariant( !_active );
        _getTicket(opCtx);

        WT_SESSION *s = _session->getSession();
        _syncing = _syncing || waitUntilDurableData.numWaitingForSync.load() > 0;
        invariantWTOK( s->begin_transaction(s, _syncing ? "sync=true" : NULL) );
        LOG(2) << "WT begin_transaction";
        _timer.reset();
        _active = true;
    }
void WiredTigerRecoveryUnit::_txnOpen(OperationContext* opCtx) {
    invariant(!_active);
    _getTicket(opCtx);

    WT_SESSION* s = _session->getSession();
    _syncing = _syncing || waitUntilDurableData.numWaitingForSync.load() > 0;

    if (_readFromMajorityCommittedSnapshot) {
        _sessionCache->snapshotManager().beginTransactionOnCommittedSnapshot(s, _syncing);
    } else {
        invariantWTOK(s->begin_transaction(s, _syncing ? "sync=true" : NULL));
    }

    LOG(2) << "WT begin_transaction";
    _timer.reset();
    _active = true;
}
void WiredTigerRecoveryUnit::_txnOpen(OperationContext* opCtx) {
    invariant(!_active);
    _getTicket(opCtx);

    WT_SESSION* s = _session->getSession();

    if (_readFromMajorityCommittedSnapshot) {
        _majorityCommittedSnapshot =
            _sessionCache->snapshotManager().beginTransactionOnCommittedSnapshot(s);
    } else {
        invariantWTOK(s->begin_transaction(s, NULL));
    }

    LOG(2) << "WT begin_transaction";
    _timer.reset();
    _active = true;
}