In Percona Operator for MySQL (not PXC), Is it possible to check and run only if the member is Secondary replica? Say we have 0S, 1S and 2P. Backup must run only on the replica 1.
@midson Are you talking about Percona Operator for MySQL based on Percona Server for MySQL ?
Looking over the source code of the same by default it checks for the Secondary node wile doing backups. If no secondary node available only then the Primary node will be consider.
var source string
if len(top.replicas) < 1 {
source = top.primary
**log.Info("no replicas found, using primary as the backup source", "primary", top.primary)**
} else {
source = top.replicas[0]
}
return source, nil
}
I am afraid no way to force it.
Thanks @anil.joshi
This option should be fine. But let me check the code on, if multiple secondaries exist, how this logic works.