Skip to content

Commit

Permalink
fix(redis): 修复dts分片变更bug #8670
Browse files Browse the repository at this point in the history
  • Loading branch information
OMG-By authored and iSecloud committed Dec 23, 2024
1 parent 5e15b3d commit 3167cd2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ func (job *RedisDtsOnlineSwitch) NewProxyConfigFileForSameType() (err error) {
dstConfContent = strings.ReplaceAll(dstConfContent, logRootDir+"/", consts.GetRedisDataDir()+"/")
}
}
// 避免跟密码字段有重复,放在最后面替换集群名
dstConfContent = strings.ReplaceAll(dstConfContent, job.params.DstClusterName, job.params.SrcClusterName)

newFile := fmt.Sprintf("dts_new_config.billid_%d.%s_%d.%s", job.params.DtsBillID, job.params.SrcProxyIP,
job.params.SrcProxyPort, job.getSrcConfigFileSuffix())
Expand Down Expand Up @@ -392,6 +394,10 @@ func (job *RedisDtsOnlineSwitch) NewProxyConfigFileForSameType() (err error) {
if err != nil {
return
}

// 修改目录归属
util.LocalDirChownMysql(job.getSrcProxyConfigSaveDir())

return nil
}

Expand All @@ -418,6 +424,8 @@ func (job *RedisDtsOnlineSwitch) NewProxyConfigFileForDiffType() (err error) {
dstConfContent = strings.ReplaceAll(dstConfContent, logRootDir+"/", consts.GetRedisDataDir()+"/")
}
}
// 避免跟密码字段有重复,放在最后面替换集群名
dstConfContent = strings.ReplaceAll(dstConfContent, job.params.DstClusterName, job.params.SrcClusterName)

proxyFileForDstPort := job.getProxyFile(job.params.DstClusterType, job.params.DstProxyPort)
proxyFileForDstPort = filepath.Join(saveDirForDstPort, proxyFileForDstPort)
Expand Down

0 comments on commit 3167cd2

Please sign in to comment.