PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
1. Timeline classification
- 1.1 Add
TIMELINE_SWITCH_DETECTEDandFAILOVER_DURING_BACKUPerror reasons, and verify enum serialization withcd backend && TEST_PARALLEL_WORKERS=1 go test -p=1 -count=1 ./internal/features/backups/backups/core/physical/enums - 1.2 Split FULL and INCR timeline decisions so INCR uses its root FULL timeline, and verify equal, newer, older, and different-cluster cases with
cd backend && TEST_PARALLEL_WORKERS=1 go test -p=1 -count=1 ./internal/features/backups/backups/usecases/physical/postgresql - 1.3 Recheck cluster identity after non-completed FULL and INCR streams while execution remains active, preserving cancellation and failed-probe results, and verify the executor tests with
cd backend && TEST_PARALLEL_WORKERS=1 go test -p=1 -count=1 ./internal/features/backups/backups/usecases/physical/postgresql
2. Automatic re-anchoring
- 2.1 Add scheduler decisions for one immediate FULL after
TIMELINE_SWITCH_DETECTEDorFAILOVER_DURING_BACKUP, carry the triggering row into transaction-time revalidation, suppress automatic scheduling while no completed FULL is newer than the latestSYSTEM_IDENTIFIER_MISMATCH, and verify priority, two-scheduler stale decisions, generic replacement failure, second promotion, mismatch failure, generic failure, cancellation and successful forced FULL attempts after mismatch, plusSUMMARIZER_OFF, withcd backend && TEST_PARALLEL_WORKERS=1 go test -p=1 -count=1 ./internal/features/backups/backups/backuping/physical
3. WAL and restore safety
- 3.1 Serialize FULL claim creation and orphan WAL deletion with the shared per-database transaction advisory lock, and verify both lock orderings plus
Test_CleanOrphanWalForDatabase_WhenFirstFullInProgress_KeepsWalArchivedDuringBackupwithcd backend && TEST_PARALLEL_WORKERS=1 go test -p=1 -count=1 ./internal/features/backups/backups/backuping/physical - 3.2 Let PITR resolution read unbounded contiguous WAL on the selected root FULL's timeline without changing retention spans, and verify
Test_ResolveRestoreSet_WhenTargetDuringNewerFull_UsesOlderChainWalThroughTargetplus existing gap tests withcd backend && TEST_PARALLEL_WORKERS=1 go test -p=1 -count=1 ./internal/features/backups/backups/core/physical/chain_view
4. Promotion coverage and final validation
- 4.1 Add PostgreSQL 17 and 18 promotion coverage showing that retained timeline history does not let a stale INCR cross its root FULL timeline, followed by automatic FULL on the promoted timeline, cleanup, and restore from the new chain, and verify with
cd backend && make test - 4.2 Run the complete backend checks with
cd backend && make test && make lint