Repository navigation
Description
Description
在 JED 的 managed Standard v4.1.0 实例上执行 72 小时大规模持续写入时,批量 REPLACE 无法维持配置的 400 rows/s。随着运行时间和表规模增长,累计吞吐下降到约 263 rows/s,最近约 4.5 小时只有约 134 rows/s,并出现两条持续 111–116 秒后以 broken pipe 失败的写语句。
相同 workflow、相同 workload 参数在 MTY v4.1.1 新实例上累计约 398 rows/s,可达到目标。该对照说明 400 rows/s 是客户端实际施加的目标,而不是从 JED 当前吞吐反推得到的配置值。
本 Issue 记录 managed v4.1.0 现场的大规模持续写入退化,供定位 TN/merge/checkpoint/commit 或 REPLACE 路径的瓶颈;尚未声称已在 official main 复现。
Environment
- Affected server:
8.0.30-OmniFabric-v4.1.0 - Deployment: managed Standard, JED
- Topology visible to tenant: two CN endpoints behind the managed database entry
- Observation window:
2026-08-18 10:40:13to2026-08-20 09:32:47UTC - Workload source:
matrixorigin/cloudsigma-gitopscommit25933d06e72567a559422ed0eca05315c9df5da9 - Latest official
mainreference at filing time:94528dcb63d55921b936cda611ea61eb1862ea79 mainstatus: not reproduced yet; the SHA above is a version boundary, not a tested build
Endpoints, tenant/account identifiers, credentials, node addresses and payload values are intentionally omitted.
Workload
The attached 72-hour stability job uses:
rows_per_second: 400
rows_per_batch: 1000
payload_extra_bytes_per_row: 1024
business_query_interval_seconds: 0
statement_observer_interval: 900s
writer connections: 1
write SQL: REPLACE INTO
primary key: (run_id, sequence_id)
Each run uses a new run_id, and sequence_id increases from zero. Retried batches are idempotent because the composite primary key is deterministic.
Steps to reproduce
- Attach the workload above to an existing Standard instance whose target table already contains tens of millions of rows from earlier soak runs.
- Start a new 72-hour run at
400 rows/s,1000 rows/batch, with 1024 additional payload bytes per row. - Periodically read the maximum
sequence_idfor the currentrun_idand compare it withelapsed_seconds * 400. - Aggregate the tagged
REPLACErecords insystem.statement_infoby time window, recording count, average/max duration, status and error. - Continue beyond 40 hours and observe whether the client can keep up with the target.
Actual behavior
At 2026-08-20 09:31:37 UTC:
elapsed: ~46.86 hours
latest sequence_id: 44,347,999 (~44.348 million rows)
rows expected at 400 rps: ~67.47 million
cumulative rate: ~263 rows/s
target attainment: ~65.7%
The degradation continued during the observation:
earlier snapshot: 42.158 million rows at 2026-08-20 04:58:39 UTC
later snapshot: 44.348 million rows at 2026-08-20 09:31:37 UTC
interval rate: ~134 rows/s over ~4.55 hours
The server-side REPLACE latency was not monotonically increasing, but its baseline and tail became materially worse:
initial windows average: ~0.085–0.122s per recorded REPLACE statement
later 6h windows average: ~0.299–0.415s
2026-08-20 04:00–09:32 UTC:
statements: 6,010
average duration: ~0.971s
max duration: 115.638s
failed statements: 2
The two failures were:
duration=115.638s, err_code=20101, routine send response failed: broken pipe
duration=111.599s, err_code=20101, routine send response failed: broken pipe
Later writes succeeded and the Action remained running, so this was recovery after long stalls rather than a permanent stop. However, retry/recovery did not restore the configured cumulative throughput.
Expected behavior
- A supported Standard instance should sustain at least the workload's 95% acceptance threshold (
>=380 rows/s) for this bounded soak, or expose an explicit capacity/admission error instead of silently falling behind. - Batch latency should remain bounded without 110+ second server executions and socket failures.
- Temporary retryable failures should recover without creating an ever-growing schedule backlog.
- Data must remain contiguous and idempotent after retry/reconnect.
Stability and controls
- Affected JED run: one long-running field observation; the issue is not claiming 3/3 reproduction on official
main. - MTY control: the same workflow commit and workload parameters on a fresh v4.1.1 Standard instance reached approximately
29.324 millionrows in20.45 hours, or about398 rows/s(~99.6%of target). A 12-minute metadata delta was approximately409 rows/s. - The MTY control differs in release (
v4.1.1) and pre-existing table history, so it proves that the workload generator can reach the target but does not isolate the product change or physical-table-state trigger. - The deterministic key makes retries idempotent. Full sequence-gap/checksum validation will run at finalization; it was not executed while the soak was active.
- No DML/DDL was issued during investigation other than the workload itself; diagnosis used read-only metadata and
statement_infoqueries.
Evidence
- Affected JED soak: https://github.com/matrixorigin/cloudsigma-gitops/actions/runs/32127762306
- MTY control: https://github.com/matrixorigin/cloudsigma-gitops/actions/runs/32231917947
Both Actions were still in progress at the latest snapshot. The numbers above come from the live target tables and redacted system.statement_info aggregates, not from the Action status alone.
Code analysis
Confirmed at the workload boundary:
- The scheduler targets one 1,000-row batch every 2.5 seconds.
- When it falls behind, it advances
next_writeby the fixed interval and immediately tries subsequent batches; therefore the cumulative shortfall is not caused by a deliberate reduction of the configured target. - The writer is single-threaded, so prolonged batch execution/reconnect/retry directly limits catch-up capacity.
- The server retained two failed
REPLACEexecutions for 111–116 seconds and then failed while sending the response to a client whose socket was already gone.
Root-cause hypothesis, not yet proven: the large existing table/object history plus shared TN background pressure (merge/checkpoint/commit/logtail) increases REPLACE service time until the single writer cannot sustain or catch up with 400 rows/s. Data-plane metrics and logs are required to distinguish that from a REPLACE conflict-detection/flush path bottleneck.
Regression coverage
Add a big-data/stability regression rather than a BVT timing assertion:
- Preload the same composite-PK table to at least 50 million rows or an equivalent object/L0 history.
- Run 1 KiB payload writes at 400 rows/s for a long enough window to cross merge/checkpoint cycles.
- Assert achieved throughput
>=95%of target in every bounded window and cumulatively. - Record batch p50/p95/p99/max, retry/reconnect counts, zero-write windows and schedule lag.
- Validate sequence continuity, checksum/idempotency and post-reconnect correctness.
- Correlate CN/TN/LogService memory, restart/OOM, merge, checkpoint, commit, logtail and object-store metrics.
Related
- [Bug]: Single-row REPLACE waits up to 245s in Multi Update with zero scan #27046 tracks single-row watermark
REPLACEwaiting inMulti Updateunder shared background pressure. This issue tracks end-to-end sustained batch-write capacity and target attainment; the two may share a TN/merge trigger. - [Bug]: Single-row INSERT on a primary-key table reads all existing rows #27045 tracked table-scale read amplification for new-key
INSERTwhen merge was paused; it did not cover this batchREPLACEthroughput acceptance failure. - [Bug]: DROP/TRUNCATE on empty tables waits 35–96s under sustained ETL load in v4.1.0 #27059 tracked slow
DROP/TRUNCATEunder the same class of shared background pressure; it did not cover long-running DML throughput.
Activity
ck89119 commentedon Aug 24, 2026
基于两个 72 小时 Workflow 的 artifacts、受影响集群现场、执行计划、日志、指标以及
REPLACE相关代码路径,调查结论如下。根因
问题的主要瓶颈不在 TN commit/checkpoint、锁、LogService、OOM 或节点压力,而在复合主键冲突检测路径:
(run_id, sequence_id)上的 runtime filter/裁剪没有将目标表扫描有效收敛到本批输入主键。随着当前 run 的数据量增长,每条REPLACE需要扫描的主键数据不断增加;到约 4000 万行后,扫描工作集引发 FileService 缓存剧烈淘汰和大量 S3 读取,最终形成延迟断崖。受影响 JED 运行的现场数据:
在
2026-08-20 09:30–09:40 UTC:慢计划的大部分耗时位于目标表
Table Scan。Multi Update Wait Time主要是在等待上游 DEDUP 扫描,并不代表 TN 写入或 commit 慢;实际 lock wait 只有毫秒级。同一窗口内,CN commit p99 约 239ms,TN commit p99 约 30ms,LogService append p99 约 22ms。CN/TN 均没有重启或 OOM,TN merge/checkpoint 也正常。客户端超时和 broken pipe 的原因
workload 配置了 30 秒 PyMySQL read timeout。服务端扫描超过 30 秒后,客户端断开连接并重试同一批数据,但原服务端 SQL 仍可能继续执行。例如,同一个
sequence_id=44349000批次在短时间内出现了 85.44s、75.40s、35.96s 和 12.64s 的多次服务端执行。后续的
broken pipe是服务端尝试向已经被客户端关闭的连接返回结果,是超时的结果,而不是最初根因。重叠重试又进一步放大了扫描和 S3 压力。另外,由于 PyMySQL 的 statement-size 限制,每个逻辑上的 1000 行
executemany实际会被拆成约776 + 224两条REPLACE,因此每个逻辑批次会执行两次冲突检测扫描。对照运行结果修正
已完成的 artifacts 并不支持“MTY 对照稳定达到 400 rows/s”的结论:
因此,这不能简单归因于 JED v4.1.0 相对于 MTY v4.1.1 的单版本回归。
修复与验证方向
产品侧需要让 DEDUP 目标扫描上的复合主键 runtime filter/lookup 真正精确生效,使选中 block 数和读取字节数由输入批次大小决定,而不是随整表规模增长。
候选提交
14807e8730(fix: add composite primary key runtime filters)与该故障方向一致,但仍需要:REPLACE对比;Table Scan的 selected block 数和 read bytes,确保其不会随表规模线性增长。workload 侧也应避免在写入结果不确定的超时后立即重试:应增加服务端取消或已提交范围确认,防止同一批次重叠执行并放大负载。
Ariznawlll commentedon Aug 26, 2026
2026-08-26 CloudSigma long-write follow-up
The current 72-hour 400 rows/s / 1 KiB-row
REPLACEsoak continues to reproduce the issue pattern on both managed Standard environments:SELECT 1probes, issued 10 seconds apart, all failed withERROR 20508: all CN servers are busy, possibly due to too many active transactions. This is persistent at the observation point, not a one-off client timeout.statement_infowindow for the current run contains 59 successful 1,000-rowREPLACEstatements, with mean server duration 42.72 s and max 86.77 s. This is about 16.8 rows/s, versus the configured 400 rows/s target.No DML/DDL was issued during this follow-up; the evidence comes from the existing workload and read-only probes/aggregates. The exact cause of JED's 20508 requires CN/TN metrics and logs, but the observed scan-driven
REPLACEdegradation remains consistent with the root cause already described above. Please include this current v4.1.0/v4.1.1 field evidence when verifying the composite-primary-key runtime-filter fix and confirm the release branch carrying it.Ariznawlll commentedon Aug 27, 2026
2026-08-27 seven-day follow-up started
I updated the long-write workflow at
c44f954and started a new seven-day soak on the retained JED and MTY Standard instances.GitHub Actions has a five-day maximum per self-hosted job, so a requested
168-hour customer-volume soak is deliberately split into a 72-hour first phase and an automatically dispatched 96-hour follow-up. The two phases reuse the same instance and table; the second phase is queued after the first phase has produced a report, even if the first phase misses the throughput acceptance gate.Current dispatches:
This is an observation run, not a claim that the defect is fixed. The follow-up will retain the existing scan/throughput/retry evidence for comparison with the composite-primary-key runtime-filter fix.
ck89119 commentedon Aug 31, 2026
补充本地严格 A/B 结果,并更正我在前一条调查评论中对 PR #27501 的判断。
结论更正
PR #27501 修复了普通复合主键 JOIN 的 runtime filter,但没有修复本 issue 的
REPLACE -> DEDUP JOIN -> __mo_cpkey_col路径。不能把包含 #27501 的镜像视为 #27403 已修复。此前评论将现场退化概括为“复合主键 runtime filter 未有效裁剪,并可由 #27501 解释”,这个范围过宽。重新解析现场物理计划和完成相邻提交 A/B 后,更准确的描述是:
0或776行;Read Size会随规模增长到约252MiB/语句;1. #27501 的目标能力验证通过
使用 #27501 squash merge 的严格相邻提交:
249a458ba567b26d1818fb0496b449135cb05ef2ae12701a888fac102e9641cc7cbb8706527366d8在100万行表上执行普通复合主键 JOIN + 3个 inline VALUES 键:
这证明 #27501 对其目标场景有效,测试环境也能观测到该修复。
2. REPLACE 路径在 #27501 前后没有变化
正常对象布局下,复合主键 REPLACE 的结果为:
随后使用原 Workflow 的精确15列表结构、
BIGINT UNSIGNEDsequence、1024-byte deterministic JSON payload,以及 PyMySQL 的776 + 224statement 拆分,运行到“历史10万 + 当前 run 80万”行:0 blocks / 0 rows,混合键始终1 block / 388 rows;说明“仅缩小缓存”不足以复现,也说明 #27501 没有改变 REPLACE 的隐藏复合主键 DEDUP 路径。
3. 现场计划是“输出很少,但读取很多”
重新提取 affected Workflow artifact 中1,741个唯一物理计划:
40M–45M 区间最大延迟达到215.3s。最慢计划读取约257.5MiB,最终只返回776行;部分新键计划读取约256MiB,最终返回0行。
4. 大量小型 L0 对象可在本地触发同方向退化
为了缩比对象布局而不复制50GB现场数据,测试采用:
v4.1.0 结果:
500个对象时累计产生18,176次 disk-cache eviction。
#27501 after 结果同样为200/300/500 blocks 扫描全部已有行;500对象时写批 p95 为0.443s,累计14,401次 eviction。当前 main
34fb54084ca14275989944ae5994ae79e1ab285e在200对象/20万行时也仍扫描200 blocks/20万行。同表可逆验证:
该恢复过程未执行
ANALYZE TABLE。这证明在本地,大量小型 L0 对象与 REPLACE 的早期裁剪失败存在直接因果关系,auto-merge 后能够恢复。当前判断与局限
当前最强的机制假设是:
__mo_cpkey_col精确过滤不能在这些对象上形成有效 reader/range pruning;但需要明确两个限制:
merge show,因此“现场也是 L0 积压触发”仍待确认;建议在现场先做只读确认:
重点检查 L0 object count、merge tolerance、queue 和最近 merge 时间。任何手工 merge 或参数调整都应另行评估生产影响。
后续修复验收应增加“100–500个小型 L0 对象 + 全新复合主键 REPLACE”的集成回归,并断言 Table Scan blocks/rows 不随总对象数线性增长。仅验证 #27501 的普通复合主键 JOIN 用例不足以关闭本 issue。
Ariznawlll commentedon Sep 14, 2026
测试版本
codex/standard-stability-impl31e3e775aa262c3e97fe28290ee55e382ded63e4main参考:bb358ea76aeb44a6eed5079616e7e75ba35e75b9(本次为 managed CloudSigma 现场复现,不是 officialmain修复验证)原问题验证
本次两条已完成的 72 小时 soak 使用与本 issue 相同的关键负载:复合主键
(run_id, sequence_id)、REPLACE INTO、1,000 行逻辑批次、400 rows/s、每行额外 1 KiB payload、单 writer,并复用已有历史数据的standard_stability.pump_telemetry表。两条任务均达到配置的 72 小时 wall-clock deadline,实例最终仍为
ACTIVE,但均因写入量/逻辑 payload 未达到 95% 验收线而失败。表现与 #27403 中“单 writer 在表规模增长后无法追上固定 400 rows/s,偶发超时/断连后无法恢复累计吞吐”的问题一致。本次 artifact 没有采集 EXPLAIN ANALYZE、对象/L0 数或 FileService 读量;因此这里确认的是同一 workload 和同一外部退化形态,不把现场根因进一步断言为某一种 reader/range-pruning 实现细节。
Happy Path 覆盖
REPLACE并完成 4,482.9 万 / 4,545.2 万行写入;任务没有永久停机,且实例最终为ACTIVE。Unhappy Path 覆盖
Connection reset by peer、连接超时;MTY 记录到Connection reset by peer、查询超时及临时 DNS 解析失败。statement_info观察也漏采:15 分钟一次、72 小时理论 288 次,JHB 成功 147 次、MTY 成功 188 次。该指标反映 writer 被长阻塞期间无法按计划完成观察,不作为独立statement_info缺陷结论。final validation failed;因此不把当前 artifacts 当作数据正确性通过证据。白盒验证
不适用。本次是 managed CloudSigma 现场运行,仅使用 workflow artifact 中已脱敏的负载事件和聚合指标;未执行节点侧注入、手工 merge 或配置变更。
回归测试
未新增回归代码。本 issue 既有的“复合主键
REPLACE+ 大表/对象历史 + 长稳吞吐和扫描读取量”方向仍适用;本次结果支持将 JHB、MTY 的同类长稳 field evidence 纳入该验证,而不新建重复 issue。测试证据
测试结论
测试不通过。
fix(plan): retain bounded REPLACE primary-key runtime filters (#32401)
XuPeng-SH commentedon Nov 9, 2026
转 QA 验证(不是验收通过)。
关联修复 #32401 已合入 main,merge SHA:da867c90dfaf1c5102ace1a192b358fcc5adbb9c。该修复针对完整物理主键的有界 REPLACE/DEDUP lookup 在旧 NDV 统计下丢失 runtime filter 的路径,保留 exact-IN 预算、编码和 PASS 回退边界。
已核对本 issue 全部 5 条评论。旧版 managed soak 失败及 #27501 的范围不足是修复前证据,不作为此合并版本已验证失败的结论;当前未发现适用于新修复的已验证反例或未完成开发 follow-up。
验证证据来自 PR 作者和评审记录,不是本轮本地实测:作者报告固定 16 个新键、8/16 个 L0 对象下,目标扫描由 8/512、16/1024 blocks/rows 降至 0/0,ReadSize 为 0;14 个场景各运行两次通过,相关完整包测试与 REPLACE BVT 783/783 通过。评审在 0093510 上引用构建、Ubuntu UT/coverage、arm64 SCA 和 compose BVT 的成功证据;这些不等同于对 merge SHA 或现场长稳的本轮实测。
尚未验证:原始大表/历史对象规模、managed 部署及 72 小时吞吐和长尾、最终数据连续性与重试幂等性。建议 QA 在包含上述 merge SHA 的版本上,覆盖 100–500 个小 L0 对象、原 1,000 行逻辑批次及客户端拆分、新键/冲突/混合键、超预算回退和事务内冲突;分别记录扫描块数、读取字节、对象元数据开销、吞吐和取消/重连后的正确性。该修复不承诺对象元数据处理恒定时间,不据此自动要求 4.2 backport。
fix: add composite primary key runtime filters (cherry-pick #27501) (#…
fix(plan): retain bounded REPLACE primary-key runtime filters (cherry…
slyunnn commentedon Nov 20, 2026
Regression and extended verification for #27403 (2026-11-20)
Verification Environment
main@96bfaa437bd9d535f22b6bd981ad00e277a4a91e, docs: document unsupported MySQL administration statements (docs: document unsupported MySQL administration statements #32974). Actualgit_version()was verified. The 129 Actions used isolated, resource-controlled single-CN test slots and the MySQL text protocol via PyMySQL; services and owned data were cleaned up automatically.2 CN / 1 TN / 1 Log service / Proxyonmain@43fa9f43298f9e60d3c903ba2d6c7d47d4d01af9. SQL actually ran through Proxy6001, CN116001and CN216002. These endpoint results are recorded at that commit; the final 129 performance runs were single-CN, not multi-CN throughput tests.main@b543648d99395492918ce0a5a3c08a7de952042d, fix: bound wide payload batches in broadcast hash joins (fix: bound wide payload batches in broadcast hash joins #32917).da867c90dfaf1c5102ace1a192b358fcc5adbb9c. It preserves a bounded complete-physical-PK DEDUP runtime filter despite stale NDV, while retaining budget/encoding/direction guards and PASS fallback.What Was Covered
0persisted blocks/rows and read0bytes; existing and mixed keys each scanned1block with1,000and500rows. The776 + 224new-key split scanned0persisted blocks/rows in both statements. Exact replacement-row counts passed.500L0 objects /500,000history rows, enabled auto-merge, then wrote360,000unique rows in1,000-row logical batches. Each of three consecutive300-second windows achieved400 rows/s, exceeding380 rows/s; cumulative throughput was399.999 rows/s.124.8 ms, p95142.5 ms, p99149.9 ms, maximum156.1 ms; maximum scheduling lag14.0 ms; actual error retries0. Runtime logs show12target-table merge completions and3incremental checkpoint completions during the measured interval. Final container evidence records no OOM kill or restart.matrixorigin/mo-nightly-regression,script/nesr_continuous_writer.py, source commit9a50314b0ef06a6d6a6984b1b9c1ada086c8ed4d, file SHA-256b33c00ca1e553959d5ffc64910057b07440be167c55976733c23baa03f787655. The schema has the same composite PK, ordinary telemetry columns and JSON payload, with no secondary index or FK. The comparison added a deterministic 1 KiB payload field and used real PyMySQLexecutemany, autocommit disabled and explicit commit.120,000unique rows in300seconds (399.997 rows/scumulatively), with p95308.5 ms, maximum324.3 ms,0actual retries and2controlled reconnect/replays. The driver executed244physical REPLACE statements including replay. Final sequence and JSON payload checksum checks passed. Assertions, artifact upload and slot cleanup succeeded.TestDedupPrimaryKeyRuntimeFilterWithStaleStatsand embeddedTestReplaceCompositeKeyPrunesFlushedObjectspassed, including budget/rejection controls and transaction-local conflicts in the existing tests.404; the recovered 15-column source is not asserted to be that exact incident version.Findings
The reconstructed L0-history REPLACE regression is resolved: scanning remains limited to matching keys at both tested object counts, and the bounded workload sustains the requested throughput while merges and checkpoints actually execute. The JSON/15-column/explicit-transaction comparison also sustains the target, covering the material differences from the initial three-column fixture.
Large-data regression was necessary because object history triggers this path. Verification used the issue's allowed equivalent-object/L0 alternative, rather than claiming a 50-million-row or managed 72-hour replay. The issue asks for a sufficiently long window across merge/checkpoint cycles; it does not mandate 72 hours for every fix regression. The measured cycle evidence and three throughput windows support this bounded acceptance conclusion. The unavailable original version remains an explicit evidence limit, not a claim of exact workload identity.
MOTR / BVT Coverage
Reused the existing focused planner and embedded SQL regressions and added the 129 Action path/throughput checks on test branch
test/issue-29383-27403-129. No duplicate small SQL-only MOTR case was added: a timing assertion in BVT would not exercise the history/throughput failure. Heavy fixture and workload phases ran serially; runner scheduling was not treated as engine parallelism. Action artifacts contain JSON batch measurements, logs and cleanup evidence.Final Conclusion
Fixed for the reconstructed bounded composite-PK REPLACE regression, validated with equivalent L0 history and sustained-throughput checks as described above. Closing with the original managed deployment and exact historical-version replay limits explicitly retained.