Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!scripts/*.py
.DS_Store
/target
/wal_kv
/wal_files
digest.txt
*.csv
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ when you pass `true`.
### Advanced Configuration

```rust
use walrus_rust::{Walrus, ReadConsistency, FsyncSchedule, enable_fd_backend};
use walrus_rust::{Walrus, ReadConsistency, FsyncSchedule};

// Configure with custom consistency and fsync behavior
let wal = Walrus::with_consistency_and_schedule(
Expand All @@ -85,7 +85,7 @@ wal.append_for_topic("events", b"event data")?;

- **Read consistency**: `StrictlyAtOnce` persists every checkpoint; `AtLeastOnce { persist_every }` favours throughput and tolerates replays.
- **Fsync schedule**: choose `SyncEach`, `Milliseconds(n)`, or `NoFsync` when constructing `Walrus` to balance durability vs latency.
- **Storage backend**: FD backend (default) uses pread/pwrite syscalls and enables io_uring for batch operations on Linux; `disable_fd_backend()` switches to the mmap backend.
- **Storage backend**: FD backend (default) uses pread/pwrite syscalls and enables io_uring for batch operations on Linux.
- **Namespacing & data dir**: set `WALRUS_INSTANCE_KEY` or use the `_for_key` constructors to isolate workloads; `WALRUS_DATA_DIR` relocates the entire tree.
- **Noise control**: `WALRUS_QUIET=1` mutes debug logging from internal helpers.

Expand Down
3 changes: 0 additions & 3 deletions benchmarks/batch_scaling_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,16 @@ fn configure_storage_backend() {
{
match selection.as_deref() {
Some("mmap") => {
walrus_rust::disable_fd_backend();
println!("Storage backend: mmap");
}
Some("fd") | Some("io_uring") | Some("uring") | Some("file") | None => {
walrus_rust::enable_fd_backend();
println!("Storage backend: fd");
}
Some(other) => {
println!(
"Unknown storage backend '{}'; defaulting to fd (io_uring) backend.",
other
);
walrus_rust::enable_fd_backend();
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions benchmarks/multithreaded_benchmark_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,16 @@ fn configure_storage_backend() {
{
match selection.as_deref() {
Some("mmap") => {
walrus_rust::disable_fd_backend();
println!("Storage backend: mmap");
}
Some("fd") | Some("io_uring") | Some("uring") | Some("file") | None => {
walrus_rust::enable_fd_backend();
println!("Storage backend: fd");
}
Some(other) => {
println!(
"Unknown storage backend '{}'; defaulting to fd (io_uring) backend.",
other
);
walrus_rust::enable_fd_backend();
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,9 @@ sequenceDiagram

## Backend Selection

- `enable_fd_backend()` flips a process-wide atomic that forces new blocks to
use the fd-backed storage (and therefore enables `io_uring` batching on Linux).
- `disable_fd_backend()` reverts to mmap-backed accesses; batch writes fall back
to sequential writes and batch reads use direct mmap parsing.
- The default is FD+`io_uring` when supported; non-Linux builds automatically
live on the mmap backend.
- The FD backend uses fd-backed storage and enables `io_uring` batching on Linux.
- The mmap backend uses mmap-backed accesses; batch writes fall back to sequential writes and batch reads use direct mmap parsing.
- The default is FD+`io_uring` when supported; non-Linux builds automatically live on the mmap backend.

## Concurrency & Synchronization

Expand Down
2 changes: 1 addition & 1 deletion docs/batch_writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub fn write(&self, data: &[u8]) -> std::io::Result<()> {

### Required
- `io-uring` crate (already in use)
- FD backend must be enabled (`enable_fd_backend()`)
- FD backend (enabled by default on Linux)
- Linux kernel with io_uring support

### Not Required
Expand Down
Loading
Loading