From 137e94a9ff47a6b22fafb20ddf45219ab2125969 Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Mon, 23 Oct 2023 21:30:01 +0900 Subject: [PATCH] add dummy ForgetLeader to structs which implements raft.Node (temporal, will be removed later) Signed-off-by: Hitoshi Mitake --- server/etcdserver/raft.go | 5 +++++ server/etcdserver/server_test.go | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/server/etcdserver/raft.go b/server/etcdserver/raft.go index 2a315ea58656..8203bb65005e 100644 --- a/server/etcdserver/raft.go +++ b/server/etcdserver/raft.go @@ -15,6 +15,7 @@ package etcdserver import ( + "context" "expvar" "fmt" "log" @@ -433,3 +434,7 @@ func (r *raftNode) advanceTicks(ticks int) { r.tick() } } + +func (r *raftNode) ForgetLeader(ctx context.Context) error { + return nil +} diff --git a/server/etcdserver/server_test.go b/server/etcdserver/server_test.go index 2d9b5ce4d911..1a11e1dd44a4 100644 --- a/server/etcdserver/server_test.go +++ b/server/etcdserver/server_test.go @@ -1832,6 +1832,10 @@ func (n *nodeRecorder) Compact(index uint64, nodes []uint64, d []byte) { n.Record(testutil.Action{Name: "Compact"}) } +func (n *nodeRecorder) ForgetLeader(ctx context.Context) error { + return nil +} + type nodeProposalBlockerRecorder struct { nodeRecorder } @@ -1863,6 +1867,10 @@ func newNopReadyNode() *readyNode { func (n *readyNode) Ready() <-chan raft.Ready { return n.readyc } +func (n *readyNode) ForgetLeader(ctx context.Context) error { + return nil +} + type nodeConfChangeCommitterRecorder struct { readyNode index uint64