Repository navigation
[rc-1.6.0] Schema updater: repair and retry once when a step names a missing table - #2002
Merged
mastacontrola merged 1 commit intoOct 28, 2026
Conversation
A 1.5.10.2518 server arrives at vValue 288. 1.6 fills positions 287 and 288 with CREATE TABLE fileDeleteQueue and its first ALTERs, so an upgrade skips them and step 290 ALTERs a table that is not there: 1146. That code is not tolerated, so the update stopped. The reconcile after the loop then created the table, but the installer had already printed "Failed!" with the server left at 289, and only a second run finished the upgrade. On 1146, run SchemaReconciler::reconcile() at the point of failure and execute the statement once more. That is the second run's path, inside the first. Any other error, a repair that fails, or a retry that still fails is reported exactly as before. Measured on a fresh 1.5.10.2518 (stable c97e205) upgraded to rc-1.6.0 at 4983c25: one pass, Setup complete, vValue 445, no fog_schema_update_error.log, and an image captured on 1.5 deploys from the upgraded server. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 1317cd8)
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.
Port of #2001 to
rc-1.6.0.Problem
Upgrading a fresh 1.5.10.2518 to RC-19 stops on the first pass:
A second
installfog.shrun finishes the upgrade. Details in #2000.Cause
1.5.10.2518 arrives at
vValue288. 1.6 fills positions 287 and 288 withCREATE TABLE fileDeleteQueueand its first ALTERs, so the updater skips them, and// 290ALTERs a table that is not there. 1146 is not in$skiperrs, soupdate()breaks out of the loop. The reconcile after the loop then creates the table, two seconds later in the lab. But the error is already recorded, so the installer printsFailed!andvValuestays at 289.The second run works because it starts from the database that reconcile already repaired.
Fix
_repairAndRetry(): on 1146, runSchemaReconciler::reconcile()at the point of failure, then execute the same statement once more. The statement then succeeds, or hits a code$skiperrsalready tolerates (1060 here, since the reconciler creates the table in its final shape). That is the second run's path, taken inside the first.Unchanged:
true, which leaves the statement's own error for the caller to report;A server whose tables all exist never sees 1146, so nothing changes for it.
$skiperrsandSchemaReconciler::$_skiperrsare not touched, sotests/schema-executes.test.php's check that the two lists match is not affected.Tests
tests/schema-updater-repairs-missing-table.test.php, 16 checks, no database. It covers the repair and retry, a retry that lands on 1060, a retry that fails again, a repair that fails, three other error codes, and the call site inupdate(). It fails with the method removed, and fails 1 of 16 with only the call site removed.tests/run-all.sh: 398 passed, 20 failed. The same 20 fail on an unmodifiedworking-1.6checkout on this machine. They need a FOG install (/opt/fog/sessions, generated config).src/Base/FOGBase.phpas an unmodified checkout here, none in the changed file.stablec97e205), one image captured, thenrc-1.6.0at 4983c25 with this change applied,installfog.sh -y --channel rc. Result: one pass,Updating Database...OK,Setup complete,vValue445, nofog_schema_update_error.log. The 1.5 image deploys from the upgraded server, and the clone carries the source's marker file.users.uNameandusers.uCreateBy, carried from 1.5 (noted in RC-19 test report: upgrade from 1.5.10.2518 fails on the first pass (schema 290), and a rerun deletes the 1.5 web backup #2000).🤖 Generated with Claude Code