Conversation
x4m
force-pushed
the
redacted-basebackup
branch
from
September 4, 2026 10:36
1fbee2f to
e67410f
Compare
CPG service users need a physical backup and continuing WAL stream without copying cluster-wide role data or planner statistics. Existing replication privileges expose the complete data directory and WAL. Add ycmdb.redacted_physical_backup, disabled by default. When enabled, allow mdb_admin members without full replication privileges to use a restricted subset of the physical replication protocol. Omit pg_authid, pg_statistic, and pg_statistic_ext_data storage from base backups and replace WAL records modifying that storage with equal-length XLOG_NOOP records. Preserving record lengths leaves LSNs and the rest of the stream unchanged. The format relies on the bootstrap relfilenumbers of the omitted catalogs. Interlock restricted senders with catalog rewrites and permanently disable the format after the first rewrite attempt. Replicate the disablement in a versioned XLOG_NOOP payload. Close a restricted sender after an error so that transaction cleanup cannot release the interlock and then reuse the connection. Require streamed WAL, reject incremental backups, and disallow restricted senders during recovery. Exercise the protocol restrictions, omitted files, recovery, continued streaming, and rewrite disablement in TAP.
reshke
force-pushed
the
redacted-basebackup
branch
from
September 4, 2026 10:48
e67410f to
6701930
Compare
added 2 commits
September 4, 2026 23:15
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.
Summary
ycmdb.redacted_physical_backuprollout gatemdb_adminmembers without full replicationprivileges to take a redacted physical backup and consume its WAL stream
pg_authid,pg_statistic, andpg_statistic_ext_datastorageXLOG_NOOPrecords, preserving LSNs and the remaining stream
The service creates a persistent physical slot and restores the omitted
catalogs from trusted storage before starting PostgreSQL from the backup.
The GUC is latched when a replication connection starts, so rollout or
rollback requires reconnecting the client. Incremental backups and embedded
WAL are intentionally outside format version 1.
Validation
make -j12 -ssrc/bin/pg_basebackupTAP suite: 386/386boundary