forked from lei.chen/myxce
feat(controller-status): add ctrlstatus opcode + CtrlStatus/CtrlPeer schema + typemap typedefs (task 1.1)
This commit is contained in:
parent
4b75bfa4db
commit
97a501e96e
4 changed files with 59 additions and 4 deletions
|
|
@ -203,6 +203,35 @@ typedef struct {
|
|||
int success;
|
||||
} wal_ack_reply_t;
|
||||
|
||||
/* ctrlstatus reply payload (controller-status spec): one configured
|
||||
* controller (CtrlPeer) and the lean identity/health snapshot (CtrlStatus).
|
||||
* The peers list maps via $C.mapname("peers.list")/$C.maplistcount("peers.count")
|
||||
* to the nested { count, list } member below. */
|
||||
typedef struct {
|
||||
char* name;
|
||||
char* host;
|
||||
uint32_t port;
|
||||
} xce_ctrlpeer_t;
|
||||
|
||||
typedef struct {
|
||||
char* clusterName;
|
||||
char* primaryName;
|
||||
char* responderName;
|
||||
uint8_t responderRole;
|
||||
uint64_t term;
|
||||
uint64_t configVersion;
|
||||
xce_data_t* configChecksum;
|
||||
uint64_t committedConfigVersion;
|
||||
uint64_t committedLsn;
|
||||
uint64_t appliedLsn;
|
||||
unsigned fenced;
|
||||
struct {
|
||||
int count;
|
||||
xce_ctrlpeer_t** list;
|
||||
} peers;
|
||||
uint32_t peerCount;
|
||||
} xce_ctrlstatus_t;
|
||||
|
||||
typedef struct {
|
||||
uint64_t seq;
|
||||
uint32_t opcode;
|
||||
|
|
@ -220,6 +249,7 @@ typedef struct {
|
|||
request_vote_reply_t* requestvotereplymsg;
|
||||
state_report_t* state_report;
|
||||
wal_ack_reply_t* walackreplymsg;
|
||||
xce_ctrlstatus_t* ctrlstatus;
|
||||
} data;
|
||||
/* Req 7: standby redirect fields — populated when status == XCE_ERR_STANDBY */
|
||||
char *redirect_host;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ enum OPCode {
|
|||
walCatchupEntry @37;
|
||||
preVoteRequest @38;
|
||||
preVoteReply @39;
|
||||
ctrlstatus @40;
|
||||
}
|
||||
|
||||
struct PeerInfo $C.mapname("xce_peerinfo_t") {
|
||||
|
|
@ -486,6 +487,28 @@ struct NotifyData $C.mapname("xce_notify_data_t"){
|
|||
}
|
||||
}
|
||||
|
||||
struct CtrlPeer $C.mapname("xce_ctrlpeer_t") {
|
||||
name @0: Text;
|
||||
host @1: Text;
|
||||
port @2: UInt32;
|
||||
}
|
||||
|
||||
struct CtrlStatus $C.mapname("xce_ctrlstatus_t") {
|
||||
clusterName @0: Text;
|
||||
primaryName @1: Text;
|
||||
responderName @2: Text;
|
||||
responderRole @3: UInt8;
|
||||
term @4: UInt64;
|
||||
configVersion @5: UInt64;
|
||||
configChecksum @6: Data;
|
||||
committedConfigVersion @7: UInt64;
|
||||
committedLsn @8: UInt64;
|
||||
appliedLsn @9: UInt64;
|
||||
fenced @10: Bool;
|
||||
peers @11: List(CtrlPeer) $C.mapname("peers.list") $C.maplistcount("peers.count");
|
||||
peerCount @12: UInt32;
|
||||
}
|
||||
|
||||
struct ClusterConf $C.mapname("xce_clusterconf_t") {
|
||||
name @0: Text;
|
||||
resources @1: List(Resource) $C.mapname("reslist.res") $C.maplistcount("reslist.count");
|
||||
|
|
@ -563,6 +586,7 @@ struct RequestReply $C.mapname("xce_reply_t"){
|
|||
requestvotereplymsg @14: RequestVoteReply;
|
||||
stateReportMsg @15: StateReport $C.mapname("state_report"); # heartbeat reply: standby state
|
||||
walackreplymsg @16: WalAckReply $C.mapname("walackreplymsg"); # WAL apply ACK from standby
|
||||
ctrlstatus @17: CtrlStatus; # ctrlstatus reply: identity/health snapshot
|
||||
}
|
||||
|
||||
redirectHost @11: Text $C.mapname("redirect_host");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue