Repository navigation
ci(seekdb): retain migration timeout diagnostics - #1945
Zxf-xufeng wants to merge 3 commits into
Conversation
SeekDB RUNTIME:1 lock stall: evidence and reproductionRefs #1920 and #1716. The stall has now been observed in Ubuntu CI, and a related lock-stall symptom was reproduced in an isolated macOS test. The underlying defect is not fixed, and the current reproducer is probabilistic, not deterministic. These observations do not establish that #1945's diagnostic changes have passed their own CI or fixed the issue. Confirmed CI failure
All times in this timeline are 2026-10-12 UTC:
The transaction snapshots also show The CI lock owner is the dependency-information maintenance background thread ( Reproduction procedureUse a disposable Linux checkout with Git, uv and Python 3.11 available. The commands below install the repository's locked dependencies, start temporary native SeekDB instances and write potentially large diagnostic logs. They do not require an external database or production credentials. Each attempt uses its own temporary database. The reproducible source snapshot below is the #1716 head associated with the failure; the original GitHub run used the CI merge commit noted above. The probe is linked explicitly because it is a separate script from #1945's supervisor. repro_root="$(mktemp -d /tmp/pc-seekdb-repro.XXXXXX)"
git clone https://github.com/oceanbase/powercontext.git "$repro_root/repo"
cd "$repro_root/repo"
git checkout --detach 0b4dd71c0e5f8189096f2958e79007440c438da2
uv run --python 3.11 --locked --extra seekdb \
python scripts/probe_seekdb_migration_lock.py \
--attempts 12 \
--timeout 180 \
--output "$repro_root/evidence"
probe_exit=$?
printf 'Probe exit: %s\nEvidence: %s\n' "$probe_exit" "$repro_root/evidence"Probe source · CI workflow · Test source The probe runs the selected test sequentially, with a fresh disposable database per attempt, and stops at the first failure. The test loads the pre-migration schema and sample rows, runs migration planning/application across native close/reopen cycles, and tests recovery after a committed DDL interruption. The observed stall occurs while executing The probe retains:
Temporary engine files are removed after log collection; the evidence directory is retained. Use a fresh output directory for each invocation. Matching the failure and interpreting the resultA timeout alone is insufficient. Confirm the combination of a stalled DDL, a Twelve successful attempts do not prove the defect absent. The fourth-attempt failure is one observed run, not a measured failure rate. A deterministic reproducer would need a validated native synchronization/fault-injection point that closes the instance after the background transaction acquires the lock; no such deterministic reproducer has been established. Evidence location and remaining investigationArtifact ID The evidence supports investigating unfinished background transactions across embedded close/reopen and recovery. Why SeekDB does not promptly commit/abort this transaction and release the lock remains unresolved. Lock acquisition by a background task is not itself proof of a defect; the persistence and cleanup behavior require investigation. Increasing the test timeout or observing a later passing run would not establish a fix. |
Which issue or RFC does this PR close?
Refs #1920. The reopen/DDL hang is caused by a seekdb transaction-recovery bug, identified in oceanbase/seekdb#1499. This PR preserves diagnostic evidence; it does not implement or deliver the upstream engine fix and does not close the issue. See the investigation evidence and reproduction procedure for the reproduction commands and the distinction between the CI and local lock owners.
Rationale for this change
When embedded seekdb stalls on
CREATE TABLE pc_schema_revision, the existing 8 MiB log tails can lose the earlier transaction that acquired the lock. Preserve the available native history and capture live lock evidence before terminating the stalled test so the next Ubuntu CI failure can be investigated.Confirmed root cause
After a data directory is reopened, seekdb reconstructs undecided transactions and their locks from redo. The recovered transactions remain marked
for_replay, but both garbage collection and timeout handling exclude those replay contexts. Without takeover into local transaction completion, the recovered transaction can retain row or MDS table locks indefinitely. This explains why closing and reopening the engine did not clear theRUNTIME:1exclusive lock blockingCREATE TABLE pc_schema_revision; the problem is missing recovery completion, rather than evidence of an unusually slow rollback. The root cause and proposed fix are documented in seekdb PR #1499.The upstream fix takes over recovered transactions after the replay barrier and log-append activation, before admitting new transactions. It durably aborts recovered INIT transactions and undecided MDS table-lock transactions, resumes the existing commit protocol for other complete REDO_COMPLETE contexts, and arms completion retries before leaving replay mode. Incomplete or unexpected contexts retain replay protection and fail activation.
Our extended Ubuntu/Python 3.11 observation, using reproduction commit
0b4dd71c0e5f8189096f2958e79007440c438da2andpylibseekdb==1.4.0.post1, passed 10 attempts and reproduced the hang on attempt 11. All 22 snapshots from 45 through 990 seconds showed transaction1000002holding the sameRUNTIME:1X lock, created at2026-10-12T11:16:33.254907Z. After two subsequent close/reopen cycles, the last valid snapshot at2026-10-12T11:32:57.764578Zstill showed it held: a confirmed lower bound of 984.51 seconds. The DDL then returned(4012, 'Timeout')after approximately 1000 seconds; the attempt exited after 1010.55 seconds withtimed_out: false, before the 1200-second probe deadline. No valid lock-absent snapshot was captured, so SQL timeout and subsequent teardown do not establish a lock-release time. Evidence:seekdb-lock-observation-38235338219-1.At the time of this update, seekdb PR #1499 is open. Its reported regressions cover uncommitted row-redo recovery and preservation of committed data; a separate MDS table-lock recovery case is not included. The original PowerContext reproduction still needs validation against a seekdb build containing the fix. This diagnostic PR does not change the seekdb dependency or establish that a released binding contains the fix.
What changes are included in this PR?
Run each migration runner case through a supervisor that captures sessions, locks, transactions, and startup jobs after 90 seconds and retains the 180-second test deadline. The diagnostic connection uses the existing Unix socket without opening another native lifecycle handle.
Keep the text log tails and upload
seekdb-native.tar.gzwith complete available native log files, including timestamped rotations, from disposable migration test instances. Database data files are excluded; log files already removed by native rotation or fixture cleanup cannot be recovered.Upload the live diagnostic snapshot alongside the existing Python and SQL logs. GitHub artifact retention settings are unchanged.
Run the baseline-adoption recovery case three times in each Python 3.11/3.14 job. These are required independent runs, not retries; a failed run stops the job.
Add a separate Ubuntu/Python 3.11 observation workflow pinned to the documented reproduction snapshot
0b4dd71c. It collects snapshots every 45 seconds and allows up to 1200 seconds per attempt to distinguish recovery from SQL timeout. Ordinary migration CI retains its 180-second deadline.Are there any user-facing changes?
No runtime API, persisted schema, or business database changes. CI artifacts contain more diagnostic history and may be larger. The additional runs add CI time.
How was this change tested?
4ae1371c:UV_NO_SYNC=1 UV_OFFLINE=1 PREK_NO_CONCURRENCY=1 make checkpassed, including lock consistency, 110 workflow action references, all pre-commit checks, type checks, and 49 integration-manifest tests.pylibseekdb==1.4.0.post1.typassed for the new script; the workflow shell passedbash -n;git diff --checkpassed.AI usage statement
Implemented and validated with OpenAI Codex.