GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — fix(cold-store): verify backup uploads (#3230) by dezren39 · Pull Request #4330 · developing-today/code Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b0069968d
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if status != 200: | ||
| raise ColdStoreError( | ||
| f"files.get after backup upload failed (HTTP {status})" | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Account for backups left in Drive after verification fails
If the upload succeeds but the metadata GET returns 503, this raises without removing the uploaded file or accounting for its bytes. _upload_accounting() derives daily upload usage and retained backup bytes from the transfer ledger, so retries can upload additional full copies without consuming either configured budget. Furthermore, prune_backups() lists these unledgered files and records backup-prune rows when trashing them, incorrectly subtracting their sizes from successfully ledgered backups. Preserve the refusal to record verification success, but separately account for transferred bytes and ensure failed artifacts are either tracked or cleaned up.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f4351b8 (pushed to this PR): all three verification-failure raises in put_backup now route through a verification_failed helper that trashes the uploaded Drive file (PATCH {"trashed": true} — the same removal mechanism prune_backups uses) before raising ColdStoreError, so a failed verification never leaves a live, unledgered artifact for _upload_accounting() or prune_backups() to trip over. If the trash itself fails, the error message names the orphaned file id so it stays findable. The refusal to ledger an unverified backup is unchanged.
Regression coverage (3 new tests in test_cold_store.py): mismatch trashes the upload, read-back 503 trashes the upload, and a failed trash still raises the original mismatch error with the orphan named. Full suite on the laptop: python3 -m unittest discover -s pkgs/cold-store-reaper/tests — 121 tests OK (1 skipped).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Codex P2 on PR #4330: put_backup raised on read-back failure or md5/size mismatch but left the uploaded file live in Drive unledgered, distorting _upload_accounting budgets and meeting prune_backups later as a phantom backup. Route all three verification-failure raises through a helper that trashes the uploaded file (retention's own removal mechanism) before raising ColdStoreError, and names the orphan in the error if the trash itself fails. Three regression tests cover mismatch-trash, readback-failure-trash, and trash-failure reporting. Suite: python3 -m unittest discover -s pkgs/cold-store-reaper/tests - 121 tests OK (1 skipped), up from 118.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.