Skip to content

[Bug] Chaos (90e3400): TPCC New-Order 20618 r-w conflict storm (~10.5k / ~43min) right after task_kill_cn #26210

Closed

Description

Environment

Field Value
Cluster mo-chaos-main-90e3400-202607231124
Namespace mo-chaos-main-90e3400-202607231124
Image (at analysis) matrixone:commit-f3752fce3 (LogService memory 3Gi)
Endpoint 10.222.6.252:6001
Artifact root /data1/chaos-test/29976855281_90e3400
Workloads TPCC (jTPCC), mo-load, vector/fulltext, chaos-mesh
Analysis window 2026-07-24 18:00 → 2026-07-27 ~11:50 CST
Incident 2026-07-26 01:32:55 → 02:15:13 CST (ErrorCode : 20618)

Scope: After task_kill_cn, TPCC New-Order hit a sustained storm of Error 20618 / r-w conflict (~10531 client FATAL lines over ~43 minutes). Co-timed 9999 Stock … not found (~2575 in the same hour). TPCC consistency verify stayed green through the storm (0 fail); live ytd drift = 0.

Out of scope / not claimed:

  • Durable TPCC consistency corruption (verify 5969 successfully / 0 failed in the analysis window; ytd OK).
  • Log OOM (limit 3Gi; WS peak ~2.5Gi; OOM events 0).
  • Episodic 1205 lock wait peaks (same soak, separate bursts — track separately if needed).
  • Single 1062 on bmsql_order_line at 2026-07-25 05:53 after kill_dn+kill_cn (1 row in DB; not durable duplicate) — related chaos family, not this storm.

Summary

Signal Value Interpretation
20618 (r-w conflict) in window 10531 Dominant error in soak
Storm span 2026-07-26 01:32:55 → 02:15:13 CST ~43 min then stops
Txn type 100% TT_NEW_ORDER Not Payment/Delivery
Trigger task_kill_cn apply 01:32:04, cleanup 01:32:35 First 20618 ~20s after kill
Co-timed 9999 Stock not found ~2575 in 01–02 hour Read visibility / miss under conflict
Consistency fail during storm 0 No durable gate failure
wait-active max (72h) 33 (transient) Not a sustained createTxn stall

Preferred root-cause chain (symptom → mechanism → root):

  1. Symptom: Mass New-Order failures with 20618 r-w conflict, plus client-side stock row not found (9999).
  2. Mechanism: Killing one CN tears down in-flight txns / lock / snapshot paths. Surviving CN + reconnecting clients continue New-Order against hot warehouses; readers see WW/RW conflict (and occasional missing stock snapshot) until the cluster settles (~43 min of high-rate retries).
  3. Root cause (fixable): MO txn / conflict detection + post-CN-kill recovery — either
    • conflict is correct but recovery / retry amplification is pathological (storm lasting tens of minutes), or
    • post-kill stale snapshot / incomplete abort causes false or overly broad r-w conflict until state converges.
      Need CN/DN traces around 01:32–02:15 for conflict key, txn ids, and whether abort/cleanup completed promptly.

Timeline (CST)

Time Event Evidence
01:20:33–01:21:04 task_kill_logservice mo_chaos_test.log
01:26:04–01:27:04 task_network_dn mo_chaos_test.log
01:32:04–01:32:35 task_kill_cn mo_chaos_test.log
01:32:55 First 20618 r-w conflict (New-Order) tpcc.log
01:33:39+ Burst 9999 Stock not found tpcc.log
01:46–02:12 Peak rate (~340–418 / min) tpcc.log minute hist
02:15:13 Last 20618 in storm tpcc.log
01:30–02:19 Consistency check all successfully check.log

Evidence

A. Client FATAL samples

2026-07-26 01:32:55 FATAL jTPCCTerminal:327 - [UNEXPECTED][TT_NEW_ORDER][EXECUTION]
  ErrorCode : 20618, ErrorMessage : r-w conflict

2026-07-26 01:33:39 FATAL jTPCCTerminal:327 - [UNEXPECTED][TT_NEW_ORDER][EXECUTION]
  ErrorCode : 9999, ErrorMessage : Stock for S_W_ID = 1 and S_I_ID = 44827 not found.

