Skip to content

Commit

Permalink
print error log when validation on conf change failed
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Wang <[email protected]>
  • Loading branch information
ahrtr committed Jun 6, 2024
1 parent 041cd4e commit f0276cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2381,13 +2381,18 @@ func (s *EtcdServer) notifyAboutFirstCommitInTerm() {
// applyConfChange applies a ConfChange to the server. It is only
// invoked with a ConfChange that has already passed through Raft
func (s *EtcdServer) applyConfChange(cc raftpb.ConfChange, confState *raftpb.ConfState) (bool, error) {
lg := s.getLogger()
if err := s.cluster.ValidateConfigurationChange(cc); err != nil {
if lg != nil {
lg.Error("Validation on configuration change failed", zap.Error(err))
} else {
plog.Errorf("Validation on configuration change failed: %v", err)
}
cc.NodeID = raft.None
s.r.ApplyConfChange(cc)
return false, err
}

lg := s.getLogger()
*confState = *s.r.ApplyConfChange(cc)
switch cc.Type {
case raftpb.ConfChangeAddNode, raftpb.ConfChangeAddLearnerNode:
Expand Down

0 comments on commit f0276cb

Please sign in to comment.