Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Adds a
pbkfs mount --no-waloption that makes WAL underpg_wal/effectively virtual: PostgreSQL sees a consistent PGDATA view, but WAL mutations are not materialized intopbk_diff. This reduces I/O and disk usage for recovery/analysis runs where WAL is disposable.User-visible behavior
pbkfs mount ... --no-wal(default: off).pg_wal/.[0, logical_size)and EOF at/afterlogical_size.write,truncate,create/mknod,rename,unlink,fsync,fallocateare emulated in-memory and reported as successful, without touchingpbk_difforpbk_store.--no-walmount:--no-walmount emits a warning.no_wal_used=true.--no-wal) fails with a clear error.Implementation overview
CLI / Binding
no_waltoMountArgs, setPBKFS_NO_WALconsistently.no_wal_usedin binding and reject reuse when set.src/cli/mount.rs,src/binding/lock.rs.Overlay
OverlayInner.no_walinitialized fromPBKFS_NO_WAL.no_wal, reads use a non-materializing path; legacy WAL copy-up fallback is disabled.src/fs/overlay.rs.FUSE layer
no_walflag and an in-memorywal_statemap toOverlayFs.readdirandstat_path/getattrsynthesize WAL entries from WAL state.src/fs/fuse.rs.Tests
MountArgsinitializations to includeno_wal.--no-wal+ write topg_wal/<seg>⇒ reads return zeros,stat.sizereflects logical growth, no WAL diff file is created.--no-wal+ unchanged WAL read ⇒ bytes come from backup chain without diff materialization.tests/integration/mount_postgres_tests.rs.no_wal_usedon first--no-walmount and reuse is rejected.tests/contract/cli_contract_tests.rs.PBKFS_NO_WALintono_wal.no_wal_usedround-trips and defaults to false.tests/unit/fs_overlay_tests.rs,tests/unit/binding_tests.rs.Notes
pbk_diffin this mode.