feat: add config replication fields to myconf_t, cluster_t, ha_state_t, persist_t; create byteorder.h
This commit is contained in:
parent
78adf3f843
commit
2c375cf476
5 changed files with 96 additions and 1 deletions
|
|
@ -4,11 +4,17 @@
|
|||
|
||||
#define MAX_MASTER_CANDIDATES (64)
|
||||
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <tlog.h>
|
||||
|
||||
#include "clusterconfig.h"
|
||||
#include "xce/cluster.h"
|
||||
|
||||
/* Forward declaration — avoids circular include with cluster_def.h */
|
||||
typedef struct cluster_s cluster_t;
|
||||
|
||||
struct logging {
|
||||
char* logdir;
|
||||
char* loglevel;
|
||||
|
|
@ -22,9 +28,20 @@ typedef struct {
|
|||
char* workdir; /* working directory for WAL/snapshot storage */
|
||||
char* name; /* controller name (hostname by default) */
|
||||
xce_cluster_config_t peers_cfg; /* HA peer list parsed from --peers; count==0 = single-node */
|
||||
uint64_t config_version_tag; /* first 8 bytes of SHA-256, host order */
|
||||
uint8_t config_sha256[32]; /* full SHA-256 of conffile bytes */
|
||||
int conf_keep_n; /* versioned file retention count (default 2) */
|
||||
uint64_t config_generation; /* monotonic audit counter */
|
||||
time_t conf_stale_timeout; /* seconds before saved config flagged stale (default 86400) */
|
||||
int config_stale; /* 1 when saved config older than conf_stale_timeout */
|
||||
} myconf_t;
|
||||
|
||||
extern cluster_config_t* get_default_conf(void*);
|
||||
extern int add_config(void*, char*, char*);
|
||||
|
||||
void myconf_fini(myconf_t *myconf);
|
||||
|
||||
int load_primary_config(cluster_t *c);
|
||||
int fetch_config_from_primary(cluster_t *c);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue