Skip to content

Commit 7ead4c4

Browse files
author
Shlomi Noach
committed
named throttle, no-throttle
1 parent ff17d2f commit 7ead4c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

go/logic/server.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,22 @@ help # This message
292292
}
293293
case "throttle", "pause", "suspend":
294294
{
295+
if arg != "" && arg != this.migrationContext.OriginalTableName {
296+
// User explicitly provided table name. This is a courtesy protection mechanism
297+
err := fmt.Errorf("User commanded 'throttle' on %s, but migrated table is %s; ignoring request.", arg, this.migrationContext.OriginalTableName)
298+
return NoPrintStatusRule, err
299+
}
295300
atomic.StoreInt64(&this.migrationContext.ThrottleCommandedByUser, 1)
296301
fmt.Fprintf(writer, throttleHint)
297302
return ForcePrintStatusAndHintRule, nil
298303
}
299304
case "no-throttle", "unthrottle", "resume", "continue":
300305
{
306+
if arg != "" && arg != this.migrationContext.OriginalTableName {
307+
// User explicitly provided table name. This is a courtesy protection mechanism
308+
err := fmt.Errorf("User commanded 'no-throttle' on %s, but migrated table is %s; ignoring request.", arg, this.migrationContext.OriginalTableName)
309+
return NoPrintStatusRule, err
310+
}
301311
atomic.StoreInt64(&this.migrationContext.ThrottleCommandedByUser, 0)
302312
return ForcePrintStatusAndHintRule, nil
303313
}

0 commit comments

Comments
 (0)