| 28 | WAL::~WAL() {} |
| 29 | |
| 30 | void WAL::logCommittedWAL(LocalWAL& localWAL, main::ClientContext* context, |
| 31 | uint64_t& commitSequence) { |
| 32 | DASSERT(!readOnly); |
| 33 | commitSequence = 0; |
| 34 | if (inMemory || localWAL.getSize() == 0) { |
| 35 | return; // No need to log empty WAL. |
| 36 | } |
| 37 | std::unique_lock lck{mtx}; |
| 38 | throwIfPoisonedNoLock(); |
| 39 | initWriter(context); |
| 40 | localWAL.inMemWriter->flush(*serializer->getWriter()); |
| 41 | commitSequence = ++appendedCommitSequence; |
| 42 | waitForDurabilityNoLock(commitSequence, lck); |
| 43 | } |
| 44 | |
| 45 | void WAL::logAndFlushCheckpoint(main::ClientContext* context) { |
| 46 | std::unique_lock lck{mtx}; |