Repository navigation
fix: preserve scan data across failed loads and rebuilds - #449
Merged
Merged
Conversation
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
TheWitness
approved these changes
Nov 17, 2026
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.



Fixes #448. Follow-up to #427/#437 and #447.
A failed scan copy could reach temp-table cleanup, a failed date read could delete valid metadata, and an interrupted aggregate rebuild could count its source twice. This change:
Validation: the full suite passed on PHP 8.2.35 and 8.3.36 with MariaDB 11.8.9 (1,013 passed, one root-only permission-test skip on each). Seven real-database recovery cases cover copy/drop failures, direct/exchange read/write failures, and scan-date retry. The aggregate fixture ends at 30 rather than 40 after retry; all 1,001 staged scan rows survive. The 91 focused tests also execute the poller cleanup decision and utility failure/success messages. Eighteen tests fail against the original production code.
Xdebug on PHP 8.4.25 exercised all 47 changed executable lines in the three library files. The existing test helper extracts poller/web functions into temporary files, so those entry-point lines are behavior-tested but are not attributed to their original files in Clover. This is not a claim of 100% whole-plugin coverage. PHP syntax, manifest and translation-template checks are included; the formatter still reports unrelated pre-existing differences in the MacTrack files.
Recovery/rollback: an unmarked nonempty migration source beside a populated destination is ambiguous because older workers deleted copied source rows. The fix preserves both and logs that manual recovery is needed. Keep backups of both tables and establish which contains the complete history before restarting such a migration. Do not force the copying marker merely because a source table exists. Complete or recover an interrupted migration before reverting to the previous additive retry behavior. Already-lost rows or already-inflated counts are not reconstructed automatically.