Skip to content

fix: slow log watermark readback and non-blocking TaskWrapper stop - #3373

Closed
LordofAvernus wants to merge 2 commits into
mainfrom
sqle/fix-3160
Closed

LordofAvernus wants to merge 2 commits into
mainfrom
sqle/fix-3160

Conversation

@LordofAvernus

@LordofAvernus LordofAvernus commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

User description

关联的 issue

https://github.com/actiontech/sqle-ee/issues/3160

描述你的变更

  • 水位读回 COALESCE 兼容 DATETIME(6) 与历史 RFC3339,避免新水位形态拖垮采集
  • TaskWrapper.Stop 改为 sync.Once + close(cancel),避免停用时卡在 ExtractSQL 死锁
  • EE 分页终止与单测见配套 PR:https://github.com/actiontech/sqle-ee/pull/3161

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc

Made with Cursor


Description

  • 更新水位查询SQL支持多种日期格式

  • 修改TaskWrapper停止逻辑避免死锁


Diagram Walkthrough

flowchart LR
  A["修改水位查询SQL"] -- "兼容DATETIME(6)与RFC3339" --> B["更新SQL解析逻辑"]
  C["修改TaskWrapper停止逻辑"] -- "使用sync.Once非阻塞关闭" --> D["防止ExtractSQL死锁"]
Loading

File Walkthrough

Relevant files
Bug fix
instance_audit_plan.go
更新水位查询SQL解析逻辑                                                                                       

sqle/model/instance_audit_plan.go

  • 添加COALESCE支持多格式解析
  • 尝试DATETIME(6)、RFC3339和秒级格式
+7/-2     
task_wrap.go
改进TaskWrapper停止逻辑                                                                               

sqle/server/auditplan/task_wrap.go

  • 引入sync.Once确保关闭通道只执行一次
  • 修改停止逻辑防止ExtractSQL死锁
+6/-1     

LordofAvernus and others added 2 commits September 24, 2026 16:45
GetLatestStartTimeAuditPlanSQLV2 COALESCE parses space DATETIME(6),
RFC3339 with T, and second-precision DATETIME so historical rows keep working.

Co-authored-by: Cursor <cursoragent@cursor.com>
Stop previously sent on an unbuffered cancel channel and could deadlock
while ExtractSQL was mid-page; use sync.Once + close instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant