Skip to content

Commit

Permalink
remove state management from keeper
Browse files Browse the repository at this point in the history
the best keeper is a stateless keeper

Signed-off-by: Volkan Özçelik <[email protected]>
  • Loading branch information
v0lkan committed Jan 10, 2025
1 parent 0938cb3 commit dd9d60a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
28 changes: 0 additions & 28 deletions app/keeper/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/spiffe/spike/app/keeper/internal/env"
"github.com/spiffe/spike/app/keeper/internal/route/handle"
"github.com/spiffe/spike/app/keeper/internal/state"
"github.com/spiffe/spike/app/keeper/internal/trust"
"github.com/spiffe/spike/internal/auth"
"github.com/spiffe/spike/internal/config"
Expand All @@ -36,33 +35,6 @@ func main() {

trust.Authenticate(spiffeid)

keeperState := state.ReadAppState()

if keeperState == state.AppStateError {
log.FatalLn(
"SPIKE Keeper is in ERROR state. Manual intervention required.",
)
}

if keeperState == state.AppStateNotReady {
log.Log().Info(appName,
"msg", "SPIKE Keeper is not ready. Will send shards")

// go api.Contribute(source)
// go state.WaitForShards()
}

if keeperState == state.AppStateReady ||
keeperState == state.AppStateRecovering {
// TODO: implement this case
// 1. Transition to a RECOVERING state, if not done already
// 2. Contact peers to recompute shard.
// 3. Try forever.
// 4. If something is irrevocably irrecoverable transition to ERROR state.
// 5. When everything is back to normal, transition to READY state.
panic("I started, but I don't know what to do.")
}

log.Log().Info(appName, "msg", fmt.Sprintf("Started service: %s v%s",
appName, config.KeeperVersion))
if err := net.ServeWithPredicate(
Expand Down
5 changes: 5 additions & 0 deletions jira.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
</target>
</purpose>
<next>
<issue>
we don't need state.ReadAppState()
and other state enums for keepers anymore
keepers are just dummy stateless keepers.
</issue>
<issue>
Invert shard generation flow.
</issue>
Expand Down

0 comments on commit dd9d60a

Please sign in to comment.