B. Hourly ErrorCode (excerpt)

Hour (CST) Dominant
07-26 01 20618:5768, 9999:2575
07-26 02 20618:4763, then drop
07-26 03 back to normal chaos noise (~11 total)

C. Chaos task at trigger

2026-07-26 01:32:04 - Executing Chaos Task: task_kill_cn
2026-07-26 01:32:04 - Success: podchaos.../pod-kill-cn created
2026-07-26 01:32:34 - Cleanup Success: pod-kill-cn deleted

D. Consistency / data

  • Window verify: 5969 / 0
  • During storm: 0 consistency failed
  • Live: w_ytd - sum(d_ytd) = 0 all warehouses

Metric / log semantics

Signal Meaning
20618 r-w conflict MO abort due to read-write conflict; client sees FATAL; does not by itself mean consistency verify failed
9999 Stock not found New-Order could not read expected bmsql_stock row (visibility / miss under stress)
Consistency verification successfully Cross-table invariants still hold — orthogonal to storm volume

Proposed fixes

P0 — MO server

  1. Reproduce with task_kill_cn under TPCC New-Order load; capture CN logs for conflict key / txn abort path (pkg/txn, snapshot, lockservice).
  2. Ensure CN death promptly aborts / fences in-flight writers so survivors do not spin in r-w conflict for tens of minutes.
  3. If conflicts are expected, add server-side backoff / conflict storm mitigation and clearer metrics (mo_txn_* conflict rate by cause).

P1 — Client / chaos harness

  1. jTPCC: on 20618, retry with backoff (and re-read district/stock) instead of FATAL-storm logging.
  2. Gate: treat sustained 20618 rate (e.g. >N/min for >10min after kill_cn) as DEGRADED even when consistency is green.

Verification

  • Replay: TPCC + task_kill_cn on same topology; expect 20618 either absent or decaying within ≤5 min, not ~40+ min / 10k+ errors.
  • Consistency verify remains 0 fail; stock 9999 does not co-burst with 20618.
  • Optional: Prometheus conflict / rollback rate returns to baseline within 5 min of CN Ready.

