Skip to content

Commit 123b46f

Browse files
Split into 'applier' and 'inspector' commands
1 parent cffb523 commit 123b46f

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

doc/interactive-commands.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Both interfaces may serve at the same time. Both respond to simple text command,
1818
- `status`: returns a detailed status summary of migration progress and configuration
1919
- `sup`: returns a brief status summary of migration progress
2020
- `coordinates`: returns recent (though not exactly up to date) binary log coordinates of the inspected server
21+
- `applier`: returns the hostname of the applier
22+
- `inspector`: returns the hostname of the inspector
2123
- `chunk-size=<newsize>`: modify the `chunk-size`; applies on next running copy-iteration
2224
- `dml-batch-size=<newsize>`: modify the `dml-batch-size`; applies on next applying of binary log events
2325
- `max-lag-millis=<max-lag>`: modify the maximum replication lag threshold (milliseconds, minimum value is `100`, i.e. `0.1` second)

go/logic/server.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ func (this *Server) applyServerCommand(command string, writer *bufio.Writer) (pr
147147
status # Print a detailed status message
148148
sup # Print a short status message
149149
coordinates # Print the currently inspected coordinates
150-
hosts # Print the list of hosts used to perform the migration (hostname, applier and inspector)
150+
applier # Print the hostname of the applier
151+
inspector # Print the hostname of the inspector
151152
chunk-size=<newsize> # Set a new chunk-size
152153
dml-batch-size=<newsize> # Set a new dml-batch-size
153154
nice-ratio=<ratio> # Set a new nice-ratio, immediate sleep after each row-copy operation, float (examples: 0 is aggressive, 0.7 adds 70% runtime, 1.0 doubles runtime, 2.0 triples runtime, ...)
@@ -178,12 +179,11 @@ help # This message
178179
}
179180
return NoPrintStatusRule, fmt.Errorf("coordinates are read-only")
180181
}
181-
case "hosts":
182-
fmt.Fprintf(writer, "Hostname: %s, Applier: %s, Inspector: %s\n",
183-
this.migrationContext.Hostname,
184-
this.migrationContext.GetApplierHostname(),
185-
this.migrationContext.GetInspectorHostname(),
186-
)
182+
case "applier":
183+
fmt.Fprintln(writer, this.migrationContext.GetApplierHostname())
184+
return NoPrintStatusRule, nil
185+
case "inspector":
186+
fmt.Fprintln(writer, this.migrationContext.GetInspectorHostname())
187187
return NoPrintStatusRule, nil
188188
case "chunk-size":
189189
{

0 commit comments

Comments
 (0)