bug: test_real_mysql_recovery_upgrade_preserves_receipt_and_resumes_registered_ddl_prefix intermittently hangs on embedded seekdb in code-seekdb (3.11) #2221
Description
Describe the bug
test_real_mysql_recovery_upgrade_preserves_receipt_and_resumes_registered_ddl_prefix sometimes hangs on embedded seekdb in code-seekdb (3.11). The step "Test unified migrations with embedded seekdb" then hits its 10-minute limit and the job fails. On a passing job the two seekdb cases take 17 s and 28 s.
It happened twice on #2206, which changes only atomic_memory_processing.py, tests and docs, none of which are on this path:
| Run | Date | Case | code-seekdb (3.14) |
Rerun |
|---|---|---|---|---|
| job 120270681845 | 2026-10-23 | [True-seekdb] |
passed | attempt 2 passed |
| job 120784102219 | 2026-10-24 | [False-seekdb] |
passed | not rerun |
For scale: the latest attempts of the 57 Main runs since 2026-10-23 02:46 UTC that reached code-seekdb (3.11) passed 46 times, were cancelled 7 times and failed 4 times. One of those failures is the 2026-10-24 run above. The other three are on two other branches; the one I checked timed out in a different test. First attempts that were rerun to success, like the 2026-10-23 run, do not appear in these counts.
Steps to reproduce
- Run the
Mainworkflow on a commit based on 464cd15, for example perf(atomic-memory): skip reconciliation when a candidate has nothing to compare #2206. - In
code-seekdb (3.11), the step "Test unified migrations with embedded seekdb" runstests/e2e/test_topic_memory_recovery_migration.py -k seekdbwithfaulthandler_timeout=120. - Intermittently, one of the two seekdb cases does not finish.
I have not reproduced this locally.
Expected behavior
The migration finishes in seconds, as in the passing runs. If a statement can block, the test or the maintenance connection fails within a bounded time instead of holding the step until the job timeout.
Actual behavior
faulthandler dumps the same stacks after 120 s in both runs (2026-10-24 shown, frames at 464cd15):
- The test's event loop waits in
asyncio.run(scenario()). - A worker thread is in
runner.apply(...)→TopicMemoryRecoveryMigrationRunner.apply→_run→MaintenanceConnections.run, which isasyncio.run(self._seekdb(...)). That event loop is idle inselectors.select.
So an await inside the seekdb maintenance operation never completes; the Python dump cannot show which one. In the [False-seekdb] case this is the only apply call, made after the test has closed its own profile for the seeded data.
tests/e2e/test_topic_memory_recovery_migration.py::test_real_mysql_recovery_upgrade_preserves_receipt_and_resumes_registered_ddl_prefix[False-seekdb] Timeout (0:02:00)!
Thread 0x00007f4a717ff6c0 (most recent call first):
File ".../asyncio/runners.py", line 190 in run
File ".../src/powercontext/builtin/persistence/migrations/connections.py", line 115 in run
File ".../src/powercontext/builtin/persistence/migrations/topic_memory_recovery.py", line 292 in _run
File ".../src/powercontext/builtin/persistence/migrations/topic_memory_recovery.py", line 516 in apply
File ".../tests/e2e/test_topic_memory_recovery_migration.py", line 534 in apply_skipping_backup
Thread 0x00007f4a8b9abb80 (most recent call first):
File ".../asyncio/runners.py", line 190 in run
File ".../tests/e2e/test_topic_memory_recovery_migration.py", line 581 in test_real_mysql_recovery_upgrade_preserves_receipt_and_resumes_registered_ddl_prefix
...
##[error]The action 'Test unified migrations with embedded seekdb' has timed out after 10 minutes.
Both runs uploaded seekdb-migrations-3.11 (7.6 MB and 11.6 MB) with the native seekdb logs that the step collects. I have not inspected them; they may show which statement or lock was waiting.
Environment
- CI:
ubuntu-latest, Python 3.11.17,uv run --locked --extra seekdb. - Commit: PR perf(atomic-memory): skip reconciliation when a candidate has nothing to compare #2206 on 464cd15; the test came from fix(topic-memory): add durable block inspection and recovery #1966.
- Python 3.14 passed the same step in both runs.
Are you willing to submit a PR to fix this bug?
- Yes, I am willing to submit a PR!
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
Fengzdadi commentedon Oct 25, 2026
The hang is still recurring, and not only on Python 3.11. Since this issue was opened, five jobs in four more
Mainruns have stopped at the same stack (TopicMemoryRecoveryMigrationRunner.apply→MaintenanceConnections.run, with the event loop idle inselectors.select):s3code-seekdb (3.14)[True-seekdb]perf/incubation-experience-snapshotcode-seekdb (3.14)[True-seekdb]perf/handoff-report-batch-headscode-seekdb (3.11)[False-seekdb]perf/handoff-report-batch-headscode-seekdb (3.14)[False-seekdb]codex/batch-archive-compatibility-2169code-seekdb (3.14)[True-seekdb]Native log from the 2026-10-25
[False-seekdb]failure on 3.11I went through
seekdb-native.tar.gzin theseekdb-migrations-3.11artifact of run 40167105349. It covers four opens of the same data directory, at 06:21:09, 06:21:11, 06:21:14 and 06:21:17 UTC.T1_MaintainDepIacquires theRUNTIME:1X lock (IN_TRANS_COMMON_LOCK) in transaction1000004and registers it as a multi-data-source (MDS) operation. The transaction starts to commit (TX_END), but neitherON_REDOnorON_COMMITis logged in this instance.no clients remaining, exiting.1000004from redo (REGISTER_SUCC,ON_REDO), and it never reachesON_COMMITor an abort. Of the 46 MDS transactions in the fourth instance, it is the only one left undecided. All the others commit, including1000002, which the same thread opened on the same lock about 40 ms earlier.ALTER TABLE pc_topic_memory_work_budgetsstatements (tablet 200001) acquire their table locks, and those lock transactions commit. The DDL task created at 06:21:19.085 then entersddl wait trans end(need_wait_trans_end:true) and retries 30,590 times until the log ends at 06:30:45.Why a replayed transaction can block the wait
Every source line this log cites that I checked, in the DDL, tablet and transaction modules, matches the seekdb v1.4.0 source. The following is based on that source:
ObLSTxCtxMgr::check_modify_schema_elapsedvisits the transaction contexts on the log stream, regardless of which tablet the DDL targets, and stops at the first context that fails the check.is_for_replay()and not exiting,ObTxCtx::check_modify_schema_elapsedreturnsOB_STATE_NOT_MATCH.OB_STATE_NOT_MATCHis in the DDL retry white list (is_not_master), sotry_waitkeeps returningret=0with the transaction not yet ended, and the task retries indefinitely.The log is consistent with this path.
ObTablet::check_schema_version_elapsedlogs at INFO when the transaction check returnsOB_EAGAIN(check schema version elapsed again) and when it succeeds (check wait trans end). Neither message appears in 30,590 checks. In every check, then, some context failed with an error other thanOB_EAGAINbefore any context returnedOB_EAGAIN. That error is logged only at WARN, and this log contains no WARN lines. A live transaction holding an older lock on the table therefore cannot be the only thing blocking the wait, but the log does not record which context did. The transaction context count, which the log reports periodically, stays at one or more for the whole wait. That fits one context that never ends, but the log does not identify it.1000004is a recovered, undecided transaction of the kind this path rejects. The log does not show the outcome of replayed non-MDS transactions, so1000004may not be the only such context.#1920 diagnosed this mechanism. Replay reconstructs an undecided transaction from a closed instance, and nothing ever completes it. There, the visible symptom was
CREATE TABLE pc_schema_revisionwaiting on theRUNTIME:1lock. Here, it is a DDL task waiting for transactions to end. I have not inspected the native logs of the 3.14 failures.Fix
oceanbase/seekdb#1499 targets this case. It takes over recovered transactions before admitting new ones and aborts undecided MDS table-lock transactions. However, its description notes that its regressions do not include an MDS table-lock recovery case, which is the kind of transaction found here. So this needs to be validated against a build that contains it.
PowerContext does not appear to need a code change. The fix is to move to a
pylibseekdbrelease that contains seekdb#1499, updateuv.lock, and check repeated runs on Python 3.11 and 3.14, as planned in #1945. seekdb#1499 merged on 2026-10-15. The latestpylibseekdbon PyPI is still 1.4.0.post1, from 2026-09-14, and the latest seekdb GitHub release is v1.4.0.@wangyunlai-seekdb, is a
pylibseekdbrelease that includes seekdb#1499 planned, and roughly when? A pre-release wheel would also let us check this case and #1920 before the final release.cc @Zxf-xufeng, since #1945 tracks the dependency upgrade.
PsiACE commentedon Nov 2, 2026
Resolved by the patched SeekDB dependency in #1945 and the native restart and migration-recovery regressions in #2328.