Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues. Parent issue [Bug]: CN can panic on clean restart when view metadata admission misses startup deadline #27945 exposed the shutdown wait chain; this issue tracks the distinct accepted-WAL-entry terminal invariant.
Branch Name
main
Commit ID
c46d897e9645b80178568ef0783dd8e99e527222
Other Environment Information
- Hardware parameters: mo-55 bare-metal validation host; resource thresholds remained above 12 GiB MemAvailable and 100 GiB root free space.
- OS type: Linux amd64.
- Deployment: single-process standalone containing TN and LogService.
- Workload: retained 2,303,643-row FULLTEXT2 runtime with two accepted TN commits waiting for WAL completion during
SIGTERM. - Parent lifecycle issue: [Bug]: CN can panic on clean restart when view metadata admission misses startup deadline #27945.
- Implementation PR: fix(tae): complete WAL waiters before append fail-stop #28014.
Actual Behavior
An accepted TAE WAL entry normally waits for groupCommitter and the commit wait loop to publish its terminal state. Several failure paths can bypass that publication:
- serialization or pre-callback failure;
- LogService client acquisition failure;
- worker submission failure;
- LogService append failure before the normal success wait loop;
- close racing with pending committers.
In those paths, an accepted entry can remain blocked in WaitDone(). The driver close path can also consume separate worker and waiter timeout windows and then enter an additional unbounded committer.Wait(). During standalone shutdown this can keep TN alive while LogService is also being closed, producing a circular lifecycle wait.
Completing waiters from multiple cleanup paths is not safe either: without one explicit completion owner, reset/close/error handling can notify an entry twice or advance committed DSN for a failed committer.
Expected Behavior
Every WAL entry accepted into a groupCommitter must receive exactly one terminal result:
success
or
explicit error before fail-stop escalation
groupCommitter must be the sole completion owner. The first terminal publication must clear its owned-entry list so wait-loop, reset, and close paths cannot notify twice. Successful committers must preserve existing ordered notification and committed-DSN semantics; failed committers must not advance the committed watermark.
Driver close must use one shared bounded deadline for stopping intake, draining accepted workers, and completing waiter notification. On timeout it must return an error without entering another unbounded wait or closing clients/pools still in use. Append failure must retain the existing fail-stop and unknown-commit semantics after accepted waiters receive their error terminal.
Steps to Reproduce
- Create a LogService-backed TAE WAL driver and submit one or more entries accepted into a group committer.
- Inject one of the pre-append or append failures listed above, or race worker submission with driver close.
- Wait on each accepted entry with
WaitDone(). - Observe that a failure before the normal commit wait loop can leave the waiter without a terminal result, or that close can enter a second/unbounded wait after its earlier timeout budget.
- In a standalone process, trigger graceful shutdown while TN commits are blocked on those entries and observe the TN-to-LogService dependency wait.
Regression tests should cover single- and multi-entry success, every failure terminal, failed-DSN suppression, worker-submission/close races, repeated reset/close, and an injectable short shared deadline.
Additional information
- Scope: TAE LogService WAL waiter completion and close deadline only.
- Non-goals: no SQL, DDL, public API, WAL format, transaction wire protocol, persisted format, fail-stop policy, or unknown-commit contract change.
- Independence: PR fix(tae): complete WAL waiters before append fail-stop #28014 is independent of PRs fix(service): shut down standalone services in dependency order #28015 and fix(txn): quiesce and drain TN RPC handlers before storage close #28016 and can be reviewed separately.
- BVT: N/A. SQL BVT cannot deterministically inject serialization, client acquisition, worker submission, or LogService append failures and assert waiter completion before fail-stop. Production commit/wait-loop package and race tests are the equivalent deterministic terminal coverage.
- QA required: yes. Lifecycle integration should include this exact head in the A+B+C validation branch before final issue closure.
Activity
fix(tae): complete WAL waiters before append fail-stop (#28014)
Ariznawlll commentedon Sep 7, 2026
测试版本
mainbcd5ed833b5400fe95f322e4028adb2bde3de0a4原问题验证
针对 WAL waiter 的 client acquisition、commit submission、append failure、close deadline、append failure 和 writer 生命周期执行定向测试,连续 3 轮通过,验证了 waiter 终态和关闭路径的单元行为。未在 LogService-backed TAE 驱动中执行完整 A+B+C integration lifecycle,因此不能确认所有真实服务边界已覆盖。
Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
已执行
pkg/vm/engine/tae/logstore/driver/logservicedriver定向 Go 测试;由于 issue 要求的故障点属于内部注入,仍缺运行时集成证据。回归测试
修复 PR #28014 已合并;本轮未把 UT-only 结果加入 MOTR,待 LogService 集成验收完成后再补充对应生命周期场景。
测试证据
测试结论
测试不通过。
VioletQwQ-0 commentedon Sep 9, 2026
转 QA:开发侧证据交接(非正式 QA PASS)
验证绑定合入版本
92a6bceba1ee156b87dc340479aa1cd44fe56a3d。OUTCOME_UNKNOWN:3/3 原子 all-present,0 partial/duplicate/checksum mismatch;D1/D2/U2 使用测试专用 overlay,标记
INSTRUMENTED_RUNTIME_VERIFIED;U1 使用原版 binary。历史 TKE job 仍为FAILED,实际 checkout 为b5cdcacaba3ec5f47eff723d8a45287f5750344f,原拓扑NOT_REVERIFIED,不冒充原 job 通过。证据包:
/home/sunyuze/lifecycle-closeout-v2-e295-20260908-01/qa-closeout-20260909/real-wal-boundary-20260909-final/;manifest SHA256:b874e69507bebf2c4da96317bba4d8542236c43d4cf786471210585130052ee8。请 QA 绑定 exact 版本和环境复核 waiter exactly-once、unknown-commit 和权限 BVT 分类;本评论表示开发证据已提交,不表示正式 QA PASS。issue 保持 OPEN。
5 remaining items
test(logservice): cover WAL failure ordering (matrixorigin#28721)
fix(tae): complete WAL waiters before append fail-stop (matrixorigin#…
test(logservice): cover WAL failure ordering (matrixorigin#28721)
fix(tae): complete WAL waiters before append fail-stop (matrixorigin#…
test(logservice): cover WAL failure ordering (matrixorigin#28721)
test(embed): cover accepted commit during standalone shutdown (#28730)
test(embed): renew SQL deadline after restart admission (#29398)
gouhongshen commentedon Oct 9, 2026
CI reproduction for #28013:
5d21f2e6b1c3996d8ec1d715220e73b35adf6d72; basee914d987641c266162eb607ec072fdb5a2b06da9.TestIssue28012And28013AcceptedCommitDuringStandaloneShutdownfailed after 149.77s withissue 28012/28013 goroutines did not exit within 30sandbad connection; the coverage job reported this package event and did not produce a complete profile.pkg/common/mpoolownership accounting and its tests. It does not modify TAE WAL, LogService, TN shutdown, RPC handlers, or this isolated shutdown test. The same failing invariant is this open issue.Ariznawlll commentedon Nov 6, 2026
测试版本
MatrixOne 官方 main
65b721e1b93c6b9e05db2063b220e0c35916b335,包含生命周期测试 #28730(9213310151);本机 macOS/arm64。使用该版本 Go 源码、本机已有 CGo 静态依赖构建定向测试,非原生产镜像。原问题验证
对
pkg/vm/engine/tae/logstore/driver/logservicedriver的 6 个定向测试分别运行普通及-race,每种模式各重复 3 次:普通 18/18、race 18/18 顶层测试通过。Happy Path 覆盖
TestCommitSubmissionWaitsForWorkerHandoff与TestSubmitCommitWaitsAfterCommitterCompletion覆盖工作线程交接和 committer 完成顺序;每项普通和 race 各 3 次通过。Unhappy Path 覆盖
TestClientAcquisitionFailureCompletesWaiterBeforePanic、TestPreCallbackFailureCompletesAllGroupWaitersBeforeFailStop、TestAppendFailureCompletesWaiterBeforeFailStop分别覆盖客户端获取、前置回调及 append 失败的等待者终态;TestCloseDeadlineIncludesIntakeAndWorkerDrain覆盖关闭预算跨 intake 与 worker drain 的处理。各项普通和 race 各 3 次通过。白盒验证
核对对应测试以可控客户端/队列注入失败、等待与释放信号,检查 waiter 完成和关闭行为;该测试层不等价于真实进程关停与持久化重启,也未声称涵盖所有错误路径。
回归测试
本轮使用 main 中已有定向 Go 回归,未向 MatrixOne 主库提交测试 PR。#28730 的嵌入式
TestIssue28012And28013AcceptedCommitDuringStandaloneShutdown已在 main 中;本轮尝试执行 3 次,但构建时可用磁盘降至约 2.6 GiB,主动终止并清理本次专属构建缓存,集成测试没有运行结果。此前 issue 中记载的 CI 失败也未在本轮复现或排除。测试证据
test28013.log、test28013-race.log分别包含 6 个顶层测试各 3 次 PASS,包结果均成功;test28013-integration.log仅有被中断的构建记录。测试结论
定向错误终态、关闭时限和 race 场景通过;嵌入式接受提交后关停/重启、持久化原子性及当前 CI 情况尚未完成本轮验收,保持 Open。
Ariznawlll commentedon Nov 23, 2026
结论
补充验收取得进展,暂不关闭。
main@c8805c3e2613bcb53f279035fdf2e2337c86a68e的隔离嵌入式关停、重启与事务原子性测试,以及指定故障分支的 race 测试均通过;尚未重现原始 230 万行 FULLTEXT2 规模场景,也未证明分布式环境和历史 CI 失败已经消除。关键证据
TestIssue28012And28013AcceptedCommitDuringStandaloneShutdown -count=3返回成功,3 次通过;同一集成测试追加-race -count=3亦 3/3 通过。测试把已接受提交停在指定故障点,启动实际嵌入式服务关闭,放行后重启,并检查多行事务全有或全无与重启后能继续执行事务。-race -count=3下全部通过,覆盖 worker 交接及完成顺序、client 获取失败、pre-callback 失败、append 失败时 waiter 终态,以及 intake 与 worker drain 共用关闭时限。上述结论限定于测试注入的故障,不推定全部故障或真实集群拓扑已覆盖。待解决点
仍需原始 FULLTEXT2 大数据负载及目标部署场景的专项验收,并确认历史 CI 故障在相应 Linux 环境下的状态。当前保持开放,不转交研发。
fix(tae): complete WAL waiters before append fail-stop (matrixorigin#…
fix(tae): complete WAL waiters before append fail-stop (matrixorigin#…
[4.2-dev] fix(tae): complete WAL waiters before append fail-stop (#33209
XuPeng-SH commentedon Nov 27, 2026
QA 补充:#33209 已回移到
4.2-dev@12ff8a923158baa6ae8768aa4bdb0a9c81d79209。除了原等待者恰好一次完成、失败不记 DSN,还带入有界关停及旧 TN 写者隔离,和已有 main 验收分开记录。作者报告最后一轮定向 race 和较早候选的发布版数据回放通过;本轮没有独立复测 4.2-dev 合并版、原 FULLTEXT2 负载或实际多节点 TN/LogService。保留现有 QA 负责人和未关状态;发布线请核对真实关停与重启、失败通知顺序、提交结果和旧写者不覆盖新租约。Ariznawlll commentedon Dec 1, 2026
结论
未完成验收,保持开放。 本轮补齐了 Linux 上 2,303,643 行合成 FULLTEXT2 数据的 main 关停/重启测试,以及最新受测 4.2-dev WAL driver 的完整 race 套件;两部分均通过。但 main 的提交屏障位于
WaitWalAndTail之后,不能冒充原现场“两个提交正在等待 WAL”的精确条件,也不是真实进程 SIGTERM 或多节点故障验收。关键证据
main:230 万行 FULLTEXT2 + 接受提交期间关停
ec945a6323d4e505a8445bfd129f02a70073c301,Linux amd64,官方 main 源码加临时测试 overlay;产品实现未改动。这里是 Go 编译的嵌入式集成服务,不把它写成生产 mo-service 二进制的git_version()验证。TestIssue28012And28013AcceptedCommitDuringStandaloneShutdown的实际 cluster、事务、drain 与重启流程,增加全量 FULLTEXT2 fixture,沿用实际 session/transaction ID 选择故障目标,避免同租户异步事务误占屏障。id=1..2303643,body=concat('waltest ready item ',id);真实创建FULLTEXT2索引。步骤:
MATCH(body) AGAINST('waltest')返回完整 2,303,643 行。(1,10),(2,20),(3,30);获取真实事务 ID,将其接受提交停在已有FJ_CommitWait屏障。cluster.Stop();验证存在 active handler 时不能越过 TN drain,也不能提前完成整体关停。cluster.Start(),核对三行事务全有或全无;成功 COMMIT 必须全部持久化,未知结果不能部分可见。结果:
每轮重启前、后均出现完整内容与 MATCH 校验通过标记。不是只看启动成功或只检查 COUNT。两个资源档位均为本轮自有实例,未使用 129。
4.2-dev:WAL 完成、关闭时限、旧写者隔离
6afdb0cbb9161ad5f4424016697ed850baef2b88,包含回移 [4.2-dev] fix(tae): complete WAL waiters before append fail-stop #33209;与 main 结果分别记录。pkg/vm/engine/tae/logstore/driver/logservicedriver:go test -race -count=3 -p=1 -timeout=30m \ ./pkg/vm/engine/tae/logstore/driver/logservicedriver第一组 12 GiB cgroup 下,40 个根测试 ×3 =120 PASS,0 FAIL;已有 TestReplay2 ×3 SKIP,包退出 0,总测试时间 48.446 秒。按 CI 的 6 GiB /2 CPU 限制再完整执行,仍 120 PASS、3 SKIP、0 FAIL,48.068 秒。跳过项没有计为通过。
关键覆盖包括:client 获取失败先完成 waiter、worker handoff、committer 提前完成后的提交顺序、intake/worker/truncate 共用关闭时限、append 失败前通知 waiter、写入编码失败恰好一次完成、超时旧写者不能覆盖替代 WAL,以及 lease 拒绝/不确定租约不盲重试。回放、编码、DSN 等其余包内回归也实际执行。此处是组件 fault/race 证据,不当作真实多节点过程。
MOTR 回归
739b5cf,独立 workflowqa-28013-fulltext-scale.yml,三轮执行,产生日志 artifact。补充 CI:MOTR main #404 的
739b5cf1a2971c7daed36d04ff634753c37cf697上,2303643 行 FULLTEXT2 三轮生命周期测试 已成功;MOTR 4.2-dev #399 的be87ed5029f084c23949789e3aa2e0ac8f9812b8上,MinIO 与完整 WAL driver race 三轮 也已成功。两者是本文限定的子项通过,原双 WAL-pending/SIGTERM 场景仍未完成,不据此关闭。待解决点
WaitWalAndTail后,不能证明实际 LogService append 尚未完成时的两个 waiter 与 SIGTERM 全生命周期。最终结论:未完成验收。已通过 main 两档资源下共六轮 230 万行合成 FULLTEXT2/接受提交关停/重启,以及 4.2-dev 两档资源下各 120 次 WAL race;未完成项为原两个 WAL-pending 提交、实际 SIGTERM/目标多节点故障条件及新增 CI 收尾。保持开放,不转研发,不发布整体修复通过结论。