Skip to content

Commit

Permalink
discovery: fix crash with nil server vschema (#15086)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg authored Jan 30, 2024
1 parent 77dc0c9 commit ee368e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/vt/discovery/keyspace_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,11 @@ func (kss *keyspaceState) isServing() bool {
// In addition, the traffic switcher updates SrvVSchema when the DeniedTables attributes in a Shard record is
// modified.
func (kss *keyspaceState) onSrvVSchema(vs *vschemapb.SrvVSchema, err error) bool {
// the vschema can be nil if the server is currently shutting down
if vs == nil {
return true
}

kss.mu.Lock()
defer kss.mu.Unlock()
kss.moveTablesState, _ = kss.getMoveTablesStatus(vs)
Expand Down

0 comments on commit ee368e1

Please sign in to comment.