13 Star 0 Fork 26

src-openEuler/etcd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0015-backport-print-error-log-when-validation-on-conf-change-faile.patch 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
guojunding 提交于 2024-09-20 16:50 . backport 2 patches
From f0276cb4fa4e3f509783df28f9ed1038e3c2af15 Mon Sep 17 00:00:00 2001
From: Benjamin Wang <[email protected]>
Date: Thu, 6 Jun 2024 19:34:44 +0100
Subject: [PATCH] print error log when validation on conf change failed
Signed-off-by: Benjamin Wang <[email protected]>
---
etcdserver/server.go | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/etcdserver/server.go b/etcdserver/server.go
index a341625..c58c533 100644
--- a/etcdserver/server.go
+++ b/etcdserver/server.go
@@ -2258,13 +2258,18 @@ func (s *EtcdServer) applyEntryNormal(e *raftpb.Entry) {
// 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:
--
2.9.3.windows.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/etcd.git
[email protected]:src-openeuler/etcd.git
src-openeuler
etcd
etcd
master

搜索帮助