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

fix: 3.7.x 版本 job_execute MySQL 执行变更SQL失败 #2069

Closed
wangyu096 opened this issue May 19, 2023 · 1 comment
Closed

fix: 3.7.x 版本 job_execute MySQL 执行变更SQL失败 #2069

wangyu096 opened this issue May 19, 2023 · 1 comment
Assignees
Labels
done 已上线到正式环境并验收通过 kind/bug 程序故障Bug,漏洞

Comments

@wangyu096
Copy link
Collaborator

Version / Branch / tag

3.7.x

出了什么问题?(What Happened?)

USE job_execute;

SET NAMES utf8mb4;

DROP PROCEDURE IF EXISTS job_schema_update;

DELIMITER <JOB_UBF>

CREATE PROCEDURE job_schema_update()
BEGIN
  SET AUTOCOMMIT = 0;

  ALTER TABLE gse_script_agent_task MODIFY `agent_id` varchar(64); 
  ALTER TABLE gse_file_agent_task MODIFY `agent_id` varchar(64);

  COMMIT;
END <JOB_UBF>
DELIMITER ;
COMMIT;

CALL job_schema_update();

DROP PROCEDURE IF EXISTS job_schema_update;

由于gse_script_agent_task/gse_file_agent_task 数据太多,执行ALTER 操作会导致锁表并且执行会失败

如何复现?(How to reproduce?)
在数据量大的环境必现

预期结果(What you expect?)

@wangyu096 wangyu096 added kind/bug 程序故障Bug,漏洞 backlog 需求初始状态,等待产品进行评估 labels May 19, 2023
@wangyu096 wangyu096 self-assigned this May 19, 2023
@wangyu096 wangyu096 changed the title fix: job_execute MySQL 执行变更SQL失败 fix: 3.7.x 版本 job_execute MySQL 执行变更SQL失败 May 19, 2023
@wangyu096
Copy link
Collaborator Author

  1. 在应用层面处理空值,使用空字符串替代DB 中的NULL 含义
  2. 删除DB 变更SQL

wangyu096 added a commit that referenced this issue May 19, 2023
fix: 3.7.x 版本 job_execute MySQL 执行变更SQL失败 #2069
@bkjob-bot bkjob-bot added done 已上线到正式环境并验收通过 and removed backlog 需求初始状态,等待产品进行评估 labels May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done 已上线到正式环境并验收通过 kind/bug 程序故障Bug,漏洞
Projects
None yet
Development

No branches or pull requests

2 participants