Merge pull request #23 from openark/switch-to-rbr-only-on-replica

Only allow -switch-to-rbr when inspecting replica
This commit is contained in:
Shlomi Noach 2021-06-29 08:52:52 +03:00 committed by GitHub
commit 28f7f19e08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -796,6 +796,9 @@ func (this *Migrator) initiateInspector() (err error) {
} else if this.migrationContext.InspectorIsAlsoApplier() && !this.migrationContext.AllowedRunningOnMaster {
return fmt.Errorf("It seems like this migration attempt to run directly on master. Preferably it would be executed on a replica (and this reduces load from the master). To proceed please provide --allow-on-master. Inspector config=%+v, applier config=%+v", this.migrationContext.InspectorConnectionConfig, this.migrationContext.ApplierConnectionConfig)
}
if this.migrationContext.InspectorIsAlsoApplier() && this.migrationContext.SwitchToRowBinlogFormat {
return fmt.Errorf("--switch-to-rbr is only allowed when inspecting a replica. This migration seems to run on the primary %+v", *this.migrationContext.ApplierConnectionConfig.ImpliedKey)
}
if err := this.inspector.validateLogSlaveUpdates(); err != nil {
return err
}