From 033fad62514720cb7e0b804367b5552d57ed77bc Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 14 Sep 2023 12:58:58 +0200 Subject: [PATCH] Add `Fallback` log entry --- kore-rpc-types/src/Kore/JsonRpc/Types/Log.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/kore-rpc-types/src/Kore/JsonRpc/Types/Log.hs b/kore-rpc-types/src/Kore/JsonRpc/Types/Log.hs index d003a081d18..40d284ab2c1 100644 --- a/kore-rpc-types/src/Kore/JsonRpc/Types/Log.hs +++ b/kore-rpc-types/src/Kore/JsonRpc/Types/Log.hs @@ -3,8 +3,10 @@ module Kore.JsonRpc.Types.Log (module Kore.JsonRpc.Types.Log) where import Data.Aeson (FromJSON, ToJSON) +import Data.List.NonEmpty (NonEmpty) import Data.Text (Text) import GHC.Generics (Generic) +import Kore.JsonRpc.Types.Depth (Depth (..)) import Kore.Syntax.Json.Types (KoreJson) import Deriving.Aeson ( @@ -56,6 +58,21 @@ data LogEntry , result :: LogRewriteResult , origin :: LogOrigin } + | -- | Indicates a fallback of an RPC-server to a more powerful, but slower backup server, i.e. Booster to Kore + Fallback + { originalTerm :: Maybe KoreJson + -- ^ state before fallback + , rewrittenTerm :: Maybe KoreJson + -- ^ state after fallback + , reason :: Text + -- ^ fallback reason + , ruleIds :: NonEmpty Text + -- ^ rules applied during fallback, the first rule is the one that caused the fallback + , recoveryDepth :: Depth + -- ^ depth reached in fallback, must be the same as (length ruleIds) + , origin :: LogOrigin + -- ^ proxi server the log was emitted from + } deriving stock (Generic, Show, Eq) deriving (FromJSON, ToJSON)