seqeron 0.18.0
Loading...
Searching...
No Matches
ClusterError.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
6
7// Why a producer may no longer act. Each is terminal and latched: the façade releases its cluster session
8// so a standby can take over, rather than carrying on behind a view of the log it cannot trust. The Java
9// twin is app/ClusterError.java; keep the two in step.
10enum class ClusterError : std::uint8_t
11{
12 // The cluster closed this session, or a new leader never arrived, on a gateway instance that had announced its
13 // activation on it; or no new session replaced it in time on any other. This instance can never be promoted
14 // again.
16 // An own frame came back differing from the oldest pending one, so what reached the log cannot be counted.
18 // Recovery has dispatched nothing for the deadline, on an instance that had caught up before; only a designated
19 // gateway instance or the leader's replica fences, any other logs it.
21 // No ClusterHeartbeat for the deadline: this process has stopped seeing its node's queue. Fences as RecoveryStalled
22 // does.
24 // This instance's snapshot of a round differs from its source's sequenced one: its state is not the log's (A-7).
26 // This instance's source has a snapshot it cannot restore: a format or header version this build does not
27 // read, or records that fail the check the Replayer indexed them by.
29 // A group this instance addresses is not in the log's group table (A-9).
31 // A hosted client broke the host protocol, for instance by opening a connection under an id the façade did not
32 // allocate.
34};
35
42inline const char* clusterErrorName(const ClusterError error)
43{
44 switch (error)
45 {
47 return "CLUSTER_SESSION_LOST";
49 return "INGRESS_CONFIRM_FAULTED";
51 return "RECOVERY_STALLED";
53 return "QUEUE_STALLED";
55 return "SNAPSHOT_DIVERGED";
57 return "SNAPSHOT_UNRESTORABLE";
59 return "GROUP_UNKNOWN";
61 return "CLIENT_PROTOCOL";
62 }
63 return "UNKNOWN";
64}
65
66} // namespace org::limitless::seqeron::app
Definition ClusterError.hpp:5
ClusterError
Definition ClusterError.hpp:11
const char * clusterErrorName(const ClusterError error)
The error's name, for a log line.
Definition ClusterError.hpp:42