Skip to content

Commit

Permalink
VTOrc optimize TMC usage (#15356)
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Apr 19, 2024
1 parent e60fbd7 commit 8ca5f00
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 78 deletions.
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtbackup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Flags:
--stderrthreshold severityFlag logs at or above this threshold go to stderr (default 1)
--tablet_manager_grpc_ca string the server ca to use to validate servers when connecting
--tablet_manager_grpc_cert string the cert to use to connect
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App} and CheckThrottler) (default 8)
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8)
--tablet_manager_grpc_connpool_size int number of tablets to keep tmclient connections open to (default 100)
--tablet_manager_grpc_crl string the server crl to use to validate server certificates when connecting
--tablet_manager_grpc_key string the key to use to connect
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtcombo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ Flags:
--tablet_hostname string if not empty, this hostname will be assumed instead of trying to resolve it
--tablet_manager_grpc_ca string the server ca to use to validate servers when connecting
--tablet_manager_grpc_cert string the cert to use to connect
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App} and CheckThrottler) (default 8)
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8)
--tablet_manager_grpc_connpool_size int number of tablets to keep tmclient connections open to (default 100)
--tablet_manager_grpc_crl string the server crl to use to validate server certificates when connecting
--tablet_manager_grpc_key string the key to use to connect
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtctld.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Flags:
--tablet_health_keep_alive duration close streaming tablet health connection if there are no requests for this long (default 5m0s)
--tablet_manager_grpc_ca string the server ca to use to validate servers when connecting
--tablet_manager_grpc_cert string the cert to use to connect
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App} and CheckThrottler) (default 8)
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8)
--tablet_manager_grpc_connpool_size int number of tablets to keep tmclient connections open to (default 100)
--tablet_manager_grpc_crl string the server crl to use to validate server certificates when connecting
--tablet_manager_grpc_key string the key to use to connect
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtorc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Flags:
--table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class
--tablet_manager_grpc_ca string the server ca to use to validate servers when connecting
--tablet_manager_grpc_cert string the cert to use to connect
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App} and CheckThrottler) (default 8)
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8)
--tablet_manager_grpc_connpool_size int number of tablets to keep tmclient connections open to (default 100)
--tablet_manager_grpc_crl string the server crl to use to validate server certificates when connecting
--tablet_manager_grpc_key string the key to use to connect
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vttablet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ Flags:
--tablet_hostname string if not empty, this hostname will be assumed instead of trying to resolve it
--tablet_manager_grpc_ca string the server ca to use to validate servers when connecting
--tablet_manager_grpc_cert string the cert to use to connect
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App} and CheckThrottler) (default 8)
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8)
--tablet_manager_grpc_connpool_size int number of tablets to keep tmclient connections open to (default 100)
--tablet_manager_grpc_crl string the server crl to use to validate server certificates when connecting
--tablet_manager_grpc_key string the key to use to connect
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vttestserver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Flags:
--tablet_hostname string The hostname to use for the tablet otherwise it will be derived from OS' hostname (default "localhost")
--tablet_manager_grpc_ca string the server ca to use to validate servers when connecting
--tablet_manager_grpc_cert string the cert to use to connect
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App} and CheckThrottler) (default 8)
--tablet_manager_grpc_concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8)
--tablet_manager_grpc_connpool_size int number of tablets to keep tmclient connections open to (default 100)
--tablet_manager_grpc_crl string the server crl to use to validate server certificates when connecting
--tablet_manager_grpc_key string the key to use to connect
Expand Down
88 changes: 44 additions & 44 deletions go/vt/vtorc/inst/instance_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func ReadTopologyInstanceBufferable(tabletAlias string, latency *stopwatch.Named

var waitGroup sync.WaitGroup
var tablet *topodatapb.Tablet
var fullStatus *replicationdatapb.FullStatus
var fs *replicationdatapb.FullStatus

Check warning on line 181 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L181

Added line #L181 was not covered by tests
readingStartTime := time.Now()
instance := NewInstance()
instanceFound := false
Expand Down Expand Up @@ -208,7 +208,7 @@ func ReadTopologyInstanceBufferable(tabletAlias string, latency *stopwatch.Named
goto Cleanup
}

fullStatus, err = FullStatus(tabletAlias)
fs, err = fullStatus(tabletAlias)

Check warning on line 211 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L211

Added line #L211 was not covered by tests
if err != nil {
goto Cleanup
}
Expand All @@ -218,48 +218,48 @@ func ReadTopologyInstanceBufferable(tabletAlias string, latency *stopwatch.Named
instance.Port = int(tablet.MysqlPort)
{
// We begin with a few operations we can run concurrently, and which do not depend on anything
instance.ServerID = uint(fullStatus.ServerId)
instance.Version = fullStatus.Version
instance.ReadOnly = fullStatus.ReadOnly
instance.LogBinEnabled = fullStatus.LogBinEnabled
instance.BinlogFormat = fullStatus.BinlogFormat
instance.LogReplicationUpdatesEnabled = fullStatus.LogReplicaUpdates
instance.VersionComment = fullStatus.VersionComment

if instance.LogBinEnabled && fullStatus.PrimaryStatus != nil {
binlogPos, err := getBinlogCoordinatesFromPositionString(fullStatus.PrimaryStatus.FilePosition)
instance.ServerID = uint(fs.ServerId)
instance.Version = fs.Version
instance.ReadOnly = fs.ReadOnly
instance.LogBinEnabled = fs.LogBinEnabled
instance.BinlogFormat = fs.BinlogFormat
instance.LogReplicationUpdatesEnabled = fs.LogReplicaUpdates
instance.VersionComment = fs.VersionComment

Check warning on line 227 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L221-L227

Added lines #L221 - L227 were not covered by tests

if instance.LogBinEnabled && fs.PrimaryStatus != nil {
binlogPos, err := getBinlogCoordinatesFromPositionString(fs.PrimaryStatus.FilePosition)

Check warning on line 230 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L229-L230

Added lines #L229 - L230 were not covered by tests
instance.SelfBinlogCoordinates = binlogPos
errorChan <- err
}

instance.SemiSyncPrimaryEnabled = fullStatus.SemiSyncPrimaryEnabled
instance.SemiSyncReplicaEnabled = fullStatus.SemiSyncReplicaEnabled
instance.SemiSyncPrimaryWaitForReplicaCount = uint(fullStatus.SemiSyncWaitForReplicaCount)
instance.SemiSyncPrimaryTimeout = fullStatus.SemiSyncPrimaryTimeout
instance.SemiSyncPrimaryEnabled = fs.SemiSyncPrimaryEnabled
instance.SemiSyncReplicaEnabled = fs.SemiSyncReplicaEnabled
instance.SemiSyncPrimaryWaitForReplicaCount = uint(fs.SemiSyncWaitForReplicaCount)
instance.SemiSyncPrimaryTimeout = fs.SemiSyncPrimaryTimeout

Check warning on line 238 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L235-L238

Added lines #L235 - L238 were not covered by tests

instance.SemiSyncPrimaryClients = uint(fullStatus.SemiSyncPrimaryClients)
instance.SemiSyncPrimaryStatus = fullStatus.SemiSyncPrimaryStatus
instance.SemiSyncReplicaStatus = fullStatus.SemiSyncReplicaStatus
instance.SemiSyncPrimaryClients = uint(fs.SemiSyncPrimaryClients)
instance.SemiSyncPrimaryStatus = fs.SemiSyncPrimaryStatus
instance.SemiSyncReplicaStatus = fs.SemiSyncReplicaStatus

Check warning on line 242 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L240-L242

Added lines #L240 - L242 were not covered by tests

if instance.IsOracleMySQL() || instance.IsPercona() {
// Stuff only supported on Oracle / Percona MySQL
// ...
// @@gtid_mode only available in Oracle / Percona MySQL >= 5.6
instance.GTIDMode = fullStatus.GtidMode
instance.ServerUUID = fullStatus.ServerUuid
if fullStatus.PrimaryStatus != nil {
GtidExecutedPos, err := replication.DecodePosition(fullStatus.PrimaryStatus.Position)
instance.GTIDMode = fs.GtidMode
instance.ServerUUID = fs.ServerUuid
if fs.PrimaryStatus != nil {
GtidExecutedPos, err := replication.DecodePosition(fs.PrimaryStatus.Position)

Check warning on line 251 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L248-L251

Added lines #L248 - L251 were not covered by tests
errorChan <- err
if err == nil && GtidExecutedPos.GTIDSet != nil {
instance.ExecutedGtidSet = GtidExecutedPos.GTIDSet.String()
}
}
GtidPurgedPos, err := replication.DecodePosition(fullStatus.GtidPurged)
GtidPurgedPos, err := replication.DecodePosition(fs.GtidPurged)

Check warning on line 257 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L257

Added line #L257 was not covered by tests
errorChan <- err
if err == nil && GtidPurgedPos.GTIDSet != nil {
instance.GtidPurged = GtidPurgedPos.GTIDSet.String()
}
instance.BinlogRowImage = fullStatus.BinlogRowImage
instance.BinlogRowImage = fs.BinlogRowImage

Check warning on line 262 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L262

Added line #L262 was not covered by tests

if instance.GTIDMode != "" && instance.GTIDMode != "OFF" {
instance.SupportsOracleGTID = true
Expand All @@ -269,45 +269,45 @@ func ReadTopologyInstanceBufferable(tabletAlias string, latency *stopwatch.Named

instance.ReplicationIOThreadState = ReplicationThreadStateNoThread
instance.ReplicationSQLThreadState = ReplicationThreadStateNoThread
if fullStatus.ReplicationStatus != nil {
instance.HasReplicationCredentials = fullStatus.ReplicationStatus.SourceUser != ""
if fs.ReplicationStatus != nil {
instance.HasReplicationCredentials = fs.ReplicationStatus.SourceUser != ""

Check warning on line 273 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L272-L273

Added lines #L272 - L273 were not covered by tests

instance.ReplicationIOThreadState = ReplicationThreadStateFromReplicationState(replication.ReplicationState(fullStatus.ReplicationStatus.IoState))
instance.ReplicationSQLThreadState = ReplicationThreadStateFromReplicationState(replication.ReplicationState(fullStatus.ReplicationStatus.SqlState))
instance.ReplicationIOThreadState = ReplicationThreadStateFromReplicationState(replication.ReplicationState(fs.ReplicationStatus.IoState))
instance.ReplicationSQLThreadState = ReplicationThreadStateFromReplicationState(replication.ReplicationState(fs.ReplicationStatus.SqlState))

Check warning on line 276 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L275-L276

Added lines #L275 - L276 were not covered by tests
instance.ReplicationIOThreadRuning = instance.ReplicationIOThreadState.IsRunning()
instance.ReplicationSQLThreadRuning = instance.ReplicationSQLThreadState.IsRunning()

binlogPos, err := getBinlogCoordinatesFromPositionString(fullStatus.ReplicationStatus.RelayLogSourceBinlogEquivalentPosition)
binlogPos, err := getBinlogCoordinatesFromPositionString(fs.ReplicationStatus.RelayLogSourceBinlogEquivalentPosition)

Check warning on line 280 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L280

Added line #L280 was not covered by tests
instance.ReadBinlogCoordinates = binlogPos
errorChan <- err

binlogPos, err = getBinlogCoordinatesFromPositionString(fullStatus.ReplicationStatus.FilePosition)
binlogPos, err = getBinlogCoordinatesFromPositionString(fs.ReplicationStatus.FilePosition)

Check warning on line 284 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L284

Added line #L284 was not covered by tests
instance.ExecBinlogCoordinates = binlogPos
errorChan <- err
instance.IsDetached, _ = instance.ExecBinlogCoordinates.ExtractDetachedCoordinates()

binlogPos, err = getBinlogCoordinatesFromPositionString(fullStatus.ReplicationStatus.RelayLogFilePosition)
binlogPos, err = getBinlogCoordinatesFromPositionString(fs.ReplicationStatus.RelayLogFilePosition)

Check warning on line 289 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L289

Added line #L289 was not covered by tests
instance.RelaylogCoordinates = binlogPos
instance.RelaylogCoordinates.Type = RelayLog
errorChan <- err

instance.LastSQLError = emptyQuotesRegexp.ReplaceAllString(strconv.QuoteToASCII(fullStatus.ReplicationStatus.LastSqlError), "")
instance.LastIOError = emptyQuotesRegexp.ReplaceAllString(strconv.QuoteToASCII(fullStatus.ReplicationStatus.LastIoError), "")
instance.LastSQLError = emptyQuotesRegexp.ReplaceAllString(strconv.QuoteToASCII(fs.ReplicationStatus.LastSqlError), "")
instance.LastIOError = emptyQuotesRegexp.ReplaceAllString(strconv.QuoteToASCII(fs.ReplicationStatus.LastIoError), "")

Check warning on line 295 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L294-L295

Added lines #L294 - L295 were not covered by tests

instance.SQLDelay = fullStatus.ReplicationStatus.SqlDelay
instance.UsingOracleGTID = fullStatus.ReplicationStatus.AutoPosition
instance.UsingMariaDBGTID = fullStatus.ReplicationStatus.UsingGtid
instance.SourceUUID = fullStatus.ReplicationStatus.SourceUuid
instance.HasReplicationFilters = fullStatus.ReplicationStatus.HasReplicationFilters
instance.SQLDelay = fs.ReplicationStatus.SqlDelay
instance.UsingOracleGTID = fs.ReplicationStatus.AutoPosition
instance.UsingMariaDBGTID = fs.ReplicationStatus.UsingGtid
instance.SourceUUID = fs.ReplicationStatus.SourceUuid
instance.HasReplicationFilters = fs.ReplicationStatus.HasReplicationFilters

Check warning on line 301 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L297-L301

Added lines #L297 - L301 were not covered by tests

instance.SourceHost = fullStatus.ReplicationStatus.SourceHost
instance.SourcePort = int(fullStatus.ReplicationStatus.SourcePort)
instance.SourceHost = fs.ReplicationStatus.SourceHost
instance.SourcePort = int(fs.ReplicationStatus.SourcePort)

Check warning on line 304 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L303-L304

Added lines #L303 - L304 were not covered by tests

if fullStatus.ReplicationStatus.ReplicationLagUnknown {
if fs.ReplicationStatus.ReplicationLagUnknown {

Check warning on line 306 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L306

Added line #L306 was not covered by tests
instance.SecondsBehindPrimary.Valid = false
} else {
instance.SecondsBehindPrimary.Valid = true
instance.SecondsBehindPrimary.Int64 = int64(fullStatus.ReplicationStatus.ReplicationLagSeconds)
instance.SecondsBehindPrimary.Int64 = int64(fs.ReplicationStatus.ReplicationLagSeconds)

Check warning on line 310 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L310

Added line #L310 was not covered by tests
}
if instance.SecondsBehindPrimary.Valid && instance.SecondsBehindPrimary.Int64 < 0 {
log.Warningf("Alias: %+v, instance.SecondsBehindPrimary < 0 [%+v], correcting to 0", tabletAlias, instance.SecondsBehindPrimary.Int64)
Expand All @@ -316,7 +316,7 @@ func ReadTopologyInstanceBufferable(tabletAlias string, latency *stopwatch.Named
// And until told otherwise:
instance.ReplicationLagSeconds = instance.SecondsBehindPrimary

instance.AllowTLS = fullStatus.ReplicationStatus.SslAllowed
instance.AllowTLS = fs.ReplicationStatus.SslAllowed

Check warning on line 319 in go/vt/vtorc/inst/instance_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/instance_dao.go#L319

Added line #L319 was not covered by tests
}

instanceFound = true
Expand Down
23 changes: 7 additions & 16 deletions go/vt/vtorc/inst/tablet_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,20 @@ import (

// ErrTabletAliasNil is a fixed error message.
var ErrTabletAliasNil = errors.New("tablet alias is nil")
var tmc tmclient.TabletManagerClient

// ResetReplicationParameters resets the replication parameters on the given tablet.
func ResetReplicationParameters(tabletAlias string) error {
tablet, err := ReadTablet(tabletAlias)
if err != nil {
return err
}
tmc := tmclient.NewTabletManagerClient()
tmcCtx, tmcCancel := context.WithTimeout(context.Background(), topo.RemoteOperationTimeout)
defer tmcCancel()
if err := tmc.ResetReplicationParameters(tmcCtx, tablet); err != nil {
return err
}
return nil
// InitializeTMC initializes the tablet manager client to use for all VTOrc RPC calls.
func InitializeTMC() tmclient.TabletManagerClient {
tmc = tmclient.NewTabletManagerClient()
return tmc

Check warning on line 43 in go/vt/vtorc/inst/tablet_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/tablet_dao.go#L41-L43

Added lines #L41 - L43 were not covered by tests
}

// FullStatus gets the full status of the MySQL running in vttablet.
func FullStatus(tabletAlias string) (*replicationdatapb.FullStatus, error) {
// fullStatus gets the full status of the MySQL running in vttablet.
func fullStatus(tabletAlias string) (*replicationdatapb.FullStatus, error) {

Check warning on line 47 in go/vt/vtorc/inst/tablet_dao.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/inst/tablet_dao.go#L47

Added line #L47 was not covered by tests
tablet, err := ReadTablet(tabletAlias)
if err != nil {
return nil, err
}
tmc := tmclient.NewTabletManagerClient()
tmcCtx, tmcCancel := context.WithTimeout(context.Background(), topo.RemoteOperationTimeout)
defer tmcCancel()
return tmc.FullStatus(tmcCtx, tablet)
Expand Down
7 changes: 6 additions & 1 deletion go/vt/vtorc/logic/tablet_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func RegisterFlags(fs *pflag.FlagSet) {
func OpenTabletDiscovery() <-chan time.Time {
// TODO(sougou): If there's a shutdown signal, we have to close the topo.
ts = topo.Open()
tmc = tmclient.NewTabletManagerClient()
tmc = inst.InitializeTMC()

Check warning on line 69 in go/vt/vtorc/logic/tablet_discovery.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/logic/tablet_discovery.go#L69

Added line #L69 was not covered by tests
// Clear existing cache and perform a new refresh.
if _, err := db.ExecVTOrc("delete from vitess_tablet"); err != nil {
log.Error(err)
Expand Down Expand Up @@ -293,6 +293,11 @@ func changeTabletType(ctx context.Context, tablet *topodatapb.Tablet, tabletType
return tmc.ChangeType(ctx, tablet, tabletType, semiSync)
}

// resetReplicationParameters resets the replication parameters on the given tablet.
func resetReplicationParameters(ctx context.Context, tablet *topodatapb.Tablet) error {
return tmc.ResetReplicationParameters(ctx, tablet)

Check warning on line 298 in go/vt/vtorc/logic/tablet_discovery.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vtorc/logic/tablet_discovery.go#L297-L298

Added lines #L297 - L298 were not covered by tests
}

// setReplicationSource calls the said RPC with the parameters provided
func setReplicationSource(ctx context.Context, replica *topodatapb.Tablet, primary *topodatapb.Tablet, semiSync bool) error {
return tmc.SetReplicationSource(ctx, replica, primary.Alias, 0, "", true, semiSync)
Expand Down
Loading

0 comments on commit 8ca5f00

Please sign in to comment.