We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b70c76 commit a774206Copy full SHA for a774206
go/vt/vtgateproxy/discovery.go
@@ -323,7 +323,9 @@ func (b *JSONGateResolverBuilder) parse() (bool, error) {
323
for poolType := range targets {
324
b.sorter.shuffleSort(targets[poolType], b.affinityField, b.affinityValue)
325
if len(targets[poolType]) > *numConnections {
326
- targets[poolType] = targets[poolType][:b.numConnections]
+ // Always grab one non-local target to protect against a complete local failure.
327
+ nonLocal := targets[poolType][len(targets[poolType])-1]
328
+ targets[poolType] = append(targets[poolType][:b.numConnections], nonLocal)
329
}
330
targetCount.Set(poolType, int64(len(targets[poolType])))
331
0 commit comments