Repository navigation
Conversation
A concurrent TRUNCATE can replace table storage after the backup snapshot but before table locks are acquired. Backup and restore can then report success while restoring an empty table. On Cloudberry, validate storage and table identity after locking, including descendant partitions. Add --snapshot-attempts (default 3) to retry with a fresh shared snapshot, rebuild filters, and discard heap file hashes. Fail the backup when the limit is reached.
|
Hi @talmacschen-arch @liang8283, welcome to help review when you're available. Thanks! |
|
Reviewed by Claude Code. FYI. |
|
Storage-change check also trips on MVCC-safe rewrites, and can fail backups.
On a Cloudberry cluster with 60 heap tables, running this branch's Another run only succeeded on the last attempt. The same workload backed up by Besides failing backups whose data was fine, every false-positive retry also discards |
Problem
gpbackuptakes its snapshot before acquiring table locks. ConcurrentTRUNCATEcan replace storage while it waits, so backup and restore report success but restore an empty table, hiding data loss.Reproduction
{1,2,3}on Cloudberry.TRUNCATEand insert{4,5,6}without committing.gpbackup, wait untilpg_locksshows the backup waiting forAccessShareLockon this table, then commit the writer.0, but the restored table is empty.Fix
--snapshot-attempts(default3) to retry with a fresh shared snapshot and fail the backup when attempts are exhausted.