Skip to content

Commit 2037b0c

Browse files
committed
Remove old bootstrap logic checker
1 parent cf6aae4 commit 2037b0c

File tree

3 files changed

+0
-23
lines changed

3 files changed

+0
-23
lines changed

pkg/sidecar/appclone.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ import (
2828
func RunCloneCommand(cfg *Config) error {
2929
log.Info("cloning command", "host", cfg.Hostname)
3030

31-
// skip cloning if data exists.
32-
if !shouldBootstrapNode() {
33-
log.Info("data exists and is initialized, skipping cloning.")
34-
return nil
35-
}
36-
3731
if checkIfDataExists() {
3832
log.Info("data already exists! Remove manually PVC to cleanup or to reinitialize.")
3933
return nil

pkg/sidecar/constants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ var (
5252

5353
// ToolsDbName is the name of the tools table
5454
toolsDbName = constants.OperatorDbName
55-
// ToolsInitTableName is the name of the init table
56-
toolsInitTableName = "init"
5755

5856
// toolsHeartbeatTableName is the name used for pt-heartbeat table
5957
toolsHeartbeatTableName = "heartbeat"

pkg/sidecar/util.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,6 @@ func copyFile(src, dst string) error {
6060
return nil
6161
}
6262

63-
// shouldBootstrapNode checks if the mysql data is at the first initialization
64-
func shouldBootstrapNode() bool {
65-
_, err := os.Open(fmt.Sprintf("%s/%s/%s.CSV", dataDir,
66-
toolsDbName, toolsInitTableName))
67-
if os.IsNotExist(err) {
68-
return true
69-
} else if err != nil {
70-
log.Error(err, "first init check failed hard")
71-
return true
72-
}
73-
74-
// maybe check csv init data and log it
75-
return false
76-
}
77-
7863
// readPurgedGTID returns the GTID from xtrabackup_binlog_info file
7964
func readPurgedGTID() (string, error) {
8065
file, err := os.Open(fmt.Sprintf("%s/xtrabackup_binlog_info", dataDir))

0 commit comments

Comments
 (0)