You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: mo-dump reports success after export query is canceled and silently omits rows #30574
Regression and extended verification for #30574 (2026-10-22)
Verification Environment
MatrixOne: freshly fetched origin/main, 75ae9a79d626622e6ccec0bcb28412f5fcf84c7f — fix(frontend): escape CSV values before OUTFILE framing (#30719). Clean source and actual binary identity matched; Go 1.27.1, Linux/arm64, TYPECHECK=1. Runtime identity was also checked after CN2 restart.
mo_dump: latest fetched origin/main, f228f16e97644a148e820f2c283e93fd177ec618 — Merge pull request #59 from ck89119/issue-30573-main. The tested native binary was built with Go 1.26.5 on macOS/arm64. Old-tool baseline: 324c33dbdc7075cd5d7beaafd1e15c76709dd442.
Final topology: 2 CN / 1 TN / 1 Log service / Proxy, using task-owned local DISK-V2 storage. One container runs LOG/TN/CN1 and the actual Proxy module with -with-proxy; CN2 runs as a separate process/container, allowing CN2-only termination without stopping CN1/TN/LOG/Proxy.
Proxy 127.0.0.1:6001, CN1 127.0.0.1:16001, and CN2 127.0.0.1:16002 were connected and actually used for original cancellation and normal SQL/CSV round trips. An earlier built-in TCP-forwarder run was superseded by a complete rerun through the real Proxy topology.
Protocol: mo-dump uses the MySQL driver's text result stream; MySQL CLI 9.7.1 restores with COM_QUERY, --binary-mode=1, and LOCAL INFILE for CSV. Binary prepared statements are not involved.
What Was Covered
OK — Original fixture: 200,000 rows, 200 payload bytes per row, and -net-buffer-length 16384. Interruption was gated on already-emitted INSERT data and the exact active export SELECT observed in SHOW PROCESSLIST, not a fixed sleep.
OK — Old-tool negative baseline through all three endpoints: KILL QUERY still resulted in exit 0 and MODUMP SUCCESS. Restoring those apparently successful files returned exit 0 but only 19,932, 29,872, and 39,812 rows, respectively.
OK — Fixed-tool cancellation through all three endpoints: exit 1, error 1317 / context canceled, and no MODUMP SUCCESS.
OK — Uninterrupted fixed-tool SQL and CSV exports restored completely in all 6 endpoint/mode combinations: COUNT(*)=200000, SUM(id)=20000100000, total payload length 40000000, and 0 payload/formula mismatches. Source data remained unchanged.
OK — Comment-requested CN lifecycle boundary: after streaming began and CN2's export query was confirmed active, only the task-owned CN2 container was terminated. Old tool logged unexpected EOF but returned exit 0 with a success marker; its partial file ultimately restored only 27,375 rows. Fixed tool returned exit 1, reported invalid connection, and emitted no success marker.
OK — While CN2 was stopped, CN1 remained queryable and retained all source rows and expected aggregates. CN2 was restarted and its version/data checked. Subsequent uninterrupted CN2-export → CN1-restore SQL and CSV controls both passed on their first restore attempts.
OK — Focused existing tests covered normal EOF, empty results, chunk boundaries, cancellation before/after rows, read/scan/write errors, CSV flush errors, pooled-buffer reset, physical connection cleanup, bounded bad-connection retries and actual subprocess exit/success markers. The unfinished-result fixture verifies cleanup without waiting for server EOF and successful connection reuse via PING.
OK — TestGenOutputUnfinishedRows and TestGenOutputBadConnRetry each passed 100 focused repetitions under -race; the full owning command package also passed under -race.
OK — Endpoint jobs ran concurrently with separate source/target databases and files. CN2 failure/restart ran serially with exclusive fault ownership. Test-created databases were removed and all three endpoints were healthy afterward. No engine-parallelism claim is made.
Failed — A separate post-CN2-loss restore failed at line 4, CREATE DATABASE, with 20702, lock table bind changed. The old partial-file restore succeeded on a second, explicitly recorded attempt after CN2 restart. This was not counted as uninterrupted failover availability; later full recovery controls passed without retries. Standalone SQL follow-up (2026-10-23) reproduced catalog DDL failures without mo_dump; the relationship to [Bug]: DROP DATABASE fails with lock table bind changed after controlled 3 CN to 1 CN scale-down #29447's controlled scale-down root cause remains unconfirmed.
Not covered — Live CSV cancellation/CN-loss injection (CSV error propagation was unit-tested), cross-table concurrent-transaction snapshot consistency, sustained network blackholes, TKE execution and performance/soak testing.
Findings
The fix is mo_dump PR #57, fix: fail dump exports on source row iteration errors, merged as 2384b168d497f652a540f6bfd931f478c2af0077 and included in the tested tool head.
SQL/CSV iteration now checks Rows.Err(). Failed exports close the physical query connection before closing unread rows; pre-result bad-connection retries remain bounded, and partial result streams are not retried. Both real KILL QUERY and CN2 disappearance now fail visibly instead of certifying incomplete output.
Already-written partial files are not rolled back and must not be treated as complete backups. The separate 20702 DDL observation is tracked with additional evidence under #29447. It is not part of this tool error-signaling acceptance; its exact root cause and equivalence to the existing scale-down issue are still unconfirmed. This verification does not assert seamless database failover.
MOTR / BVT Coverage
The merged fix already contains deterministic row-error, cleanup, retry, driver-protocol and CLI-exit regressions. This run supplements them with actual MatrixOne streaming export/restore and CN2-only failure evidence. No duplicate SQL-only MOTR case was added: it would not execute the external serializer or its exit-status contract. No new regression commit, push or weekly PR update was required. Product source and existing Docker configuration/data directories were not modified; the additional topology used temporary task-owned configuration/data.
Final Conclusion
Fixed for #30574: canceled or disconnected SQL exports no longer return false success on the verified versions, including the CN2-disappearance boundary.
Large-data/streaming regression was required and executed locally using the original 200,000-row / 40 MB fixture to keep a real result stream in flight under output backpressure. Minimal deterministic unit fixtures cover individual row/chunk/error boundaries. Further arbitrary volume, a TKE run or a throughput target is unnecessary for this specific error-propagation contract.
No issue-state change was performed by this verification.
Activity
Ariznawlll commentedon Oct 19, 2026
补充跨 CN 生命周期边界(同一根因,不另开单):在固定 main
75ff736835c3d00d40dc00a0a1d3b11129388e5b的隔离双 CN 上,三份各 200,000 行/40 MB 的独立源表通过第二 CN 正在执行SELECT *导出;SHOW PROCESSLIST确认查询仍活动时停止仅第二 CN。三次客户端均记录unexpected EOF,但 mo-dump 都退出 0 并写MODUMP SUCCESS;将各自脚本导入第一 CN 也都退出 0,却只恢复 76,150 / 84,276 / 95,847 行。三份源表在第一 CN 上仍各 200,000 行,后续连接正常。未中断的第二 CN → 第一 CN 20,000 行 SQL/CSV 对照均完整一致。该结果把本 issue 的Rows.Err()漏检扩展到 CN 消失场景;成功标记绝不能作为完整备份依据。slyunnn commentedon Oct 22, 2026
Regression and extended verification for #30574 (2026-10-22)
Verification Environment
origin/main,75ae9a79d626622e6ccec0bcb28412f5fcf84c7f—fix(frontend): escape CSV values before OUTFILE framing (#30719). Clean source and actual binary identity matched; Go1.27.1, Linux/arm64,TYPECHECK=1. Runtime identity was also checked after CN2 restart.origin/main,f228f16e97644a148e820f2c283e93fd177ec618—Merge pull request #59 from ck89119/issue-30573-main. The tested native binary was built with Go1.26.5on macOS/arm64. Old-tool baseline:324c33dbdc7075cd5d7beaafd1e15c76709dd442.2 CN / 1 TN / 1 Log service / Proxy, using task-owned local DISK-V2 storage. One container runs LOG/TN/CN1 and the actual Proxy module with-with-proxy; CN2 runs as a separate process/container, allowing CN2-only termination without stopping CN1/TN/LOG/Proxy.127.0.0.1:6001, CN1127.0.0.1:16001, and CN2127.0.0.1:16002were connected and actually used for original cancellation and normal SQL/CSV round trips. An earlier built-in TCP-forwarder run was superseded by a complete rerun through the real Proxy topology.9.7.1restores withCOM_QUERY,--binary-mode=1, andLOCAL INFILEfor CSV. Binary prepared statements are not involved.What Was Covered
200,000rows,200payload bytes per row, and-net-buffer-length 16384. Interruption was gated on already-emittedINSERTdata and the exact active exportSELECTobserved inSHOW PROCESSLIST, not a fixed sleep.KILL QUERYstill resulted in exit0andMODUMP SUCCESS. Restoring those apparently successful files returned exit0but only19,932,29,872, and39,812rows, respectively.1, error1317/context canceled, and noMODUMP SUCCESS.6endpoint/mode combinations:COUNT(*)=200000,SUM(id)=20000100000, total payload length40000000, and0payload/formula mismatches. Source data remained unchanged.unexpected EOFbut returned exit0with a success marker; its partial file ultimately restored only27,375rows. Fixed tool returned exit1, reportedinvalid connection, and emitted no success marker.PING.TestGenOutputUnfinishedRowsandTestGenOutputBadConnRetryeach passed100focused repetitions under-race; the full owning command package also passed under-race.4,CREATE DATABASE, with20702,lock table bind changed. The old partial-file restore succeeded on a second, explicitly recorded attempt after CN2 restart. This was not counted as uninterrupted failover availability; later full recovery controls passed without retries. Standalone SQL follow-up (2026-10-23) reproduced catalog DDL failures withoutmo_dump; the relationship to [Bug]: DROP DATABASE fails with lock table bind changed after controlled 3 CN to 1 CN scale-down #29447's controlled scale-down root cause remains unconfirmed.Findings
The fix is mo_dump PR #57, fix: fail dump exports on source row iteration errors, merged as
2384b168d497f652a540f6bfd931f478c2af0077and included in the tested tool head.SQL/CSV iteration now checks
Rows.Err(). Failed exports close the physical query connection before closing unread rows; pre-result bad-connection retries remain bounded, and partial result streams are not retried. Both realKILL QUERYand CN2 disappearance now fail visibly instead of certifying incomplete output.Already-written partial files are not rolled back and must not be treated as complete backups. The separate
20702DDL observation is tracked with additional evidence under #29447. It is not part of this tool error-signaling acceptance; its exact root cause and equivalence to the existing scale-down issue are still unconfirmed. This verification does not assert seamless database failover.MOTR / BVT Coverage
The merged fix already contains deterministic row-error, cleanup, retry, driver-protocol and CLI-exit regressions. This run supplements them with actual MatrixOne streaming export/restore and CN2-only failure evidence. No duplicate SQL-only MOTR case was added: it would not execute the external serializer or its exit-status contract. No new regression commit, push or weekly PR update was required. Product source and existing Docker configuration/data directories were not modified; the additional topology used temporary task-owned configuration/data.
Final Conclusion
Fixed for #30574: canceled or disconnected SQL exports no longer return false success on the verified versions, including the CN2-disappearance boundary.
Large-data/streaming regression was required and executed locally using the original
200,000-row /40 MBfixture to keep a real result stream in flight under output backpressure. Minimal deterministic unit fixtures cover individual row/chunk/error boundaries. Further arbitrary volume, a TKE run or a throughput target is unnecessary for this specific error-propagation contract.No issue-state change was performed by this verification.