-
Notifications
You must be signed in to change notification settings - Fork 499
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
add binlog deploy and check process #329
add binlog deploy and check process #329
Conversation
defer func() { | ||
glog.Infof("deploy incremental backup end cluster[%s] namespace[%s]", to.ClusterName, to.Namespace) | ||
}() | ||
sets := map[string]string{ |
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.
merge these with from
sets
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.
done!
tests/actions.go
Outdated
cmd := fmt.Sprintf("helm install /charts/%s/tidb-cluster --name %s --namespace %s --set-string %s", | ||
info.OperatorTag, info.ClusterName, info.Namespace, info.HelmSetString()) | ||
info.OperatorTag, info.ClusterName, info.Namespace, info.HelmSetString(map[string]string{})) |
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.
map[string]string{} -> nil
tests/actions.go
Outdated
@@ -414,7 +428,7 @@ func chartPath(name string, tag string) string { | |||
|
|||
func (oa *operatorActions) ScaleTidbCluster(info *TidbClusterInfo) error { | |||
cmd := fmt.Sprintf("helm upgrade %s %s --set-string %s", | |||
info.ClusterName, chartPath("tidb-cluster", info.OperatorTag), info.HelmSetString()) | |||
info.ClusterName, chartPath("tidb-cluster", info.OperatorTag), info.HelmSetString(map[string]string{})) |
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.
ditto
tests/actions.go
Outdated
@@ -425,7 +439,7 @@ func (oa *operatorActions) ScaleTidbCluster(info *TidbClusterInfo) error { | |||
|
|||
func (oa *operatorActions) UpgradeTidbCluster(info *TidbClusterInfo) error { | |||
cmd := fmt.Sprintf("helm upgrade %s %s --set-string %s", | |||
info.ClusterName, chartPath("tidb-cluster", info.OperatorTag), info.HelmSetString()) | |||
info.ClusterName, chartPath("tidb-cluster", info.OperatorTag), info.HelmSetString(map[string]string{})) |
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.
ditto
tests/actions.go
Outdated
return nil, err | ||
} | ||
|
||
if err != nil { |
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.
unreachable
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.
It seems you are right
@@ -1458,13 +1448,19 @@ func (oa *operatorActions) getBackupDir(info *TidbClusterInfo) ([]string, error) | |||
} | |||
|
|||
cmd := fmt.Sprintf("kubectl exec %s -n %s ls /data", getBackupDirPodName, info.Namespace) | |||
glog.Infof(cmd) | |||
|
|||
time.Sleep(20 * time.Second) |
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.
Can we poll the following condition so we can proceed on earlier if condition meet?
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.
I try to poll at first but the time is hard to controller in one minute. for every minute generate a cronjob to backup. At last we have to check the backup number.
tests/actions.go
Outdated
initSecretName := "set-secret" | ||
backupSecretName := "backup-secret" | ||
func (oa *operatorActions) CreateSecret(info *TidbClusterInfo) (string, string, error) { | ||
initSecretName := fmt.Sprintf("%s-set-secret", info.ClusterName) |
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.
the field should be set when info
created
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.
done
1 add binlog deployment
2 add binlog check
3 change the main process
@weekface @xiaojingchen @zyguan @cwen0 PTAL