Repository navigation
Fix server failing to start once after an upgrade when all_... system log tables are replaced on startup - #127630
Conversation
…runs When the system log tables are prepared on startup (`prepare_system_log_tables_on_startup`, implied by `startup_scripts`), `SystemLog::prepareUnionTable` replaces an obsolete `all_...` union table with `CREATE OR REPLACE` and drops the old one before `loadMarkedAsDroppedTables` runs. The dropped table is queued with its storage and still holds its UUID, so `loadMarkedAsDroppedTables` found its metadata in `metadata_dropped` and failed the startup with `TABLE_ALREADY_EXISTS` (UUID collision). The server started on the next attempt. Union tables are created by default since #117943, and `all_trace_log` depends on the build id, so this happened on every upgrade of a server with `startup_scripts`. Related: #117943 Related: #112670 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Match a file in `metadata_dropped` against the queued drops by disk and metadata path instead of by UUID. The path contains the UUID, so a differently named file with the same UUID is a real collision and still fails. Checking each file under `tables_marked_dropped_mutex` also covers a drop that happens while the directory is scanned. Log each skipped table. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Workflow [PR], commit [0641fc0] Summary: ✅
AI ReviewSummaryThe PR fixes the first startup after an upgrade failing when generated Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested; runtime validation remains with CI. |
Start `node4` with 26.8, the first release with union tables, and upgrade it with `restart_with_latest_version` instead of imitating an obsolete union table. `all_trace_log` contains the build id, so every upgrade replaces it. Without the fix, the first start of the new version fails with `TABLE_ALREADY_EXISTS` (UUID collision). Correction to the previous commit: checking each file under the mutex narrows the window for a drop that happens during the scan but does not close it, because `DatabaseAtomic::dropTableImpl` moves the metadata file before it queues the table. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 18 s compile time in total, 7 of them have a recent master baseline. |
Backport #127630 to 26.10: Fix server failing to start once after an upgrade when all_... system log tables are replaced on startup
Backport #127630 to 26.8: Fix server failing to start once after an upgrade when all_... system log tables are replaced on startup
Backport #127630 to 26.9: Fix server failing to start once after an upgrade when all_... system log tables are replaced on startup
…pgrade when all_... system log tables are replaced on startup
…pgrade when all_... system log tables are replaced on startup
…upgrade when all_... system log tables are replaced on startup
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix server failing to start once after an upgrade when all_... system log tables are replaced on startup
Workflow [PR]
Sync PR [sync-upstream/pr/127630]
Version info
26.11.1.691-master(included in26.11and later)