@@ -654,6 +654,8 @@ func (this *Migrator) onServerCommand(command string, writer *bufio.Writer) (err
654
654
arg = strings .TrimSpace (tokens [1 ])
655
655
}
656
656
657
+ throttleHint := "# Note: you may only throttle for as long as your binary logs are not purged\n "
658
+
657
659
switch command {
658
660
case "help" :
659
661
{
@@ -730,6 +732,7 @@ help # This message
730
732
case "throttle-query" :
731
733
{
732
734
this .migrationContext .SetThrottleQuery (arg )
735
+ fmt .Fprintf (writer , throttleHint )
733
736
this .printStatus (ForcePrintStatusAndHint , writer )
734
737
}
735
738
case "throttle-control-replicas" :
@@ -744,6 +747,8 @@ help # This message
744
747
case "throttle" , "pause" , "suspend" :
745
748
{
746
749
atomic .StoreInt64 (& this .migrationContext .ThrottleCommandedByUser , 1 )
750
+ fmt .Fprintf (writer , throttleHint )
751
+ this .printStatus (ForcePrintStatusAndHint , writer )
747
752
}
748
753
case "no-throttle" , "unthrottle" , "resume" , "continue" :
749
754
{
@@ -874,13 +879,21 @@ func (this *Migrator) printMigrationStatusHint(writers ...io.Writer) {
874
879
))
875
880
}
876
881
if this .migrationContext .ThrottleFlagFile != "" {
877
- fmt .Fprintln (w , fmt .Sprintf ("# Throttle flag file: %+v" ,
878
- this .migrationContext .ThrottleFlagFile ,
882
+ setIndicator := ""
883
+ if base .FileExists (this .migrationContext .ThrottleFlagFile ) {
884
+ setIndicator = "[set]"
885
+ }
886
+ fmt .Fprintln (w , fmt .Sprintf ("# Throttle flag file: %+v %+v" ,
887
+ this .migrationContext .ThrottleFlagFile , setIndicator ,
879
888
))
880
889
}
881
890
if this .migrationContext .ThrottleAdditionalFlagFile != "" {
882
- fmt .Fprintln (w , fmt .Sprintf ("# Throttle additional flag file: %+v" ,
883
- this .migrationContext .ThrottleAdditionalFlagFile ,
891
+ setIndicator := ""
892
+ if base .FileExists (this .migrationContext .ThrottleAdditionalFlagFile ) {
893
+ setIndicator = "[set]"
894
+ }
895
+ fmt .Fprintln (w , fmt .Sprintf ("# Throttle additional flag file: %+v %+v" ,
896
+ this .migrationContext .ThrottleAdditionalFlagFile , setIndicator ,
884
897
))
885
898
}
886
899
if throttleQuery := this .migrationContext .GetThrottleQuery (); throttleQuery != "" {
@@ -889,8 +902,12 @@ func (this *Migrator) printMigrationStatusHint(writers ...io.Writer) {
889
902
))
890
903
}
891
904
if this .migrationContext .PostponeCutOverFlagFile != "" {
892
- fmt .Fprintln (w , fmt .Sprintf ("# Postpone cut-over flag file: %+v" ,
893
- this .migrationContext .PostponeCutOverFlagFile ,
905
+ setIndicator := ""
906
+ if base .FileExists (this .migrationContext .PostponeCutOverFlagFile ) {
907
+ setIndicator = "[set]"
908
+ }
909
+ fmt .Fprintln (w , fmt .Sprintf ("# Postpone cut-over flag file: %+v %+v" ,
910
+ this .migrationContext .PostponeCutOverFlagFile , setIndicator ,
894
911
))
895
912
}
896
913
if this .migrationContext .PanicFlagFile != "" {
0 commit comments