next.js
30072af8 - turbo-persistence: add TURBO_PERSISTENCE_MMAP=0 to disable mmap

Commit
6 hours ago
turbo-persistence: add TURBO_PERSISTENCE_MMAP=0 to disable mmap Adds support for disabling memory-mapped file I/O in turbo-persistence via the TURBO_PERSISTENCE_MMAP=0 environment variable. This is useful in environments where mmap is not supported or causes issues. Key changes: - Add `AccessMode` enum (Mmap / File) to control how SST and meta files are read - Add `access_mode` field to `DbConfig`, read from TURBO_PERSISTENCE_MMAP env var - Add `ArcBytes<'l>` with lifetime parameter and `MmapRef` backing variant to avoid cloning `Arc<Mmap>` in hot paths - Add `StaticSortedFileBacking` enum to support both mmap and file-backed reads - Add `pread`-based file reading path in `StaticSortedFile` for no-mmap mode - Make `get_raw_block_slice` return `ArcBytes<'_>` to avoid Arc::clone - Add `ArcBytes::into_static()` for owned promotion and `from_mmap_ref` for borrowing - Cache the env-var lookup in a `LazyLock` - `DbConfig::new()` and `Default` both read the env var (via shared helper) - Remove `RcBytes`/`SharedBytes` compaction path; use `StaticSortedFile::try_into_iter()` with backing-enum dispatch instead - Restore blob sequence number deletion during compaction for dropped entries Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Tobias Koppers <sokra@users.noreply.github.com>
Parents
Loading