Skip to content

[Bug] Chaos (2865ed6): TPCC New-Order 1062 Duplicate entry on bmsql_oorder after DN network chaos + 20638 unknown commit #25704

Closed

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):

  1. Symptom: New-Order INSERT into bmsql_oorder fails with 1062 on (10,8,48585).
  2. 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 for o_id=48585 has 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.
  3. 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-read d_next_o_id / skip re-INSERT of same oid”, so a retry can reuse the just-committed o_id.
      Concurrent same-o_id allocation (lost/skipped lock on d_next_o_id under chaos) is a secondary hypothesis; less favored because the 1062 is tightly co-timed with the 20638 cluster, but should be ruled out with MO traces for that txn id window.

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

  1. Correctness of client-visible commit: 20638 without a safe resolve API pushes TPCC/drivers into unsafe retry, surface as 1062 on key-generating DML.
  2. Chaos realism: DN network loss is expected in product; New-Order must remain idempotent or safely retriable.
  3. Early warning: Same 1062 class appeared once on sibling chaos env 33bc7a2 (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)

Activity

  1. ghost added this to the MO-202607 milestone on Jul 14, 2026
  2. ghost added
    kind/bug
    on Jul 14, 2026
  3. ghost added theissue type on Jul 14, 2026
  4. ghost added
    severity/s0
    on Jul 14, 2026
  5. added
    ai-heavy
    on Jul 15, 2026
  6. added a commit that references this issue on Jul 15, 2026
    30df79c
  7. LeftHandCold commented on Jul 16, 2026

    @LeftHandCold
    Collaborator

    fixed

  8. LeftHandCold commented on Jul 31, 2026

    @LeftHandCold
    Collaborator

    fixed

  9. ghost closed this as completedon Aug 5, 2026
  10. added 3 commits that reference this issue on Sep 17, 2026
    e1d28dc
    e6870f0
    a3975f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-heavykind/bugseverity/s0

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions