Skip to content

Commit 3546b11

Browse files
committed
Initiate throttler for move-tables, disable replication lag throttling for move-tables mode
1 parent be0ec09 commit 3546b11

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

go/logic/migrator.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,17 +1809,13 @@ func (mgtr *Migrator) addDMLEventsListener() error {
18091809

18101810
// initiateThrottler kicks in the throttling collection and the throttling checks.
18111811
func (mgtr *Migrator) initiateThrottler() {
1812-
if mgtr.migrationContext.IsMoveTablesMode() {
1813-
// TODO(chriskirkland): throttle against the target cluster
1814-
mgtr.migrationContext.Log.Info("Skipping throttling in move tables mode")
1815-
return
1816-
}
1817-
18181812
mgtr.throttler = NewThrottler(mgtr.migrationContext, mgtr.applier, mgtr.inspector, mgtr.appVersion)
18191813

18201814
go mgtr.throttler.initiateThrottlerCollection(mgtr.firstThrottlingCollected)
18211815
mgtr.migrationContext.Log.Infof("Waiting for first throttle metrics to be collected")
1822-
<-mgtr.firstThrottlingCollected // replication lag
1816+
if !mgtr.migrationContext.IsMoveTablesMode() {
1817+
<-mgtr.firstThrottlingCollected // replication lag
1818+
}
18231819
<-mgtr.firstThrottlingCollected // HTTP status
18241820
<-mgtr.firstThrottlingCollected // other, general metrics
18251821
mgtr.migrationContext.Log.Infof("First throttle metrics collected")

go/logic/throttler.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,9 @@ func (thlr *Throttler) collectGeneralThrottleMetrics() error {
455455
// that may affect throttling. There are several components, all running independently,
456456
// that collect such metrics.
457457
func (thlr *Throttler) initiateThrottlerCollection(firstThrottlingCollected chan<- bool) {
458-
go thlr.collectReplicationLag(firstThrottlingCollected)
458+
if !thlr.migrationContext.IsMoveTablesMode() {
459+
go thlr.collectReplicationLag(firstThrottlingCollected)
460+
}
459461
go thlr.collectControlReplicasLag()
460462
go thlr.collectThrottleHTTPStatus(firstThrottlingCollected)
461463

0 commit comments

Comments
 (0)