Created basic handling for taking snapshots. Will implemented error when snapshot in progress and propagation of snapshot command to the rest of the cluster

This commit is contained in:
Kelvin Clement Mwinuka
2024-01-26 00:58:43 +08:00
parent 63fcb490c9
commit 3c5d6fef2c
5 changed files with 46 additions and 1 deletions

View File

@@ -183,6 +183,10 @@ func (r *Raft) RemoveServer(meta memberlist.NodeMeta) error {
return nil
}
func (r *Raft) TakeSnapshot() error {
return r.raft.Snapshot().Error()
}
func (r *Raft) RaftShutdown(ctx context.Context) {
// Leadership transfer if current node is the leader
if r.IsRaftLeader() {