Re-enabled cluster nodes in docker-compose.yml.

Created flow to forward key deletion command from non-leader node to leader node.
Created flow for propagating key deletion accross the entire cluster to maintain consistency of the deleted keys.
This commit is contained in:
Kelvin Mwinuka
2024-03-11 20:39:57 +08:00
parent c611dd60ee
commit 52b39d5b0f
7 changed files with 294 additions and 225 deletions

View File

@@ -20,6 +20,7 @@ type Opts struct {
Config utils.Config
Server utils.Server
GetCommand func(command string) (utils.Command, error)
DeleteKey func(ctx context.Context, key string) error
}
type Raft struct {
@@ -94,6 +95,7 @@ func (r *Raft) RaftInit(ctx context.Context) {
Config: r.options.Config,
Server: r.options.Server,
GetCommand: r.options.GetCommand,
DeleteKey: r.options.DeleteKey,
}),
logStore,
stableStore,