printMigrationStatusHint prints a detailed configuration dump, that is useful to keep in mind; such as the name of migrated table, throttle params etc. This gets printed at beginning and end of migration, every 10 minutes throughout migration, and as response to the "status" interactive command.
(writers ...io.Writer)
| 1192 | // This gets printed at beginning and end of migration, every 10 minutes throughout |
| 1193 | // migration, and as response to the "status" interactive command. |
| 1194 | func (mgtr *Migrator) printMigrationStatusHint(writers ...io.Writer) { |
| 1195 | w := io.MultiWriter(writers...) |
| 1196 | fmt.Fprintf(w, "# Migrating %s.%s; Ghost table is %s.%s\n", |
| 1197 | sql.EscapeName(mgtr.migrationContext.DatabaseName), |
| 1198 | sql.EscapeName(mgtr.migrationContext.OriginalTableName), |
| 1199 | sql.EscapeName(mgtr.migrationContext.DatabaseName), |
| 1200 | sql.EscapeName(mgtr.migrationContext.GetGhostTableName()), |
| 1201 | ) |
| 1202 | fmt.Fprintf(w, "# Migrating %+v; inspecting %+v; executing on %+v\n", |
| 1203 | *mgtr.applier.connectionConfig.ImpliedKey, |
| 1204 | *mgtr.inspector.connectionConfig.ImpliedKey, |
| 1205 | mgtr.migrationContext.Hostname, |
| 1206 | ) |
| 1207 | fmt.Fprintf(w, "# Migration started at %+v\n", |
| 1208 | mgtr.migrationContext.StartTime.Format(time.RubyDate), |
| 1209 | ) |
| 1210 | maxLoad := mgtr.migrationContext.GetMaxLoad() |
| 1211 | criticalLoad := mgtr.migrationContext.GetCriticalLoad() |
| 1212 | fmt.Fprintf(w, "# chunk-size: %+v; max-lag-millis: %+vms; dml-batch-size: %+v; max-load: %s; critical-load: %s; nice-ratio: %f\n", |
| 1213 | atomic.LoadInt64(&mgtr.migrationContext.ChunkSize), |
| 1214 | atomic.LoadInt64(&mgtr.migrationContext.MaxLagMillisecondsThrottleThreshold), |
| 1215 | atomic.LoadInt64(&mgtr.migrationContext.DMLBatchSize), |
| 1216 | maxLoad.String(), |
| 1217 | criticalLoad.String(), |
| 1218 | mgtr.migrationContext.GetNiceRatio(), |
| 1219 | ) |
| 1220 | if mgtr.migrationContext.ThrottleFlagFile != "" { |
| 1221 | setIndicator := "" |
| 1222 | if base.FileExists(mgtr.migrationContext.ThrottleFlagFile) { |
| 1223 | setIndicator = "[set]" |
| 1224 | } |
| 1225 | fmt.Fprintf(w, "# throttle-flag-file: %+v %+v\n", |
| 1226 | mgtr.migrationContext.ThrottleFlagFile, setIndicator, |
| 1227 | ) |
| 1228 | } |
| 1229 | if mgtr.migrationContext.ThrottleAdditionalFlagFile != "" { |
| 1230 | setIndicator := "" |
| 1231 | if base.FileExists(mgtr.migrationContext.ThrottleAdditionalFlagFile) { |
| 1232 | setIndicator = "[set]" |
| 1233 | } |
| 1234 | fmt.Fprintf(w, "# throttle-additional-flag-file: %+v %+v\n", |
| 1235 | mgtr.migrationContext.ThrottleAdditionalFlagFile, setIndicator, |
| 1236 | ) |
| 1237 | } |
| 1238 | if throttleQuery := mgtr.migrationContext.GetThrottleQuery(); throttleQuery != "" { |
| 1239 | fmt.Fprintf(w, "# throttle-query: %+v\n", |
| 1240 | throttleQuery, |
| 1241 | ) |
| 1242 | } |
| 1243 | if throttleControlReplicaKeys := mgtr.migrationContext.GetThrottleControlReplicaKeys(); throttleControlReplicaKeys.Len() > 0 { |
| 1244 | fmt.Fprintf(w, "# throttle-control-replicas count: %+v\n", |
| 1245 | throttleControlReplicaKeys.Len(), |
| 1246 | ) |
| 1247 | } |
| 1248 | |
| 1249 | if mgtr.migrationContext.PostponeCutOverFlagFile != "" { |
| 1250 | setIndicator := "" |
| 1251 | if base.FileExists(mgtr.migrationContext.PostponeCutOverFlagFile) { |
no test coverage detected