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]: DN snapshot writes keep I/O workers busy after the parent flush times out #33490
4.2-dev, v4.2.9 at 6c05e42f9f. The two affected flush task implementations are unchanged at 47e43f24a5.
Actual behavior
A DN table-tail flush timed out waiting for its appendable-object snapshot on November 29. The parent logged the error at 14:44:06 (UTC+8). A three-row child of the same task logged a successful write at 15:02:30, over 18 minutes later. Its batch encoding took 77 μs and its object sync took 23 min 45 s. At least ten child writes from that parent logged success after the parent reported failure.
The wait deadline applies to the parent's wait. A child that has taken ownership of its batch uses the I/O worker's context for object sync. The parent's error cleanup can release a queued batch but cannot cancel that running write. The I/O worker remains occupied even though the parent can no longer commit the flush.
Reproduction
Queue two three-row object flushes on the same single-worker handler, with the second flush submitted as follow-up work after the first parent wait fails.
Delay the response to the first object PUT by 400 ms. After the request has reached storage, use a 40 ms caller deadline for the existing snapshot wait and run the parent's error cleanup.
Observe whether the first PUT is canceled and measure elapsed time from the failed wait until the second flush succeeds. On the original implementation the first PUT completes and the second flush waits for the remaining delay.
Expected behavior
Cancel outstanding snapshot writes for both data and tombstones on parent failure. Retire pending batches and let running writers release their resources before another flush can reuse the same object scopes.
The initial storage slowdown and the contribution to checkpoint lag or OOM remain open questions.
I compared the original QA revision (6c05e42f9f) with a candidate that cancels and drains outstanding snapshot writes on parent failure. Both binaries used the same single-worker queue on the same Linux host. Each object had three rows. The first write was delayed by 400 ms, and the parent was given a 40 ms deadline after the write entered storage.
Scenario
Runs per version
Original P50 / P95
Candidate P50 / P95
S3FS + MinIO SDK, loopback HTTP endpoint delays the first PUT response
20
361.119 / 361.448 ms
0.645 / 0.831 ms
MemoryFS, delayed write observes cancellation
20
360.746 / 360.958 ms
0.187 / 0.243 ms
MemoryFS, delayed write ignores cancellation
20
360.652 / 360.771 ms
360.578 / 360.690 ms
Healthy control, two successful writes
120
0.168 / 0.254 ms
0.172 / 0.274 ms
The first three rows measure time from the parent's failed wait through cleanup and successful completion of the next flush. The control measures total time for two successful writes. In the HTTP test the endpoint saw the first request canceled in 20/20 candidate runs and saw it complete in 20/20 original runs. The second write succeeded in every run.
A backend that ignores cancellation still has to drain before the parent can release its object scopes. The HTTP endpoint simulated storage latency; these measurements establish worker recovery in that scenario. Production checkpoint completion time, OOM frequency and remote rollback of a partially processed upload were outside the experiment.
Activity
iamlinjunhong commentedon Nov 30, 2026
I compared the original QA revision (
6c05e42f9f) with a candidate that cancels and drains outstanding snapshot writes on parent failure. Both binaries used the same single-worker queue on the same Linux host. Each object had three rows. The first write was delayed by 400 ms, and the parent was given a 40 ms deadline after the write entered storage.The first three rows measure time from the parent's failed wait through cleanup and successful completion of the next flush. The control measures total time for two successful writes. In the HTTP test the endpoint saw the first request canceled in 20/20 candidate runs and saw it complete in 20/20 original runs. The second write succeeded in every run.
A backend that ignores cancellation still has to drain before the parent can release its object scopes. The HTTP endpoint simulated storage latency; these measurements establish worker recovery in that scenario. Production checkpoint completion time, OOM frequency and remote rollback of a partially processed upload were outside the experiment.
fix(tae): cancel snapshot writes when a table-tail flush fails (#33494)
XuPeng-SH commentedon Nov 30, 2026
main已合入 #33494。我在实际合并版本7e8130e179f32f1e4f17e7f560d20f6fbc90c051上用 Go 1.27.1 运行了本地回归:TestAbortSnapshotWrites、TestSnapshotWriteStartDuringAbort各 20 次通过;真实 TAE 引擎的TestFlushTableErrorHandle、TestFlushTableErrorHandle2、TestFlushLegacyAnyReturnsErrorAndWorkerContinues均通过(3.341 秒)。覆盖中止时释放未启动的 batch、取消并等待已启动的写入,以及 flush 出错后的工作线程继续服务。这是
main上的合入版验证,不是生产对象存储回放,也没有在这个 SHA 重测 PR 中的恢复延迟。Required CI 未绿,已识别 Coverage runner 在安装依赖阶段超时 #33518,不能用本地定向结果替代完整 CI。QA 对应的4.2-dev#33493 尚未合并,当前工单仍由研发负责,不转测。[4.2-dev] fix(tae): cancel snapshot writes when a table-tail flush fa…
Ariznawlll commentedon Dec 1, 2026
测试版本
efbab93eb361eabddf1fb5c012e93bec094660c1;本地精确构建BUILD_42_EFBAB_PASS,mo-service SHA-256c2bcf9dfbb173b8b01579df7b04626aaaffee929ea9ea47b338563a890ba2a10,验收开末官方 SHA 一致。-race;真实 S3 SDK MinIO loopback PUT 与 MemoryFS 对照。测试日期:2026-12-01。原问题验证
严格按原复现使用同一个单 OpWorker 排队两个三行
flushObjTask:首个 PUT/write 已进入存储后,400ms 后端延迟超过 40ms parent wait;执行 parent error cleanup,再提交后续 flush。当前 efbab 下原场景及对照合计 180/180 PASS:S3 cancel 20、MemoryFS cancel 20、忽略 cancel 的 drain 20、健康对照 120。Happy Path 覆盖
TestSnapshotWriteStartDuringAbortrace 20/20:Execute 与 abort 两种取得所有权的顺序均正确退休 batch。Unhappy Path 覆盖
TestAbortSnapshotWritesrace 20/20:运行中的 data/tombstone writer 均取消并 drain,pending writer 不进入存储。TestFlushTableErrorHandle、TestFlushTableErrorHandle2、TestFlushTableTailRetiresQueuedSnapshotOnPanic各 race 3/3,合计 9/9;无 DATA RACE、FAIL 或 SKIP。白盒验证
核对当前 efbab:
flushTableTailTask.Execute在!snapshotsDone的 defer 中调用abortSnapshotWrites,覆盖普通 error 与 panic unwind;snapshot/tombstone task slots 在调度期间对 cleanup 可见。取消路径同时处理运行中 writer 的 drain 与 pending batch 退休。未修改 MatrixOne 产品源码。回归测试
独立 matrixorigin/motr#399,head
e4623836c362fefc1727b2a8193dca49b63172a0;包含完整 native、原单 worker 180 项及真实 TAE race 门禁。定向snapshot-flush-cancel-drain-42与 offline 4 项均 SUCCESS(run 46595063346)。CI 同样通过 native cancel 40/40、原单 worker 180/180 和真实 TAE race 9/9;无 DATA RACE、FAIL 或 SKIP。CI 原场景 P50/P95:S3 cancel3.501/3.765ms,MemoryFS cancel1.596/1.799ms,忽略 cancel drain361.550/361.897ms,健康对照1.900/2.540ms。测试证据
本地证据:
qa-33490/42-efbab-final/(identity、三份 race 日志及 SHA256SUMS)。原场景延迟:S3 cancel P50/P952.460/4.032ms,MemoryFS cancel0.813/1.012ms,忽略 cancel drain360.670/361.372ms,健康对照0.546/1.078ms。该结果不宣称生产 checkpoint lag、OOM 或远端 PUT 事务回滚已验收。测试结论
当前 efbab 下原问题场景、Happy/Unhappy Path、白盒核对及独立 MOTR 完整 race 回归均通过,复测结论为 PASS,关闭本 Issue。
Ariznawlll commentedon Dec 1, 2026
结论
测试通过。 已在官方最新
4.2-dev的合入版本上,按原始“三行 flush、单 I/O worker、存储写入已开始后父任务超时、随后第二个 flush”条件完成受控故障验收;取消、等待无法取消的写入退出、健康路径及后续 worker 继续服务均通过。对应 4.2-dev MOTR #399 的 Linux race 专项 CI 已成功。关键证据
分支与真实执行版本
refs/heads/4.2-dev为efbab93eb361eabddf1fb5c012e93bec094660c1。隔离源码快照、编译二进制、测试开始及结束时的官方分支 SHA 一致。4.2-dev 修复 #33493 merge commit39f0aa3de69cc2c50460fc9a564bfbdc2ae29a45已包含于该版本。另有 main 修复 fix(tae): cancel snapshot writes when a table-tail flush fails #33494;本条完整专项结果针对原 Issue 的 4.2-dev,不把它冒充为本轮最新 main 运行。flushObjTask、ops.NewOpWorker和 FileService,使用测试专用 Go 文件扩展故障夹具;没有修改产品实现。Linux CI checkout 同一完整 MO SHA 并运行相同专项。原始故障与对照
context.DeadlineExceeded。调用生产清理路径abortSnapshotWrites后再提交第二个 flush,并逐轮断言第二个任务成功,不能只看第一任务返回错误。白盒及回归 CI
TestAbortSnapshotWrites与TestSnapshotWriteStartDuringAbort均以-race -count=20运行,合计 40/40 根用例通过;TAE 引擎的TestFlushTableErrorHandle、TestFlushTableErrorHandle2、TestFlushTableTailRetiresQueuedSnapshotOnPanic以-race -count=3运行,9/9 通过。测试文件执行后已从源码快照移除,产品代码未改动。efbab93eb361eabddf1fb5c012e93bec094660c1。对应 Linux 专项 run 46595063346snapshot-flush-cancel-drain-42SUCCESS;PR 的 Python offline 和 Go contract 作业也均 SUCCESS。此前合并的 MOTR 4.2 汇总 PR Fix bug of merge empty batch #353 已结束,(aoe): changes to ops and events #399 是此项现存的 4.2 回归 PR;没有往 matrixone 主库新提测试 PR。待解决点
本轮证明的是修复后父任务超时的取消/排干/worker 恢复合同,不追溯生产最初为何出现超过 23 分钟的存储 PUT,也不宣称生产 checkpoint lag/OOM 已完全消失;若这些现象持续,应按实际对象存储和资源证据另行跟踪。本 Issue 的原始可控故障和反例已完成验收,无阻塞关闭的未测项。
最终结论:测试通过。已通过:最新 4.2-dev 的原始单 worker 超时/存储延迟、S3 与内存取消、忽略取消后的排干、健康对照、后续 flush 180/180、原生 race 49/49,以及 MOTR 4.2-dev Linux 专项 CI。未通过项:无。未完成项:无影响本 Issue 关闭的验收项;生产初始存储慢因不在本次修复范围。