@@ -294,7 +294,7 @@ func (tm *TabletManager) StartReplication(ctx context.Context, semiSync bool) er
294
294
}
295
295
}()
296
296
297
- if err := tm .fixSemiSync (tm .Tablet ().Type , convertBoolToSemiSyncAction (semiSync )); err != nil {
297
+ if err := tm .fixSemiSync (tm .Tablet ().Type , tm . convertBoolToSemiSyncAction (semiSync )); err != nil {
298
298
return err
299
299
}
300
300
return tm .MysqlDaemon .StartReplication (tm .hookExtraEnv ())
@@ -380,13 +380,13 @@ func (tm *TabletManager) InitPrimary(ctx context.Context, semiSync bool) (string
380
380
// Set the server read-write, from now on we can accept real
381
381
// client writes. Note that if semi-sync replication is enabled,
382
382
// we'll still need some replicas to be able to commit transactions.
383
- if err := tm .changeTypeLocked (ctx , topodatapb .TabletType_PRIMARY , DBActionSetReadWrite , convertBoolToSemiSyncAction (semiSync )); err != nil {
383
+ if err := tm .changeTypeLocked (ctx , topodatapb .TabletType_PRIMARY , DBActionSetReadWrite , tm . convertBoolToSemiSyncAction (semiSync )); err != nil {
384
384
return "" , err
385
385
}
386
386
387
387
// Enforce semi-sync after changing the tablet)type to PRIMARY. Otherwise, the
388
388
// primary will hang while trying to create the database.
389
- if err := tm .fixSemiSync (topodatapb .TabletType_PRIMARY , convertBoolToSemiSyncAction (semiSync )); err != nil {
389
+ if err := tm .fixSemiSync (topodatapb .TabletType_PRIMARY , tm . convertBoolToSemiSyncAction (semiSync )); err != nil {
390
390
return "" , err
391
391
}
392
392
@@ -427,7 +427,7 @@ func (tm *TabletManager) InitReplica(ctx context.Context, parent *topodatapb.Tab
427
427
// is used on the old primary when using InitShardPrimary with
428
428
// -force, and the new primary is different from the old primary.
429
429
if tm .Tablet ().Type == topodatapb .TabletType_PRIMARY {
430
- if err := tm .changeTypeLocked (ctx , topodatapb .TabletType_REPLICA , DBActionNone , convertBoolToSemiSyncAction (semiSync )); err != nil {
430
+ if err := tm .changeTypeLocked (ctx , topodatapb .TabletType_REPLICA , DBActionNone , tm . convertBoolToSemiSyncAction (semiSync )); err != nil {
431
431
return err
432
432
}
433
433
}
@@ -450,7 +450,7 @@ func (tm *TabletManager) InitReplica(ctx context.Context, parent *topodatapb.Tab
450
450
if tt == topodatapb .TabletType_PRIMARY {
451
451
tt = topodatapb .TabletType_REPLICA
452
452
}
453
- if err := tm .fixSemiSync (tt , convertBoolToSemiSyncAction (semiSync )); err != nil {
453
+ if err := tm .fixSemiSync (tt , tm . convertBoolToSemiSyncAction (semiSync )); err != nil {
454
454
return err
455
455
}
456
456
@@ -602,7 +602,7 @@ func (tm *TabletManager) UndoDemotePrimary(ctx context.Context, semiSync bool) e
602
602
defer tm .unlock ()
603
603
604
604
// If using semi-sync, we need to enable source-side.
605
- if err := tm .fixSemiSync (topodatapb .TabletType_PRIMARY , convertBoolToSemiSyncAction (semiSync )); err != nil {
605
+ if err := tm .fixSemiSync (topodatapb .TabletType_PRIMARY , tm . convertBoolToSemiSyncAction (semiSync )); err != nil {
606
606
return err
607
607
}
608
608
@@ -672,7 +672,7 @@ func (tm *TabletManager) SetReplicationSource(ctx context.Context, parentAlias *
672
672
673
673
// setReplicationSourceLocked also fixes the semi-sync. In case the tablet type is primary it assumes that it will become a replica if SetReplicationSource
674
674
// is called, so we always call fixSemiSync with a non-primary tablet type. This will always set the source side replication to false.
675
- return tm .setReplicationSourceLocked (ctx , parentAlias , timeCreatedNS , waitPosition , forceStartReplication , convertBoolToSemiSyncAction (semiSync ))
675
+ return tm .setReplicationSourceLocked (ctx , parentAlias , timeCreatedNS , waitPosition , forceStartReplication , tm . convertBoolToSemiSyncAction (semiSync ))
676
676
}
677
677
678
678
func (tm * TabletManager ) setReplicationSourceRepairReplication (ctx context.Context , parentAlias * topodatapb.TabletAlias , timeCreatedNS int64 , waitPosition string , forceStartReplication bool ) (err error ) {
@@ -965,7 +965,7 @@ func (tm *TabletManager) PromoteReplica(ctx context.Context, semiSync bool) (str
965
965
}
966
966
967
967
// If using semi-sync, we need to enable it before going read-write.
968
- if err := tm .fixSemiSync (topodatapb .TabletType_PRIMARY , convertBoolToSemiSyncAction (semiSync )); err != nil {
968
+ if err := tm .fixSemiSync (topodatapb .TabletType_PRIMARY , tm . convertBoolToSemiSyncAction (semiSync )); err != nil {
969
969
return "" , err
970
970
}
971
971
0 commit comments