Uh oh!
There was an error while loading. Please reload this page.
docs(drivers): document the MySQL migration metadata-lock bound and its two answers - #9608
Merged
Merged
Conversation
…ts two answers `drivers.mdx` documented SqlDriver's two connect-timeout defaults but not the third driver-supplied bound: `lock_wait_timeout = 120` on the session running a widening ALTER, replacing MySQL's inherited one-year default. The bound is armed on both callers, with deliberately different answers when it fires: `os migrate apply` refuses with an ADR-0112 `DATABASE_ERROR` / 500 envelope and exits 1, while boot schema sync warns and carries on. The second is the counterintuitive one an operator needs stated — the widening did not happen and the platform is running anyway — so it gets the emphasis, the exact warning text to match on, and what the un-widened column actually costs. Placed as the last subsection of the MySQL section, not as a row in the PostgreSQL `### Connect timeouts` table (that one is about the TCP/handshake bound) and not in the `### MySQL dialect caveats` table (those are dialect limits; this is driver-supplied behaviour). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja
os-steve
marked this pull request as ready for review
August 18, 2026 13:45
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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#9543
content/docs/data-modeling/drivers.mdxdocumented the two connect-timeout defaultsSqlDriversupplies, but not the third driver-supplied bound of the same genre:lock_wait_timeout = 120on the session running a wideningALTER, replacing MySQL's inherited default of 31,536,000 s (one year). Adds### The migration metadata-lock boundas the last subsection of the MySQL section.Two behaviours, one bound — both documented
The card as originally filed described one behaviour (the
os migrate applyrefusal). Its comment thread records that #9542 / PR #9565 (8bbf459) later armed the same bound on boot schema sync with a deliberately different answer, so the page had to cover both. Re-derived frompackages/drivers/driver-sql/src/sql-driver.tsonmain, not from the card:os migrate apply(deferred-DDL flush)DATABASE_ERROR/ 500, exit 1deferredDdlLockWaitErrorsetscode/status; the refusal is gated atthis.flushingDeferredDdl && isMysqlLockWaitTimeout(err)migrateMysqlDatetimeColumns/migrateMysqlTimeColumnsloglogger.warnand swallowThe boot row gets the emphasis, because its operator-visible consequence is counterintuitive: the widening did not happen and the platform is running anyway. The page states the exact warning text to match on, why matching the server's own lock-wait message instead is wrong (MySQL and MariaDB word it differently and both translate it), and what an un-widened column actually costs.
The refusal message, the two warning texts, the 120 s value, the one-year default, and
DATABASE_ERROR/ 500 are all quoted from the code rather than from the card.Premise checks — one card claim did not survive
The card and its comments place the section in the MySQL section because it "already covers the
TIMESTAMPtoDATETIME(3)widening this bound protects". That is not true ofmain:drivers.mdxhad zero occurrences ofdatetime,timestamp,widen,2038,lock_waitormetadata lock, case-insensitively, with the control query (### Connect timeouts, line 316) positive — a measurement, not a dead grep. The widening's type rationale lives incontent/docs/protocol/objectql/types.mdx. The placement verdict still holds, but the new section therefore has to introduce the widening itself before it can bound it, and cross-links to the type system page rather than assuming prior context.Two further checks, both negative — no second unreported error:
### Connect timeoutstext is still accurate.DEFAULT_CONNECT_TIMEOUT_MS = 10_000andDEFAULT_CREATE_TIMEOUT_MS = 15_000are unchanged; the lock bound is a session variable set at ALTER time, not a Knex config default, so "passing it through unchanged except for two connect-timeout defaults" stays correct.widened MySQL TIMESTAMP to DATETIME(3)info line predates it — and the session's priorlock_wait_timeoutis restored, so the bound never reaches unrelated runtime queries.Placement
Not a row in
### Connect timeouts(PostgreSQL section, TCP/handshake bound) and not a row in### MySQL dialect caveats(that table is explicitly three dialect limits; this is driver-supplied behaviour). It sits as the final###subsection of## MySQL, before## MongoDB.Not done here
packages/drivers/driver-sql/src/sql-driver.tsis untouched — this documents what it does.content/docs/releases/is untouched, per the on-card prohibition and CLAUDE.md.Gates
All run after the final commit, at
4c6680485. Derived from the changed path withnode scripts/pm/dispatch-gates.mjs content/docs/data-modeling/drivers.mdx(7 families), pluscheck:nul-bytesfor any edit:drivers.mdxcarries zero occurrences of the ratcheted wordcheck:role-wordguards, so it is not baselined and any use would have been a new-file failure — the new prose deliberately avoids it. The file was also compiled through@mdx-js/mdxdirectly (MDX COMPILE OK), since a stray JSX-looking construct in hand-written MDX only fails at docs build time.Docs-only, so no changeset —
skip-changesetper the repo's precedent forcontent/docs-only PRs.Generated by Claude Code
Generated by Claude Code