Activity

  1. ghost added this to the MO-202607 milestone on Jul 27, 2026
  2. ghost added theissue type on Jul 27, 2026
  3. ghost added
    kind/bug
    on Jul 27, 2026
  4. LeftHandCold commented on Jul 27, 2026

    @LeftHandCold
    Collaborator

    Root-cause update

    The initial issue description left two hypotheses open. The subsequent code and failure-path analysis pins this incident to the second one: a replacement CN can finalize a table subscription after only partially consuming its checkpoint.

    Incident-to-code chain

    1. task_kill_cn forces a surviving/replacement CN to establish table subscriptions for migrated TPCC work.
    2. During the affected bmsql_stock subscription, the request context reached context deadline exceeded while checkpoint/FileService data was being loaded. The subscription event and the failed migrated statement are adjacent in the incident timeline, followed by the stock-not-found and 20618 bursts.
    3. ckputil.ObjectIter.Next() returns errors from ioutil.LoadColumnsData, including the context/FileService failure.
    4. The old loops in consumeCheckpointWithTableID used for ok, err := iter.Next(); ok && err == nil; ... and never returned err. An iterator failure therefore terminated the loop as if it had reached normal EOF.
    5. Partition.ConsumeCheckpoints received nil, published the partially populated copy, and set checkpointConsumed=true.
    6. loadAndConsumeLatestCkp also received nil and changed the table state to Subscribed.
    7. The CN then served an incomplete bmsql_stock/object view instead of retrying the checkpoint load. This accounts for the co-timed expected-stock misses; transactions built from that view can carry stale/incomplete object references into TN transfer/read-conflict checks, where the failure is surfaced as 20618 r-w conflict.
    8. Durable consistency remained green because these transactions were rejected rather than committed, but the falsely finalized subscription kept serving the incomplete view and amplified the failure into a long storm.

    Direct validation

    A deterministic regression with an expired context demonstrates the propagation defect: ObjectIter.Next() returns context.DeadlineExceeded, while the affected consumeCheckpointWithTableID returns nil. The fix makes both data and tombstone iterator paths return the original error. That error is observed before either the copy-on-write partition state is published or the subscription becomes Subscribed, so the initial load can retry.

    PR #26233 fixes this root-cause path and therefore intentionally uses fixes #26210. It does not suppress legitimate r-w conflicts; it prevents the incomplete CN state that generated this pathological post-kill-CN conflict storm.

  5. LeftHandCold commented on Jul 27, 2026

    @LeftHandCold
    Collaborator

    Object-level incident correlation

    The Loki history provides the incident-specific evidence that was missing from the earlier RCA comment.

    Exact count and ownership

    • Across the reported storm window, CN logs contain 10,531 r-w conflict errors.
    • Grouping by pod shows all 10,531 came from the replacement CN mo-chaos-regression-dis-tp-cn-jndns; no other CN produced them.
    • TN logs contain exactly 10,531 matching TRANSFER-ERR records with old-err=ExpectedEOB for <db=273116, table=273124>, i.e. bmsql_stock.
    • The first transaction, dbaed7dee248c40a18c598b457ac3352, is logged on jndns and TN on both sides of the same failed commit.

    This establishes that the issue is not a generic lock/contention conflict storm. Every 20618 is TN rejecting a row ID from jndns because the source object no longer has transfer state.

    All stale row IDs come from one prior merge

    The 10,531 failures reduce to 13 block-row IDs belonging to seven object IDs:

    • 5235c2dc69bc
    • c88bdefa05a8
    • bf92bbc870e0
    • 0600e3cc60e9
    • 861ae7f690fb
    • 7f73aff0cc9b
    • 441ad57ca1ef

    All seven appear in the from-objs of TN merge [MT-1299]-273124-bmsql_stock, started at 17:25:22 UTC and committed at 17:25:44.282 (commit-ts=1785000344282453036-0).

    TN then completed an ICKP covering 1785000273159717294-1 -> 1785000573162184911-57 (17:24:33–17:29:33 UTC) at 17:31:58. The merge deletion is inside that checkpoint interval. Therefore a correct bmsql_stock subscription established after this ICKP cannot expose those seven source objects as live.

    Subscription failure boundary

    On replacement CN jndns:

    • 17:32:15.660916: table 273124 enters SubRspReceived.
    • 17:32:15.705894: CN reports bmsql_stock subscribe-ok.
    • 17:32:15.707491: the migrated SELECT ... FROM bmsql_stock ... FOR UPDATE prepare that triggered the subscription fails with context deadline exceeded.
    • 17:32:55.368453: TN rejects the first stale object row ID with TRANSFER-ERR old-err=ExpectedEOB.

    The affected iterator loop can turn exactly this checkpoint read/cancellation into false success: ObjectIter.Next() returns the read error, consumeCheckpointWithTableID drops it, Partition.ConsumeCheckpoints publishes the partial copy and sets checkpointConsumed, and the consumer sets Subscribed.

    There is no direct iterator-error log because the affected path removes it: S3FS.Read can return ctx.Err() before event logging, and the caller loop then discards the returned error. The deterministic regression confirms that exact function boundary.

    Recovery correlation

    task_kill_dn began at 18:15:10; the last 20618 occurred at 18:15:13. jndns rebuilt bmsql_stock into a new partition state at 18:16:23, after which the storm was absent. This is consistent with replacing the bad CN subscription state, while TPCC durable consistency remained green because TN rejected the stale-row commits.

    Taken together, the production object IDs, exact 10,531-to-10,531 count, checkpoint interval, subscription deadline, and recovery on resubscription pin #26210 to the partial checkpoint publication path fixed by #26233.

  6. added a commit that references this issue on Jul 27, 2026
    4f82ab5
  7. LeftHandCold commented on Jul 28, 2026

    @LeftHandCold
    Collaborator

    fixed

  8. added a commit that references this issue on Jul 29, 2026
    9cc09eb
  9. ghost closed this as completedon Jul 30, 2026
  10. added 3 commits that reference this issue on Sep 17, 2026
    f0041b3
    7581497
    f18d636
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

    kind/bugseverity/s-1

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions