| 392 | } |
| 393 | |
| 394 | bool Checkpointer::canAutoCheckpoint(const main::ClientContext& clientContext, |
| 395 | const transaction::Transaction& transaction) { |
| 396 | if (clientContext.isInMemory()) { |
| 397 | return false; |
| 398 | } |
| 399 | if (!clientContext.getDBConfig()->autoCheckpoint) { |
| 400 | return false; |
| 401 | } |
| 402 | if (transaction.isRecovery()) { |
| 403 | // Recovery transactions are not allowed to trigger auto checkpoint. |
| 404 | return false; |
| 405 | } |
| 406 | auto wal = &clientContext.getDatabase()->getStorageManager()->getWAL(); |
| 407 | const auto expectedSize = transaction.getLocalWAL().getSize() + wal->getFileSize(); |
| 408 | return expectedSize > clientContext.getDBConfig()->checkpointThreshold; |
| 409 | } |
| 410 | |
| 411 | void Checkpointer::readCheckpoint() { |
| 412 | // IMPORTANT: Use the main database's storage manager, NOT StorageManager::Get() which |
nothing calls this directly
no test coverage detected