1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-License-Identifier: Apache-2.0
//! WAL writer with O_DIRECT and group commit.
//!
//! The writer accumulates records into an aligned buffer and flushes to disk
//! when the buffer is full or when an explicit sync is requested.
//!
//! ## I/O path
//!
//! 1. Caller creates a `WalRecord` and submits it to the writer.
//! 2. Writer serializes the record into the aligned write buffer.
//! 3. When the buffer is full or `sync()` is called, the buffer is written
//! to the WAL file via `O_DIRECT` + `fsync`.
//! 4. Group commit: multiple concurrent writers can submit records between
//! syncs, and they all share a single `fsync` call.
//!
//! ## Future: io_uring
//!
//! The current implementation uses standard `pwrite` + `fsync` with O_DIRECT.
//! io_uring submission can be added once the bridge crate provides the TPC
//! event loop integration.
// Crate-visible so the io_uring writer can reach `resume_offset` directly.
// Re-exporting it here instead would be dead code whenever the `io-uring`
// feature is off, and cfg-gating the re-export just duplicates that condition.
pub
// Crate-visible for the same reason as `config`: the io_uring writer shares
// the flushed-but-unsynced tracking without going through `WalWriter`.
pub
pub use ;
pub use WalWriter;