Skip to content

Commit

Permalink
add dummy ForgetLeader to structs which implements raft.Node (tempora…
Browse files Browse the repository at this point in the history
…l, will be removed later)

Signed-off-by: Hitoshi Mitake <[email protected]>
  • Loading branch information
mitake committed Oct 23, 2023
1 parent 5e9054b commit 137e94a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/etcdserver/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package etcdserver

import (
"context"
"expvar"
"fmt"
"log"
Expand Down Expand Up @@ -433,3 +434,7 @@ func (r *raftNode) advanceTicks(ticks int) {
r.tick()
}
}

func (r *raftNode) ForgetLeader(ctx context.Context) error {
return nil
}
8 changes: 8 additions & 0 deletions server/etcdserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 137e94a

Please sign in to comment.