From dd9d60ada6e8749b655a7104da2d4468e56f6204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C3=96z=C3=A7elik?= Date: Thu, 9 Jan 2025 21:45:49 -0800 Subject: [PATCH] remove state management from keeper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the best keeper is a stateless keeper Signed-off-by: Volkan Özçelik --- app/keeper/cmd/main.go | 28 ---------------------------- jira.xml | 5 +++++ 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/app/keeper/cmd/main.go b/app/keeper/cmd/main.go index fef838c..b88ae6e 100644 --- a/app/keeper/cmd/main.go +++ b/app/keeper/cmd/main.go @@ -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" @@ -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( diff --git a/jira.xml b/jira.xml index 07b58f7..9961145 100644 --- a/jira.xml +++ b/jira.xml @@ -14,6 +14,11 @@ + + we don't need state.ReadAppState() + and other state enums for keepers anymore + keepers are just dummy stateless keepers. + Invert shard generation flow.