Skip to content

Commit 7b8cad2

Browse files
only enable ERS is we have VtorcConfig
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
1 parent 0c9f909 commit 7b8cad2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

go/vt/vtctl/grpcvtctldserver/server.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,7 @@ func (s *VtctldServer) DisableVtorcEmergencyReparent(ctx context.Context, req *v
11561156
return nil, err
11571157
}
11581158

1159+
// set DisableEmergencyReparent to true, init VtorcConfig if nil
11591160
if ki.VtorcConfig == nil {
11601161
ki.VtorcConfig = &topodatapb.VtorcConfig{}
11611162
}
@@ -1261,10 +1262,10 @@ func (s *VtctldServer) EnableVtorcEmergencyReparent(ctx context.Context, req *vt
12611262
return nil, err
12621263
}
12631264

1264-
if ki.VtorcConfig == nil {
1265-
ki.VtorcConfig = &topodatapb.VtorcConfig{}
1265+
// set DisableEmergencyReparent to false if we have a VtorcConfig
1266+
if ki.VtorcConfig != nil {
1267+
ki.VtorcConfig.DisableEmergencyReparent = false
12661268
}
1267-
ki.VtorcConfig.DisableEmergencyReparent = false
12681269

12691270
err = s.ts.UpdateKeyspace(ctx, ki)
12701271
if err != nil {

0 commit comments

Comments
 (0)