Repository navigation
Description
- I have checked the existing issues.
Correction, 2026-10-05: the original body incorrectly treated
Creating a secondary indexas a success receipt. It is a pre-execution message. Both the client and CN logs showCREATE INDEX k_1 ON sbtest1(k)failed. The access-path change is explained by failed fixture preparation, not a proven optimizer/Prepared regression. The index-build RPC timeout remains a real availability failure requiring separate attribution.
Branch Name
4.2-dev. Main is a control, not a confirmed affected branch or a confirmed fix for this incident.
Commit ID
- Slow 4.2 run:
6dc70318bb26ae43f8969cc565886b40d532e590. - Previous, fast 4.2 run:
0de7c54a043a93ef5ff3d5fdba30a5640dda8100. - Contemporaneous main control:
21f711a7b852238394417e547282e14dce8660d9. - Latest main inspected:
37ba0712974d4a1ebe3fe8cd8e6a4daba7400f5e.
Other Environment Information
- TKE Family Daily, one TP CN and two AP CNs; this Sysbench workload is routed to TP.
- TP CN: 14 CPU, 55Gi container memory, 16Gi FileService Memory Cache.
- Slow namespace:
mo-42-family-37215504171-1; TP pod:nightly-regression-dis-tp-cn-tkbkn. - Previous namespace:
mo-42-family-37136478265-1; TP pod:nightly-regression-dis-tp-cn-422x6. - Same mo-sysbench revision:
1a7886fc7566dfc9fd85a81801f09471151365d3. - Ten tables of 10,000,000 rows each;
secondary=on,auto_inc=off,create_secondary=on. select_random_points.lua, 1,000 threads, configured duration 300s. This Lua case queries sbtest1 only, despite preparing ten tables.- Binary prepared SQL, ten integer parameters:
SELECT id,k,c,pad FROM sbtest1 WHERE k IN (?,?,?,?,?,?,?,?,?,?);Actual Behavior
The No-PK random-points query phase suffered an approximately 400x throughput collapse, with no query errors. However, its preparation had already failed to build the required k_1 index. The harness accepted the incomplete fixture and continued benchmarking a base-table scan.
| Run | Case UTC window | TPS | Queries | Average latency | Errors |
|---|---|---|---|---|---|
| Previous 37136478265 / 111274199705 | Oct 3, 20:17:29-20:22:31 | 3373.75 | 1,014,596 | 295.82ms | 0 |
| Slow 37215504171 / 111509552680 | Oct 4, 20:09:52-20:16:40 | 8.42 | 3,425 | 104,655.85ms | 0 |
Slow-run Sysbench total time is 406.846s, maximum latency 128,887.63ms. Outstanding requests extend completion beyond the configured 300s measurement duration.
1. Required index creation failed, but preparation was accepted
Exact raw log from the slow job, UTC on Oct 4:
20:04:12.408 Creating a secondary index on 'sbtest1'...
20:04:24.214 FATAL: mysql_drv_query() returned error 20101
context deadline exceeded
internal error: getLockTableBind
for query 'CREATE INDEX k_1 ON sbtest1(k)'
20:04:47.879 PREPARE PASS
20:04:48.418 no-primary-key rows=100000000 invalid_ddl=0
20:09:52 random-points query phase begins
The same prepare phase failed CREATE INDEX for k_1, k_5, k_9, k_10, k_7 and k_4. The previous run's prepare log has no corresponding FATAL errors. The slow run's handoff records case_exit_code=0, cleanup_result=retained, handoff_safe=true despite those failures.
Independent TP CN evidence at 20:04:24.211986 UTC:
caller: compile/sql_executor.go:181
msg: internal sql executor error
sql: insert into `tke_family_weekly_sysbench`.`__mo_index_secondary_01a10884-5593-70d7-8638-40946dd676ce`
select serial_full(`k`,`__mo_fake_pk_col`), `__mo_fake_pk_col`
from `tke_family_weekly_sysbench`.`sbtest1`;
error: context deadline exceeded / getLockTableBind
txn: c5804585c1bab7c618db6075c3aee3d2
At 20:04:24.212234 the frontend records CREATE INDEX k_1 ON sbtest1(k) with status=fail, same transaction, statement ID 01a10884-5592-7b69-bb4b-40e70a0acc98.
At the running revision, doCreateIndex propagates this backfill error before UpdateConstraint and index-catalog publication. An unsuccessful build is not a usable index. The following benchmark steps do not retry/build it.
The exact nightly prepare script does not inspect prepare output for FATAL errors. Its no-PK contract checks row counts/id range and absence of a declared primary key, but does not check the required k indexes. The query-phase runner does check FATAL errors; that does not repair the preparation gap.
The preceding id point-select remains at 9406.85 -> 8907.99 TPS. This is not evidence that k_1 exists: the xid(id) index is established in CREATE TABLE, whereas k_1(k) is a later, failed DDL. The following auto-increment case creates a separate fixture and remains at 8586.05 -> 8012.74 TPS.
2. Slow requests repeatedly select 1,222 base-table blocks
Example from the TP CN at Oct 4, 20:10:12.207611 UTC:
caller: disttae/txn_table.go:1058
msg: txn.table.ranges.log
name: sbtest1
tbl-id: 273405
exprs: in(Expr_Col(sbtest1.k.1), Expr_Fold(id=1))
blocks: 1222
cost: 841.191us
The same base-table/1,222-block shape occurs across many transactions, including late in the case. The sub-millisecond ranges cost is not the overall query cost. blocks records selected ranges, not a separately measured count of physical disk reads.
The recorded storage predicate is plain IN on k, not a visible CAST(k) expression. Do not automatically import the column-cast/random-range diagnosis from #29606.
3. CPU profiles independently show index access versus scan/materialization
Both windows are two minutes inside the respective random-points case. Percentages are cumulative and nested; do not add them.
| Symbol | Previous 4.2, 20:19-20:21 UTC | Slow 4.2, 20:12-20:14 UTC |
|---|---|---|
indexjoin.(*IndexJoin).Call |
66.71% | No sampled frame |
blockio.materializeBlockData |
5.92% | 71.04% |
objectio.CopyCachedVectorAll |
0.003% | 43.71% |
table_scan.(*TableScan).evalFilter |
2.21% | 21.86% |
opOperatorFixedIn.operatorIn |
0.17% | 18.79% |
These profiles and ranges are the expected downstream consequence of the missing usable k index. They do not require an NDV/Outcnt regression to explain the incident. No exact historical COM_STMT_EXECUTE plan was retained; index-build failure, publication order, absence of a workflow retry, and sustained base-scan evidence establish the access-path explanation.
4. Same-data counterfactual on an isolated instance
On Oct 5, a run-owned container on server 50 used the exact slow image commit-6dc70318bb26ae43f8969cc565886b40d532e590, a single 10M-row no-PK table, and a real binary Prepared query with ten integer bindings 4000000..4000009. No kernel, optimizer statistics, or base rows were changed in this test.
| Change to the same fixture | Median of five executions | Result |
|---|---|---|
| k_1 absent | 3.626240s | 8 rows |
| create k_1 successfully | 0.001337s | same 8 rows |
| drop k_1 again, after warmup | 3.482405s | same 8 rows |
All 15 executions have the same complete-row multiset SHA-256: 7c70c4bc1b7a179ddc6a6e36278783351b0b6e69466631551c60a6e119867175. The literal plan control changes from plain base Table Scan to Join Type: INDEX plus Index Table Scan on sbtest1.k_1, then back. The timed queries use binary Prepared execution, not that literal EXPLAIN.
This is a counterfactual for the access-path consequence, not a reproduction of the distributed GetBind timeout or the exact 1,000-thread TKE throughput. The isolated instance has 4 CPU/12Gi and different cache/physical data; preparation used locally installed Sysbench 1.0.20 rather than TKE's 1.1.0-de18a03. Absolute TPS from these environments is not comparable. Separate synthetic statistics-patch experiments are not incident attribution evidence.
Expected Behavior
The prepare phase must not announce success or release a fixture to an index-performance test after required index creation fails. Preserve the server's DDL error and validate the required index metadata before publishing an indexed-performance result.
The MO-side failure to investigate is the GetBind RPC timeout during secondary-index backfill. This issue does not assert that failing a DDL incorrectly removes a previously committed index, that the query optimizer ignored a healthy index, that results were wrong, or that a specific new PR introduced the timeout.
Steps to Reproduce
Historical distributed timeout conditions, not a deterministic timeout reproducer:
- Use the special Sysbench Family case from the linked run and the frozen tool revision above.
- Prepare 10 x 10M rows with no declared primary key, an
idsecondary index, and attempt to create eachksecondary index (secondary=on auto_inc=off create_secondary=on). - Keep the original sequence: No-PK point-select followed by
select_random_points.lua, 1,000 threads, 300s. - Preserve each CREATE INDEX terminal status, index metadata, CN/TN GetBind request/response timing, RPC queues, profiles, and the prepare handoff before cleanup.
- For the deterministic access-path control only: on a run-owned isolated table, compare missing k_1 -> successful CREATE INDEX k_1 -> missing k_1 again with fixed binary bindings. Do not inject missing indexes into a shared/production fixture.
The nightly prepare uses randomly generated data and fresh physical objects. The two historical runs are not a same-data binary A/B.
Additional information
Timeout boundary and remaining unknowns
getLockTableBindWithContext creates a GetBind request with the existing 10s RPC budget and propagates transport/future failure. This is not a 300s query timeout or a captured row-lock deadlock.
TN was running, continued processing commits, and recorded new lock-table binds during the failing interval. Around the failures TN used about 3.6-3.7 CPU cores; TP used about 10.2 of its 14 cores. Go GC maximum-pause samples were below 0.1s on TP and approximately 0.18s on TN, not a captured 10s stop-the-world pause. No OOM/restart was observed. These facts do not distinguish response delivery, RPC scheduling, host pressure or a deeper LockService defect.
The exact reason the GetBind futures expired is still unproven. Do not replace that unknown with a generic network claim, nor assume TN was completely stuck because the client timed out.
Only #29504 (backup) and #29605 (SQL source provenance) lie between the two 4.2 images. The optimizer, readutil and materialization paths above did not change in that interval. This does not prove neither PR can matter indirectly, but it is insufficient to name either as the introducing commit.
Main status and related issues
- The contemporaneous main special case produced about 2087 TPS, not 8 TPS. Its 20:39-20:41 UTC TP profile contains
IndexJoin.Callat 48.69%,materializeBlockDataat 5.20%, and no sampledCopyCachedVectorAllframe. Main run. - Main's normal result is not proof that GetBind timeouts have been fixed there. Its fixture successfully used k-index access; that is not the same precondition as the failed 4.2 preparation.
- [Bug]: Sysbench 1000W No-PK random-point TPS drops 60% after #28955 #29322 tracks a different, approximately 60% Main No-PK random-point degradation; Fix primary-key runtime filter for index join backfill #29466 is explicitly a partial index-backfill/prepared-IN repair. No evidence yet identifies this 4.2 base-scan collapse as that same defect or proves it cured by Fix primary-key runtime filter for index join backfill #29466.
- [Bug]: Prepared random_ranges regression disables pruning and loses index access with BIGINT bindings #29606 and merged fix(plan): preserve guarded prepared integer range access #29612 concern Prepared
random_ranges, typed range admission and pruning. This report is ten-valueIN; no identical triggering plan has been demonstrated. - [Bug]: nopk point randoms perf decreased significantly when running in the daily regression compared to running alone #20992 is now a relevant missing-index/setup precedent. The previous exclusion based on
Creating a secondary indexwas incorrect. This report retains the exact GetBind failure and false-success handoff so owners can decide whether to consolidate the harness aspect. - perf: sysbench random_points 1000线程 TPS 暴跌 75%,二分定位到 #27493 (fix: preserve binary prepared DML and aggregate types) #27838 concerned an older Prepared specialization/startup regression. This run's sustained base-scan/materialization evidence is different.
Classification: proven preparation/evidence defect and explained missing-index scan consequence; real index-build availability failure with an unproven deeper RPC cause. The historical 3374 -> 8 TPS observation is not a valid same-schema performance regression A/B. No introducing commit has been pinned; do not revert #29605 on this evidence.
Activity
[-][Bug]: 4.2 No-PK prepared random-points falls from 3374 to 8 TPS with base-table scan/materialization[/-][+][Bug]: Secondary-index GetBind timeouts leave No-PK Sysbench fixture incomplete and cause base scans[/+]LeftHandCold commentedon Oct 5, 2026
Root-cause update and correction
I need to correct a material error in the initial report:
Creating a secondary indexis printed before running CREATE INDEX; it is not a successful-build receipt. The original exclusion of missing-index setup was wrong. The issue body and title have been updated to preserve that correction explicitly.The slow run's raw prepare log records:
All six failed index builds are k_1, k_5, k_9, k_10, k_7, k_4. The original job and retained
prepare-on-off-on.logcontain these errors; they are not inferred from CPU profiles.CN independently records the failed k_1 index-backfill INSERT, failed CREATE INDEX terminal status, and rollback of transaction
c5804585c1bab7c618db6075c3aee3d2. At the running commit, backfill failure returns before publishing the index constraint/catalog. The subsequent benchmark steps do not rebuild it. The prepare oracle checks rows/id bounds/no primary key, but not the required k index.That closes the performance chain:
GetBind timeout during index build -> no usable k_1 -> false prepare success -> random-points base scan -> repeated 1,222-block materialization/IN filtering under 1,000 concurrency.
The healthy id point-select does not contradict this: it uses xid(id), created with the base table, not the later k_1(k).
Real same-data counterfactual
On a run-owned, isolated server-50 container using the exact slow MO image, I kept the same 10M base rows and binary Prepared bindings
4000000..4000009. No optimizer statistics or MO code were changed:Every execution returns the same 8 complete rows with the same row-multiset SHA-256. The independent literal EXPLAIN control changes Table Scan -> INDEX Join -> Table Scan. The timing is for real binary Prepared execution, not EXPLAIN.
This validates the missing-index scan consequence; it is not a reproduction of the original distributed GetBind timeout or exact TKE TPS. The isolated CPU/memory/cache, physical data and preparation Sysbench version differ. Earlier synthetic NDV-patch experiments do not identify this incident's cause.
Attribution boundary
The first low-risk harness improvement is to fail prepare on its worker errors and validate required indexes before running/publishing the indexed benchmark. Kernel changes should wait for request/response/queue evidence identifying the actual GetBind failure owner.
LeftHandCold commentedon Oct 5, 2026
Follow-up: harness fix validated; allocator timeout remains under investigation
The false-success harness defect has been fixed in mo-nightly-regression#1758, primary fix
d3719b76, latest head1390f0b8(one-line update to an existing SQL test double):k_N(k)indexes before announcingPREPARE PASSwhen secondary-index preparation is requested.Validation on server 50:
OKfor the new index query; the latest head supplies its expected index count. The real admission check was not relaxed.6dc70318bb26ae43f8969cc565886b40d532e590, isolated 4 CPU/12Gi instance: the actual helper prepared ten 100,000-row tables and verified ten real k indexes. Dropping onlyk_6then invoking random-points failed attable=sbtest6 index=k_6 expected=1 actual=0, made no benchmark invocation, and removed the owned test database. The endpoint adapter changed only the isolated port, not SQL/results.Additional MO-side evidence
The same TP CN also logged
doKeepLockTableBinddeadline failures at 20:04:19.845, 20:04:25.778, 20:04:31.794 and 20:04:37.729 UTC on Oct 4. Exact-version code sends both GetBind and KeepLockTableBind through the ordinary allocatorlock-clientpath; do not confuse binding renewal with the separate KeepRemoteLock transport. This is not just a large backfill query exceeding its SQL time budget.TN continued processing commits and creating binds during the failure window, and aggregate lock RPC counters continued advancing. Sampled ordinary TP lock-client active requests reached 5 at 20:04:30/45 and returned to zero by 20:05:00; its connect/close counters each increased once. Sampled sending queues did not show sustained backlog. These observations narrow the investigation but do not identify the stalled request/connection.
Important evidence limit: the server
mo_rpc_message_total{type="send"}counter increments before socket write. Matched aggregate send/receive counts cannot prove delivery of a particular GetBind response. The original INFO logs do not give a common request ID and terminal response write/receive for the failed index. A TN bind at 20:04:14.204437 and the first confirmed backfill failure at 20:04:24.211986 are approximately ten seconds apart, but there is no direct table-ID/request-ID link proving they are the same RPC.Proven: GetBind timeout -> failed index DDL -> incomplete fixture incorrectly admitted by the old harness -> base-table scan / very low random-points throughput. The harness admission defect is independently reproduced and fixed.
Still unproven: why those allocator futures expired, whether that deeper failure is a MO transport/scheduling defect or an external connectivity interruption, and which commit introduced it. The successful small-instance preparation is not a distributed timeout reproduction. This PR does not claim to fix the allocator failure or establish a #29605 performance regression; keep the MO-side investigation open.