rag_plusplus_core/wal/
mod.rs

1//! Write-Ahead Log (WAL)
2//!
3//! Provides durability guarantees for record operations.
4//!
5//! # Architecture
6//!
7//! ```text
8//! ┌─────────────────────────────────────────────────────────────┐
9//! │                   Write-Ahead Log (WAL)                      │
10//! ├─────────────────────────────────────────────────────────────┤
11//! │  1. Log entry to WAL (fsync)                                 │
12//! │  2. Apply to in-memory buffer                                │
13//! │  3. Periodically checkpoint to persistent store              │
14//! │  4. Truncate WAL after successful checkpoint                 │
15//! └─────────────────────────────────────────────────────────────┘
16//! ```
17//!
18//! # Invariants
19//!
20//! - INV-003: WAL-before-buffer (operations logged before applied)
21//!
22//! # Entry Types
23//!
24//! - Insert: Add a new record
25//! - UpdateStats: Update outcome statistics
26//! - Delete: Mark record as deleted
27
28mod entry;
29mod reader;
30mod writer;
31
32pub use entry::{WalEntry, WalEntryType};
33pub use reader::WalReader;
34pub use writer::{WalConfig, WalWriter};