-
Notifications
You must be signed in to change notification settings - Fork 0
<fix>[conf]: <description #4647
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
base: zsv_4.0.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,4 +28,14 @@ CREATE TABLE IF NOT EXISTS `zstack`.`L2NetworkHostRefVO` ( | |||||||||||||||||||||||||||||||||||||||
| UNIQUE KEY `ukL2NetworkHost` (`l2NetworkUuid`,`hostUuid`) USING BTREE | ||||||||||||||||||||||||||||||||||||||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ALTER TABLE `zstack`.`L2NetworkClusterRefVO` ADD COLUMN `l2ProviderType` varchar(32) default NULL; | ||||||||||||||||||||||||||||||||||||||||
| ALTER TABLE `zstack`.`L2NetworkClusterRefVO` ADD COLUMN `l2ProviderType` varchar(32) default NULL; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| CREATE TABLE IF NOT EXISTS `zstack`.`SchedulerJobGroupZoneRefVO` ( | ||||||||||||||||||||||||||||||||||||||||
| `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, | ||||||||||||||||||||||||||||||||||||||||
| `schedulerJobGroupUuid` varchar(32) NOT NULL COMMENT 'uuid of schedulerJobGroupUuid', | ||||||||||||||||||||||||||||||||||||||||
| `zoneUuid` varchar(32) NOT NULL COMMENT 'uuid of zone', | ||||||||||||||||||||||||||||||||||||||||
| `lastOpDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, | ||||||||||||||||||||||||||||||||||||||||
| `createDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', | ||||||||||||||||||||||||||||||||||||||||
| CONSTRAINT `fkSchedulerJobGroupZoneRefVOSchedulerJobGroupVO` FOREIGN KEY (`schedulerJobGroupUuid`) REFERENCES SchedulerJobGroupVO (`uuid`) ON DELETE CASCADE, | ||||||||||||||||||||||||||||||||||||||||
| PRIMARY KEY (`id`) | ||||||||||||||||||||||||||||||||||||||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+33
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 缺少 (schedulerJobGroupUuid, zoneUuid) 唯一约束,可能导致重复挂载记录。 表中未对 🔧 建议修复 CONSTRAINT `fkSchedulerJobGroupZoneRefVOSchedulerJobGroupVO` FOREIGN KEY (`schedulerJobGroupUuid`) REFERENCES SchedulerJobGroupVO (`uuid`) ON DELETE CASCADE,
+ UNIQUE KEY `uk_schedulerJobGroup_zone` (`schedulerJobGroupUuid`, `zoneUuid`),
PRIMARY KEY (`id`)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -422,4 +422,4 @@ DELIMITER ; | |||||
| CALL UpdateHygonClusterVmCpuModeConfig(); | ||||||
| DROP PROCEDURE IF EXISTS UpdateHygonClusterVmCpuModeConfig; | ||||||
|
|
||||||
| UPDATE GlobalConfigVO set `value` = 'InfoSec' where `value` = 'infoSec' and category ='encrypt' and name = 'encrypt.driver'; | ||||||
| UPDATE GlobalConfigVO set `value` = 'InfoSec' where `value` = 'infoSec' and category ='encrypt' and name = 'encrypt.driver'; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 为升级脚本限定固定的 当前 SQL 未限定表所属 schema;当升级连接未设置默认数据库,或默认数据库不是 Based on learnings: 建议修改-UPDATE GlobalConfigVO set `value` = 'InfoSec' where `value` = 'infoSec' and category ='encrypt' and name = 'encrypt.driver';
+UPDATE zstack.`GlobalConfigVO` set `value` = 'InfoSec' where `value` = 'infoSec' and category ='encrypt' and name = 'encrypt.driver';📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Learnings |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| package org.zstack.sdk; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import org.zstack.sdk.*; | ||
|
|
||
| public class AttachSchedulerJobGroupToZoneAction extends AbstractAction { | ||
|
|
||
| private static final HashMap<String, Parameter> parameterMap = new HashMap<>(); | ||
|
|
||
| private static final HashMap<String, Parameter> nonAPIParameterMap = new HashMap<>(); | ||
|
|
||
| public static class Result { | ||
| public ErrorCode error; | ||
| public org.zstack.sdk.AttachSchedulerJobGroupToZoneResult value; | ||
|
|
||
| public Result throwExceptionIfError() { | ||
| if (error != null) { | ||
| throw new ApiException( | ||
| String.format("error[code: %s, description: %s, details: %s]", error.code, error.description, error.details) | ||
| ); | ||
| } | ||
|
|
||
| return this; | ||
| } | ||
| } | ||
|
|
||
| @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) | ||
| public java.lang.String schedulerJobGroupUuid; | ||
|
|
||
| @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) | ||
| public java.lang.String zoneUuid; | ||
|
|
||
| @Param(required = false) | ||
| public java.util.List systemTags; | ||
|
|
||
| @Param(required = false) | ||
| public java.util.List userTags; | ||
|
|
||
| @Param(required = false) | ||
| public String sessionId; | ||
|
|
||
| @Param(required = false) | ||
| public String accessKeyId; | ||
|
|
||
| @Param(required = false) | ||
| public String accessKeySecret; | ||
|
|
||
| @Param(required = false) | ||
| public String requestIp; | ||
|
|
||
| @NonAPIParam | ||
| public long timeout = -1; | ||
|
|
||
| @NonAPIParam | ||
| public long pollingInterval = -1; | ||
|
|
||
|
|
||
| private Result makeResult(ApiResult res) { | ||
| Result ret = new Result(); | ||
| if (res.error != null) { | ||
| ret.error = res.error; | ||
| return ret; | ||
| } | ||
|
|
||
| org.zstack.sdk.AttachSchedulerJobGroupToZoneResult value = res.getResult(org.zstack.sdk.AttachSchedulerJobGroupToZoneResult.class); | ||
| ret.value = value == null ? new org.zstack.sdk.AttachSchedulerJobGroupToZoneResult() : value; | ||
|
|
||
| return ret; | ||
| } | ||
|
|
||
| public Result call() { | ||
| ApiResult res = ZSClient.call(this); | ||
| return makeResult(res); | ||
| } | ||
|
|
||
| public void call(final Completion<Result> completion) { | ||
| ZSClient.call(this, new InternalCompletion() { | ||
| @Override | ||
| public void complete(ApiResult res) { | ||
| completion.complete(makeResult(res)); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| protected Map<String, Parameter> getParameterMap() { | ||
| return parameterMap; | ||
| } | ||
|
|
||
| protected Map<String, Parameter> getNonAPIParameterMap() { | ||
| return nonAPIParameterMap; | ||
| } | ||
|
|
||
| protected RestInfo getRestInfo() { | ||
| RestInfo info = new RestInfo(); | ||
| info.httpMethod = "POST"; | ||
| info.path = "/scheduler/zone/{zoneUuid}/scheduler-job-group/{schedulerJobGroupUuid}"; | ||
| info.needSession = true; | ||
| info.needPoll = true; | ||
| info.parameterName = "params"; | ||
| return info; | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package org.zstack.sdk; | ||
|
|
||
| import org.zstack.sdk.SchedulerJobGroupInventory; | ||
|
|
||
| public class AttachSchedulerJobGroupToZoneResult { | ||
| public SchedulerJobGroupInventory inventory; | ||
| public void setInventory(SchedulerJobGroupInventory inventory) { | ||
| this.inventory = inventory; | ||
| } | ||
| public SchedulerJobGroupInventory getInventory() { | ||
| return this.inventory; | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| package org.zstack.sdk; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import org.zstack.sdk.*; | ||
|
|
||
| public class DetachSchedulerJobGroupFromZoneAction extends AbstractAction { | ||
|
|
||
| private static final HashMap<String, Parameter> parameterMap = new HashMap<>(); | ||
|
|
||
| private static final HashMap<String, Parameter> nonAPIParameterMap = new HashMap<>(); | ||
|
|
||
| public static class Result { | ||
| public ErrorCode error; | ||
| public org.zstack.sdk.DetachSchedulerJobGroupFromZoneResult value; | ||
|
|
||
| public Result throwExceptionIfError() { | ||
| if (error != null) { | ||
| throw new ApiException( | ||
| String.format("error[code: %s, description: %s, details: %s]", error.code, error.description, error.details) | ||
| ); | ||
| } | ||
|
|
||
| return this; | ||
| } | ||
| } | ||
|
|
||
| @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) | ||
| public java.lang.String schedulerJobGroupUuid; | ||
|
|
||
| @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) | ||
| public java.lang.String zoneUuid; | ||
|
|
||
| @Param(required = false) | ||
| public java.util.List systemTags; | ||
|
|
||
| @Param(required = false) | ||
| public java.util.List userTags; | ||
|
|
||
| @Param(required = false) | ||
| public String sessionId; | ||
|
|
||
| @Param(required = false) | ||
| public String accessKeyId; | ||
|
|
||
| @Param(required = false) | ||
| public String accessKeySecret; | ||
|
|
||
| @Param(required = false) | ||
| public String requestIp; | ||
|
|
||
| @NonAPIParam | ||
| public long timeout = -1; | ||
|
|
||
| @NonAPIParam | ||
| public long pollingInterval = -1; | ||
|
|
||
|
|
||
| private Result makeResult(ApiResult res) { | ||
| Result ret = new Result(); | ||
| if (res.error != null) { | ||
| ret.error = res.error; | ||
| return ret; | ||
| } | ||
|
|
||
| org.zstack.sdk.DetachSchedulerJobGroupFromZoneResult value = res.getResult(org.zstack.sdk.DetachSchedulerJobGroupFromZoneResult.class); | ||
| ret.value = value == null ? new org.zstack.sdk.DetachSchedulerJobGroupFromZoneResult() : value; | ||
|
|
||
| return ret; | ||
| } | ||
|
|
||
| public Result call() { | ||
| ApiResult res = ZSClient.call(this); | ||
| return makeResult(res); | ||
| } | ||
|
|
||
| public void call(final Completion<Result> completion) { | ||
| ZSClient.call(this, new InternalCompletion() { | ||
| @Override | ||
| public void complete(ApiResult res) { | ||
| completion.complete(makeResult(res)); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| protected Map<String, Parameter> getParameterMap() { | ||
| return parameterMap; | ||
| } | ||
|
|
||
| protected Map<String, Parameter> getNonAPIParameterMap() { | ||
| return nonAPIParameterMap; | ||
| } | ||
|
|
||
| protected RestInfo getRestInfo() { | ||
| RestInfo info = new RestInfo(); | ||
| info.httpMethod = "DELETE"; | ||
| info.path = "/scheduler/zone/{zoneUuid}/scheduler-job-group/{schedulerJobGroupUuid}"; | ||
| info.needSession = true; | ||
| info.needPoll = true; | ||
| info.parameterName = ""; | ||
| return info; | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package org.zstack.sdk; | ||
|
|
||
| import org.zstack.sdk.SchedulerJobGroupInventory; | ||
|
|
||
| public class DetachSchedulerJobGroupFromZoneResult { | ||
| public SchedulerJobGroupInventory inventory; | ||
| public void setInventory(SchedulerJobGroupInventory inventory) { | ||
| this.inventory = inventory; | ||
| } | ||
| public SchedulerJobGroupInventory getInventory() { | ||
| return this.inventory; | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
时间戳默认值使用了非法的零值日期。
lastOpDate和createDate都使用了DEFAULT '0000-00-00 00:00:00'。路径规范要求禁止使用该零值默认值,改用DEFAULT CURRENT_TIMESTAMP;但由于lastOpDate已设置ON UPDATE CURRENT_TIMESTAMP,若两列同时使用CURRENT_TIMESTAMP将在 MySQL 5.7(explicit_defaults_for_timestamp=OFF)环境下触发 Error 1293。建议让lastOpDate使用DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,而createDate改用非CURRENT_TIMESTAMP的合法哨兵值(如'2000-01-01 00:00:00')代替零值日期,避免在启用NO_ZERO_DATE的 SQL 模式下建表失败。🔧 建议修复
Based on learnings and path instructions: "Do not use
DEFAULT 0000-00-00 00:00:00, useDEFAULT CURRENT_TIMESTAMPinstead" 以及 "any second TIMESTAMP column (e.g., createDate) must NOT use DEFAULT CURRENT_TIMESTAMP ... Use a non-CURRENT_TIMESTAMP sentinel default such as '2000-01-01 00:00:00'".📝 Committable suggestion
🤖 Prompt for AI Agents
Sources: Path instructions, Learnings