Skip to content

Commit 83e05b5

Browse files
[release-20.0] Throttler: keep watching topo even on error (vitessio#18223) (vitessio#18320)
Signed-off-by: Shlomi Noach <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
1 parent fbebdf7 commit 83e05b5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

go/vt/srvtopo/server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ type Server interface {
4242
// GetSrvKeyspace returns the SrvKeyspace for a cell/keyspace.
4343
GetSrvKeyspace(ctx context.Context, cell, keyspace string) (*topodatapb.SrvKeyspace, error)
4444

45+
// WatchSrvKeyspace starts watching the SrvKeyspace object for changes. The callback function is called upon change.
46+
// The callback function should return `true` if it wishes to continue watching for further changes, or `false` if it
47+
// is done and wants to stop watching.
4548
WatchSrvKeyspace(ctx context.Context, cell, keyspace string, callback func(*topodatapb.SrvKeyspace, error) bool)
4649

4750
// WatchSrvVSchema starts watching the SrvVSchema object for

go/vt/vttablet/tabletserver/throttle/throttler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ func (throttler *Throttler) WatchSrvKeyspaceCallback(srvks *topodatapb.SrvKeyspa
368368
if !topo.IsErrType(err, topo.Interrupted) && !errors.Is(err, context.Canceled) {
369369
log.Errorf("WatchSrvKeyspaceCallback error: %v", err)
370370
}
371-
return false
371+
return true
372372
}
373373
throttlerConfig := throttler.normalizeThrottlerConfig(srvks.ThrottlerConfig)
374374

0 commit comments

Comments
 (0)