Skip to content

Commit

Permalink
feat(#6506): Can change betaIps multiple times in beta(or gray). (#8235)
Browse files Browse the repository at this point in the history
  • Loading branch information
CherishCai authored May 6, 2022
1 parent 7bfa134 commit 5d7f9dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public static void updateMd5(String groupKey, String md5, long lastModifiedTs) {
*/
public static void updateBetaMd5(String groupKey, String md5, List<String> ips4Beta, long lastModifiedTs) {
CacheItem cache = makeSure(groupKey);
if (cache.md54Beta == null || !cache.md54Beta.equals(md5)) {
if (cache.md54Beta == null || !cache.md54Beta.equals(md5) || !ips4Beta.equals(cache.ips4Beta)) {
cache.isBeta = true;
cache.md54Beta = md5;
cache.lastModifiedTs4Beta = lastModifiedTs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ public void updateConfigInfo4Beta(ConfigInfo configInfo, String betaIps, String
try {
String md5 = MD5Utils.md5Hex(configInfo.getContent(), Constants.ENCODE);

final String sql = "UPDATE config_info_beta SET content=?,md5=?,src_ip=?,src_user=?,gmt_modified=?,app_name=? WHERE data_id=? AND group_id=? AND tenant_id=?";
final String sql = "UPDATE config_info_beta SET content=?,md5=?,beta_ips=?,src_ip=?,src_user=?,gmt_modified=?,app_name=? WHERE data_id=? AND group_id=? AND tenant_id=?";

final Object[] args = new Object[] {configInfo.getContent(), md5, srcIp, srcUser, time, appNameTmp,
final Object[] args = new Object[] {configInfo.getContent(), md5, betaIps, srcIp, srcUser, time, appNameTmp,
configInfo.getDataId(), configInfo.getGroup(), tenantTmp};

EmbeddedStorageContextUtils.onModifyConfigBetaInfo(configInfo, betaIps, srcIp, time);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ public void updateConfigInfo4Beta(ConfigInfo configInfo, String betaIps, String
String md5 = MD5Utils.md5Hex(configInfo.getContent(), Constants.ENCODE);
try {
jt.update(
"UPDATE config_info_beta SET content=?, md5 = ?, src_ip=?,src_user=?,gmt_modified=?,app_name=? WHERE "
+ "data_id=? AND group_id=? AND tenant_id=?", configInfo.getContent(), md5, srcIp, srcUser,
"UPDATE config_info_beta SET content=?, md5=?, beta_ips=?, src_ip=?,src_user=?,gmt_modified=?,app_name=? "
+ " WHERE data_id=? AND group_id=? AND tenant_id=?", configInfo.getContent(), md5, betaIps, srcIp, srcUser,
time, appNameTmp, configInfo.getDataId(), configInfo.getGroup(), tenantTmp);
} catch (CannotGetJdbcConnectionException e) {
LogUtil.FATAL_LOG.error("[db-error] " + e.toString(), e);
Expand Down

0 comments on commit 5d7f9dd

Please sign in to comment.