Implement checkpoint modes with docs/tests and reorganize project file layout
All checks were successful
NuGet Publish / build-and-pack (push) Successful in 46s
NuGet Publish / publish-to-gitea (push) Successful in 53s

This commit is contained in:
Joseph Doherty
2026-02-21 07:56:36 -05:00
parent 3ffd468c79
commit 4c6aaa5a3f
96 changed files with 744 additions and 249 deletions

View File

@@ -29,6 +29,24 @@ Non-goals:
- `WriteAheadLog`
- Storage engine modules under `src/CBDD.Core/Storage`
Checkpoint APIs:
- `DocumentDbContext.Checkpoint(CheckpointMode mode = CheckpointMode.Truncate)`
- `DocumentDbContext.CheckpointAsync(CheckpointMode mode = CheckpointMode.Truncate, CancellationToken ct = default)`
- `StorageEngine.Checkpoint(CheckpointMode mode)`
- `StorageEngine.CheckpointAsync(CheckpointMode mode, CancellationToken ct = default)`
Checkpoint modes:
- `Passive`: non-blocking best-effort checkpoint. Returns `Executed = false` when lock is contended.
- `Full`: applies committed WAL pages and appends a WAL checkpoint marker without truncating WAL.
- `Truncate`: applies committed WAL pages and truncates WAL (default behavior).
- `Restart`: same as truncate, then reinitializes WAL writer session.
Usage guidance:
- Use `Passive` for background/low-priority maintenance where latency matters more than immediate WAL cleanup.
- Use `Full` when you want durable page-file sync but prefer to preserve WAL history until a later truncate.
- Use `Truncate` for routine manual checkpoints and disk-space recovery.
- Use `Restart` for aggressive maintenance boundaries (for example after incident remediation flows).
## Permissions And Data Handling
- Database files require host-managed filesystem access controls.