Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/sidecar/appconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ func initFileQuery(cfg *Config, gtidPurged string) []byte {
[]string{"CREATE", "SELECT", "DELETE", "UPDATE", "INSERT"}, fmt.Sprintf("%s.%s", toolsDbName, toolsHeartbeatTableName),
[]string{"REPLICATION CLIENT"}, "*.*")...)

// the slave pod doesn't need to back up sys_operator.status, Xtrabackup might have some bugs that
// cause the table to be unclean. We can do this cleanup before the slave pod starts to avoid accidents.
if !cfg.IsFirstPodInSet() {
queries = append(queries, fmt.Sprintf("DROP TABLE IF EXISTS %s.%s",
constants.OperatorDbName, constants.OperatorStatusTableName))
}

// create the status table used by the operator to configure or to mask MySQL node ready
// CSV engine for this table can't be used because we use REPLACE statement that requires PRIMARY KEY or
// UNIQUE KEY index. Also, the table may exists (in case of pod restart) and should not be changed.
Expand Down