Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

语法错误等级做成用户可配置 #2460

Open
iwanghc opened this issue Jun 19, 2024 · 0 comments
Open

语法错误等级做成用户可配置 #2460

iwanghc opened this issue Jun 19, 2024 · 0 comments
Assignees
Labels
not_compatible not compatible old version suggestion
Milestone

Comments

@iwanghc
Copy link
Collaborator

iwanghc commented Jun 19, 2024

版本信息(Version)

SQLE:main 3f884f0
DMS:main e1bd3f7

问题描述(Describe)

语法错误的提示默认是warn级别,当创建工单的最高触发规则级别设置为error时,在有语法错误时也能创建工单。这会导致在上线阶段报错时才发现有语法错误, 主要解决不能灵活配置错误等级问题

截图或日志(Log)

image

如何复现(To Reproduce)

创建工单的最高触发规则级别设置为error,有语法错误时也能创建工单

实现方案

现状:
审核预检查是否无法解析sql,触发后结果写死为(Warn, "", "语法错误或者解析器不支持,请人工确认SQL正确性")
并且没有rule_name,由于扩展插件对于无法解析sql处理的不确定性,导致无法统一处理或配置该结果的告警级别。
解决方案:
将“语法错误或者解析器不支持”作为一条全局配置的规则,并新增规则配置,记录是否开启语法错误检查和语法错误检查规则等级。预检查语法错误中判断改规则启用状态,并处理结果。
该规则所属于全局配置、告警级别默认为error

变更影响面

受影响的模块或功能

  1. 该规则不启用时,当出现无法解析的sql结果为 审核通过 ,影响后续上线审核对于sql审核结果的判断。
  2. 调整单元测试,解析器不支持的sql预期结果修改
  3. 用户需保证default模板里该条规则的启用,否则影响静态审核对于错误或不支持sql的识别判断
  4. Mysql系插件受影响,需更新vendor
  • goldendb
  • mycat
  • ob for mysql
  • polardb for mysql
  • td mysql
  • tidb

外部引用的潜在问题或风险

版本兼容性

首次导入mysql规则后时,该规则默认开启,当数据库中已存在mysql默认规则模板时,需要手动开启或使用upgrade-tooles进行升级开启改规则。

测试建议

@iwanghc iwanghc added the bug Something isn't working label Jun 19, 2024
@iwanghc iwanghc added this to the v3.2406.0 milestone Jun 19, 2024
@iwanghc iwanghc added feature and removed bug Something isn't working labels Jun 19, 2024
@iwanghc iwanghc changed the title 语法错误的提示无法调整错误等级 语法错误等级做成用户可配置 Jun 19, 2024
@ColdWaterLW ColdWaterLW assigned iwanghc and unassigned ColdWaterLW Jun 24, 2024
@iwanghc iwanghc mentioned this issue Jun 24, 2024
5 tasks
@ColdWaterLW ColdWaterLW added the not_compatible not compatible old version label Jun 25, 2024
@ColdWaterLW ColdWaterLW modified the milestones: v3.2406.0, v3.2407.0 Jun 26, 2024
@ColdWaterLW ColdWaterLW modified the milestones: v3.2407.0, v3.2408.0 Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not_compatible not compatible old version suggestion
Projects
None yet
Development

No branches or pull requests

2 participants