Skip to content

test(sql): cover truncate lifecycle waits and cancellation - #29827

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
aptend:fix/truncate-lifecycle-wait-29814
Oct 12, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
aptend:fix/truncate-lifecycle-wait-29814

Conversation

@aptend

@aptend aptend commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #29814; the production fix is already included in #29837.

What this PR does / why we need it:

Add regression coverage for TRUNCATE lifecycle admission. The implementation on main already lets fresh owners wait, retains FastFail for existing-owner upgrades, and uses scalar admission where eligible.

  • Exercise indexed-table TRUNCATE through broad admission, checking exclusive lock mode, release/cancellation results, retained-owner FastFail, and removal of wait bookkeeping on every exit.
  • Add a public SQL BVT that holds the SNAPSHOT gate, requires an ordinary-table TRUNCATE to wait for release, then checks both target data and an unrelated database.

Validation after rebasing onto main (035a5b61ba):

  • Full pkg/sql/compile tests passed.
  • TestTruncateLifecycleRCWaitPolicy passed 100 repetitions under race.
  • The CI-failing TestIssue29400CopyAlterRetainedGatePromotionFastFails passed normally, under race, and with atomic coverage instrumentation of pkg/sql/compile and pkg/tests/issues.
  • New BVT passed twice (17/17 each) on a binary built from the rebased commit.
  • Incremental gofmt, go vet, configured golangci-lint, and diff checks passed.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@aptend
aptend force-pushed the fix/truncate-lifecycle-wait-29814 branch from 484e3d5 to cbc8010 Compare October 12, 2026 02:36
@aptend aptend changed the title fix(sql): wait for fresh truncate lifecycle admission test(sql): cover truncate lifecycle waits and cancellation Oct 12, 2026
@mergify mergify Bot added the kind/test-ci label Oct 12, 2026
@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: cbc8010e5c1a1e2ea8115f2d0dc1f240cb45cbc0

Assessment: approve

完整审查三个文件的测试增量及相关生产调用链,未发现需修改的问题。测试覆盖具体 TRUNCATE 入口的等待、取消、保留所有者 FastFail、等待记录清理,以及真实 SQL 执行后的数据结果;与现有 admission 设计一致。

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

Validation:

  • 审查全部 +157 行:Go 测试 109 行、SQL 23 行、预期结果 25 行;无生产代码或文档修改,源码工作区保持干净。

  • 确认索引表触发 broad admission;核对通道同步、context 传播、worker 退出、资源释放及三个错误结果断言。BVT 使用现有 @wait 协调,检查目标表、无关数据库和清理操作。

  • 复用当前 HEAD 的成功构建、Ubuntu/x86 UT、Linux/arm64 SCA、覆盖率及 PROXY/PESSIMISTIC 多 CN BVT 记录。

  • 冻结作者报告提供完整 compile 包测试、新 UT race 100 次、相关集成测试及新 BVT 两次各 17/17 的通过记录。本次未重复运行 native 测试。

  • 冻结证据无待闭环的人工评论;详细审查记录已保存至 review-evidence.json。

Limitations:

  • 未提供关联 issue [Bug]: Concurrent TRUNCATE on unrelated databases fast-fails on global SNAPSHOT gate #29814 全文;需求核对依据冻结 PR 描述、仓库设计文档及现有实现。

  • 冻结证据未包含原始逐测试日志;运行结果分别归因于 CI 状态和作者报告,并非本地复跑。

  • 新 UT 在 gate 释放后返回测试哨兵错误,验证 admission 边界;成功完成 TRUNCATE 的证明来自 BVT 和现有集成测试。

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: cbc8010e5c1a1e2ea8115f2d0dc1f240cb45cbc0

Assessment: approve

完整审查三个文件的测试增量及相关生产调用链,未发现需修改的问题。测试覆盖具体 TRUNCATE 入口的等待、取消、保留所有者 FastFail、等待记录清理,以及真实 SQL 执行后的数据结果;与现有 admission 设计一致。

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

Validation:

  • 审查全部 +157 行:Go 测试 109 行、SQL 23 行、预期结果 25 行;无生产代码或文档修改,源码工作区保持干净。

  • 确认索引表触发 broad admission;核对通道同步、context 传播、worker 退出、资源释放及三个错误结果断言。BVT 使用现有 @wait 协调,检查目标表、无关数据库和清理操作。

  • 复用当前 HEAD 的成功构建、Ubuntu/x86 UT、Linux/arm64 SCA、覆盖率及 PROXY/PESSIMISTIC 多 CN BVT 记录。

  • 冻结作者报告提供完整 compile 包测试、新 UT race 100 次、相关集成测试及新 BVT 两次各 17/17 的通过记录。本次未重复运行 native 测试。

  • 冻结证据无待闭环的人工评论;详细审查记录已保存至 review-evidence.json。

Limitations:

  • 未提供关联 issue #29814 全文;需求核对依据冻结 PR 描述、仓库设计文档及现有实现。

  • 冻结证据未包含原始逐测试日志;运行结果分别归因于 CI 状态和作者报告,并非本地复跑。

  • 新 UT 在 gate 释放后返回测试哨兵错误,验证 admission 边界;成功完成 TRUNCATE 的证明来自 BVT 和现有集成测试。

@mergify mergify Bot added the queued label Oct 12, 2026
@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-12 04:01 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-12 04:20 UTC · at 73010dbab1dbba7ff7a722bba54defbef818dd31

This pull request spent 19 minutes 1 second in the queue, with no time running CI.

Reason

Pull request #29827 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch had an error being deployed

1 failed deployment
ci — 73010dba Deployed Oct 12, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants