Skip to content

Commit

Permalink
Merge pull request #18139 from ahrtr/3.4_apply_log_20240606
Browse files Browse the repository at this point in the history
[3.4] print error log when validation on conf change failed
  • Loading branch information
ahrtr committed Jun 7, 2024
2 parents 041cd4e + f0276cb commit 88ff600
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 88ff600

Please sign in to comment.