Skip to content

Commit

Permalink
Merge pull request #24 from slackhq/pbibra-fix-rdonly-patch-for-table…
Browse files Browse the repository at this point in the history
…tgateway

update tabletgateway to pass in target of selected tablet for rdonly patch
  • Loading branch information
pbibra authored Dec 8, 2022
2 parents 1488d95 + 1281e89 commit 2409b02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go/vt/vtgate/tabletgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@ func (gw *TabletGateway) withRetry(ctx context.Context, target *querypb.Target,

startTime := time.Now()
var canRetry bool
canRetry, err = inner(ctx, target, th.Conn)
if *routeReplicaToRdonly && target.TabletType == topodatapb.TabletType_REPLICA {
canRetry, err = inner(ctx, th.Target, th.Conn)
} else {
canRetry, err = inner(ctx, target, th.Conn)
}
gw.updateStats(target, startTime, err)
if canRetry {
invalidTablets[topoproto.TabletAliasString(tabletLastUsed.Alias)] = true
Expand Down

0 comments on commit 2409b02

Please sign in to comment.