Skip to content

Commit

Permalink
Avoid logging MySQL connection configs (#1501)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
meiji163 and github-advanced-security[bot] authored Feb 28, 2025
1 parent d8672f7 commit 7ea3047
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/logic/migrator.go
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ import (

var (
ErrMigratorUnsupportedRenameAlter = errors.New("ALTER statement seems to RENAME the table. This is not supported, and you should run your RENAME outside gh-ost.")
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.")
RetrySleepFn = time.Sleep
)

@@ -809,7 +810,7 @@ func (this *Migrator) initiateInspector() (err error) {
this.migrationContext.AddThrottleControlReplicaKey(this.migrationContext.InspectorConnectionConfig.Key)
}
} 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)
return ErrMigrationNotAllowedOnMaster
}
if err := this.inspector.validateLogSlaveUpdates(); err != nil {
return err

0 comments on commit 7ea3047

Please sign in to comment.