Repository navigation
fix(backend): preserve JobUUID and create its index online on 2.18 - #14874
Merged
jeffspahr merged 6 commits intoOct 15, 2026
Merged
Conversation
Contributor Report for @jeffspahr
|
This was referenced Oct 14, 2026
Collaborator
|
AA review summary for #14874: fix(backend): preserve JobUUID and create its index online on 2.18
|
Collaborator
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: droctothorpe The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
New changes are detected. LGTM label has been removed. |
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
jeffspahr
force-pushed
the
codex/218-online-jobuuid-index
branch
from
October 15, 2026 00:49
7cb1042 to
3320bdf
Compare
36 of 42 tasks
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.
Problem
The recurring-run lookup index added in #14679 also changed
run_details.JobUUIDfromvarchar(255)tovarchar(191). MySQL cannot shrink that column withALGORITHM=INPLACE; API startup can therefore copy a large run table and interrupt writes just to add a lookup index.Change
Preserve the existing
JobUUIDtype and width during schema reconciliation, including installations that already havevarchar(191)and historical text columns. Keep the lookup index, but prepare it separately:ALGORITHM=INPLACE, LOCK=NONEand uses a nonunique 191-character prefix. 191 is a conservative index-prefix compatibility choice, not a stored-column limit or a modern database requirement. It supports historical text columns and older row formats without column conversion. Ordinary schedule UUIDs fit entirely within the prefix; longer identifiers remain intact and queries compare the full value. Equal prefixes can require extra comparisons. Keep this uniform approach rather than add schema-dependent index selection with no meaningful benefit for ordinary UUIDs."JobUUID"withCREATE INDEX CONCURRENTLYoutside a transaction. It does not use the MySQL prefix or narrow existing columns. PostgreSQL's normal index-entry size limits still apply to unusually large historical text values.JobUUIDcolumns usevarchar(255).This targets
release-2.18: the narrowing/index tag was introduced on that branch. Updates the changelog and database development guidance; #14703 carries the operator/agent guides. Tracking: #14421.Validation
3320bdf99.7cb1042fb.TABLE_IDremained unchanged. The removed narrowing fails the explicit online-algorithm negative control.Operational limits
This removes the JobUUID table-copy hazard, not every possible startup availability impact. Online index construction still consumes I/O/disk and takes brief metadata locks; waiting metadata locks can delay writes until the five-second timeout. Preparation is synchronous, with a 30-minute deadline, and failed attempts stop that API process's startup with an actionable error. MySQL advisory-lock acquisition waits up to ten seconds; PostgreSQL reports another preparer immediately. Existing replicas are not stopped by this helper.
An interrupted PostgreSQL concurrent build can leave an invalid index requiring inspection/repair before startup succeeds; it is never dropped automatically. Other startup schema changes/reference backfills remain separate, and separate retention-index automation and prepare-only staging are covered by #14877 (backport of #14876).