Repository navigation
Tolerate a missing file when cleaning up a corrupted in-memory backup - #109947
Conversation
A BackupFileInfo can have an empty data_file_name (an empty file, or a whole-file reference to a base backup). Pushing an empty name into the list passed to removeFiles could resolve to the backup root on some writers, so skip such entries. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
A BACKUP ... TO Memory(...) that fails before finalization never writes the `.backup` metadata file. tryRemoveAllFiles still tried to remove it, and BackupInMemory::removeFile threw BACKUP_ENTRY_NOT_FOUND, aborting cleanup and leaving the backup registered so the name could not be reused. Make the in-memory writer's removal best-effort, matching the S3, Disk and File writers, and log a missing entry instead of ignoring it silently. Adds a backup_fail_before_writing_metadata failpoint and a regression test. Related: #109861 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [2d5e04f] Summary: ✅
AI ReviewSummaryThis PR hardens failed-backup cleanup by making Missing context / blind spots
Final Verdict
|
The style check rejects test filenames containing 'fail'. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Exercises tryRemoveAllFiles on a Disk (non-memory) writer: an unchanged
incremental backup has fully base-backed entries whose data_file_name is empty.
Without the guard, cleanup of a backup that failed before finalization calls
removeFile(""), which resolves to the backup root (root_path / ""), unlinks the
backup directory (EISDIR) and throws, aborting cleanup and leaving the failed
backup behind so its destination cannot be reused. The test asserts the
destination is reusable after the failure.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The failed backup prints FAULT_INJECTED more than once (server-forwarded log line, client exception, and the error-code suffix), so grep -o emitted several lines. Keep only the first so the output is deterministic. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…mory-cleanup-tolerate-missing-files
The previous comment said 'base-backup reference', which reads as a `BackupEntryReference`. It actually means a file wholly covered by the base backup. Reword to name the two empty-`data_file_name` cases directly (empty file, or wholly base-covered) and why the skip matters. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
CI failures are unrelated to this PR (which touches only
Both are pre-existing, tracked flakies. Retrying the failed jobs. |
|
📊 Cloud Performance Report ✅ AI verdict: This is a BACKUP-subsystem bugfix (failed-backup cleanup in BackupImpl/BackupInMemory, a new failpoint, and two regression tests) — it does not touch any SELECT query execution path. The three flagged ClickBench queries (Q4 -20.2%, Q15 -20.6%, Q17 +10.1%) all show unchanged CPU time while wall-clock moved, and every median sits within master's current-era variance band, so the deterministic within-envelope suppression is correct. These deltas are run-to-run cache variance, not effects of this PR. No actionable performance change. clickbenchFlagged queries (1 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 23/23 (100.00%) · Uncovered code |
…-memory-cleanup-tolerate-missing-files Tolerate a missing file when cleaning up a corrupted in-memory backup
A
BACKUP ... TO Memory(...)that fails before finalization never writes the.backupmetadata file. The cleanup path (tryRemoveAllFiles) still tried to remove it, andBackupInMemory::removeFilethrewBACKUP_ENTRY_NOT_FOUND, aborting cleanup and leaving the backup registered — so the sameMemory(...)name could not be reused (it failed withBACKUP_ALREADY_EXISTS).This makes the in-memory writer's removal best-effort (logging a missing entry at
DEBUGinstead of throwing), matching theS3,DiskandFilewriters, and skips emptydata_file_nameentries so an empty name cannot resolve to the backup root. Both issues predate the refactoring and were found by the review bots on #109861.A
backup_fail_before_writing_metadatafailpoint and a stateless regression test (04509_backup_to_memory_cleanup_after_failure) are added.Depends on #109861 — this branch is based on it and includes its commits so CI runs against a complete tree. #109861 should merge first; afterwards this PR's diff reduces to the cleanup fix, the failpoint, and the regression test.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed cleanup of a
BACKUP ... TO Memory(...)that fails before finalization: the failed backup was left registered so its name could not be reused.Version info
26.7.1.1311(included in26.7and later)