Repository navigation
Labels
ai-heavyAI打辅助,核心逻辑靠人kind/bugSomething isn't workingseverity/s0Active / top priority for current sprint. Owner has committed to working on it now.
Milestone
Description
Environment
| Field | Value |
|---|---|
| Cluster | mo-chaos-main-2865ed6-202607131059 |
| Namespace | mo-chaos-main-2865ed6-202607131059 |
| MO version | commit-2865ed6 |
| Endpoint | 10.222.6.252:6001 |
| Artifact root | /data1/chaos-test/29220545028_2865ed6 |
| Workloads | TPCC (jTPCC), mo-load, vector/fulltext, chaos-mesh |
| Analysis point | 2026-07-14 07:52:34 CST (single event in ~25h soak) |
Scope: One TPCC New-Order hit MySQL Error 1062 Duplicate entry on primary key (o_w_id, o_d_id, o_id) of bmsql_oorder, in the same second as a burst of 20638 txn commit status is unknown, 2 seconds after chaos task_network_dn cleanup.
Out of scope / not claimed: TPCC durable consistency corruption. Periodic runVerify.sh reported 0× Consistency verification failed across the full soak (1738+ successes). This issue is about PK collision / uncertain-commit retry semantics under DN network fault, not ytd/district drift like 07924fb / 18addf5.
Summary
During chaos long-run on commit-2865ed6, TPCC logged exactly one 1062 in ~25 hours:
2026-07-14 07:52:34 FATAL jTPCCTerminal:327 - [UNEXPECTED][TT_NEW_ORDER][EXECUTION]
ErrorCode : 1062,
ErrorMessage : Duplicate entry '(10,8,48585)' for key '(o_w_id,o_d_id,o_id)'
| Signal | Value | Interpretation |
|---|---|---|
1062 count (whole soak) |
1 | Rare, not a storm |
Same-second 20638 |
3 (2× New-Order + 1× Payment) | Commit path disrupted; client saw unknown outcome |
| Chaos task | task_network_dn applied 07:51:31, deleted 07:52:32 |
1062 at 07:52:34 = +2s after DN bandwidth chaos end |
| Prior chaos | task_kill_cn 07:46:00–07:46:31 |
CN churn minutes earlier |
| TPCC consistency fail | 0 | No durable corruption gate failure |
| Verify after window | still successfully (e.g. 08:05:25) |
Data self-checks continue to pass |
Preferred root-cause chain (symptom → mechanism → root):
- Symptom: New-Order INSERT into
bmsql_oorderfails with 1062 on(10,8,48585). - Mechanism: Under DN network bandwidth chaos, in-flight TPCC commits lose reliable ack → client observes
20638 txn commit status is unknown. The first New-Order foro_id=48585has very likely already committed on the server (row exists). A subsequent New-Order attempt (same terminal retry and/or racing worker) tries to INSERT the same(w_id,d_id,o_id)→ 1062. - Root cause (fixable): Combination of
- MO: commit outcome becomes ambiguous under DN RPC/network loss (
20638) without a client-visible way to resolve “committed vs aborted” before retry; and/or - Client (jTPCC): after
20638, New-Order path does not treat uncertain commit as “must re-readd_next_o_id/ skip re-INSERT of same oid”, so a retry can reuse the just-committedo_id.
Concurrent same-o_idallocation (lost/skipped lock ond_next_o_idunder chaos) is a secondary hypothesis; less favored because the 1062 is tightly co-timed with the20638cluster, but should be ruled out with MO traces for that txn id window.
- MO: commit outcome becomes ambiguous under DN RPC/network loss (
Metric / log semantics
| Signal | Meaning |
|---|---|
1062 on bmsql_oorder |
INSERT hit existing PK — that New-Order txn failed; does not by itself mean consistency verify failed |
| 20638 unknown commit | Client cannot tell if server committed; blind retry is unsafe for PK-generating txns |
Consistency verification successfully |
Cross-table invariants (warehouse/district ytd, order vs order_line counts, …) still hold — orthogonal to a single failed New-Order |
Timeline (CST)
| Time | Event | Evidence |
|---|---|---|
| 07:45:10 / 07:45:52 | TPCC verify successfully | check.log |
| 07:46:00–07:46:31 | task_kill_cn |
mo_chaos_test.log |
| 07:51:31 | task_network_dn apply (bandwidth-dn) |
mo_chaos_test.log |
| 07:52:32 | task_network_dn delete / completed |
mo_chaos_test.log |
| 07:52:34 | 20638 ×3 then 1062 on (10,8,48585) |
tpcc.log L76146–76152 |
| 08:05:25+ | TPCC verify successfully again | check.log |
Evidence
Log path
| File | Path |
|---|---|
| TPCC run log (1062) | /data1/chaos-test/29220545028_2865ed6/mo-chaos/test-tool/mo-tpcc/tpcc.log |
| Chaos harness | /data1/chaos-test/29220545028_2865ed6/mo-chaos/logs/mo_chaos_test.log |
| TPCC verify | /data1/chaos-test/29220545028_2865ed6/mo-chaos/test-tool/mo-tpcc/check.log |
| JDBC props | .../mo-tpcc/props_10.mo (autoReconnect=true, maxReconnects=200) |
Same-second FATAL burst (tpcc.log)
2026-07-14 07:52:34 FATAL ... [TT_NEW_ORDER] ErrorCode : 20638, txn commit status is unknown: cd1c5f3286701baf18c1faa400ee8c38
2026-07-14 07:52:34 FATAL ... [TT_PAYMENT] ErrorCode : 20638, txn commit status is unknown: cd1c5f3286701baf18c1faa400ee8c52
2026-07-14 07:52:34 FATAL ... [TT_NEW_ORDER] ErrorCode : 20638, txn commit status is unknown: cd1c5f3286701baf18c1faa400ee8c24
2026-07-14 07:52:34 FATAL ... [TT_NEW_ORDER] ErrorCode : 1062, Duplicate entry '(10,8,48585)' for key '(o_w_id,o_d_id,o_id)'
Chaos alignment (mo_chaos_test.log)
2026-07-14 07:51:31 ... Success: networkchaos.../bandwidth-dn created
2026-07-14 07:52:32 ... Cleanup Success: networkchaos... "bandwidth-dn" deleted
2026-07-14 07:52:32 ... Task 'task_network_dn' completed
Consistency gate (not failed)
# check.log — full soak
Consistency verification successfully : 1738+
Consistency verification failed : 0
Why this is still worth an issue
- Correctness of client-visible commit:
20638without a safe resolve API pushes TPCC/drivers into unsafe retry, surface as1062on key-generating DML. - Chaos realism: DN network loss is expected in product; New-Order must remain idempotent or safely retriable.
- Early warning: Same
1062class appeared once on sibling chaos env33bc7a2(ol_*key). Frequency is low, but pattern repeats under chaos.
Proposed fixes
A. MO server (preferred for 20638)
| Area | Change |
|---|---|
| Txn / frontend | On RPC/network loss during commit, ensure client can distinguish committed vs aborted (query txn status by id / commit token), or make commit idempotent so retry of same payload does not double-apply |
| DN / RPC | Harden commit path under transient DN bandwidth loss so “unknown” is rarer |
| Observability | Emit structured log linking txn-id from 20638 to CN/DN commit result for postmortem |
B. Client / TPCC harness (must-have under chaos)
| Area | Change |
|---|---|
| jTPCC New-Order | On 20638: do not re-INSERT with the same (w,d,o_id); either (1) look up whether (w,d,o_id) already exists and treat as success, or (2) abort to a clean New-Order that re-reads d_next_o_id under a new txn |
| Classification | Treat 1062 after recent 20638 as retry hazard, not data corruption, unless consistency verify fails |
| JDBC | Revisit autoReconnect=true — reconnect mid-uncertain-commit can amplify wrong retry |
C. Verification
| Check | Expectation |
|---|---|
Repro: task_network_dn + TPCC New-Order soak |
20638 may appear; 1062 rate → 0 after client fix; or MO provides resolve so retry is safe |
| Soft gate | Any 1062 on bmsql_oorder / bmsql_order_line during chaos → attach txn id + chaos task; if consistency still green, track as retry bug, not release blocker |
| Hard gate | Still Consistency verification failed > 0 for durable corruption (separate issues) |
Metadata
Metadata
Assignees
Labels
ai-heavyAI打辅助,核心逻辑靠人kind/bugSomething isn't workingseverity/s0Active / top priority for current sprint. Owner has committed to working on it now.
Activity
fix(lockservice): fence unlock after unknown commit result (#25722)
LeftHandCold commentedon Jul 16, 2026
fixed
LeftHandCold commentedon Jul 31, 2026
fixed
fix(lockservice): fence unlock after unknown commit result (matrixori…
fix(lockservice): fence unlock after unknown commit result (matrixori…
fix(lockservice): fence unlock after unknown commit result (matrixori…