Skip to content

Commit 7ea3047

Browse files
Avoid logging MySQL connection configs (#1501)
* Fix clear-text logging of connection config Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * don't log connection configs --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent d8672f7 commit 7ea3047

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: go/logic/migrator.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
var (
2626
ErrMigratorUnsupportedRenameAlter = errors.New("ALTER statement seems to RENAME the table. This is not supported, and you should run your RENAME outside gh-ost.")
27+
ErrMigrationNotAllowedOnMaster = errors.New("It seems like this migration attempt to run directly on master. Preferably it would be executed on a replica (this reduces load from the master). To proceed please provide --allow-on-master.")
2728
RetrySleepFn = time.Sleep
2829
)
2930

@@ -809,7 +810,7 @@ func (this *Migrator) initiateInspector() (err error) {
809810
this.migrationContext.AddThrottleControlReplicaKey(this.migrationContext.InspectorConnectionConfig.Key)
810811
}
811812
} else if this.migrationContext.InspectorIsAlsoApplier() && !this.migrationContext.AllowedRunningOnMaster {
812-
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)
813+
return ErrMigrationNotAllowedOnMaster
813814
}
814815
if err := this.inspector.validateLogSlaveUpdates(); err != nil {
815816
return err

0 commit comments

Comments
 (0)