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
|
|
@ -24,6 +24,7 @@ typedef struct {
|
|||
uint32_t finished_retain_s; /* retain finished jobs N seconds (default 3600) */
|
||||
uint32_t worker_retain_s; /* retain unavailable workers N seconds (default 86400) */
|
||||
uint32_t sync_timeout_ms; /* sync replication ACK timeout ms (default 50) */
|
||||
uint32_t max_wal_records; /* checkpoint trigger: records since last snap (default 10000) */
|
||||
} persist_config_t;
|
||||
|
||||
static inline persist_config_t persist_config_defaults(void)
|
||||
|
|
@ -37,6 +38,7 @@ static inline persist_config_t persist_config_defaults(void)
|
|||
c.finished_retain_s = DEFAULT_FINISHED_RETAIN_S;
|
||||
c.worker_retain_s = DEFAULT_WORKER_RETAIN_S;
|
||||
c.sync_timeout_ms = DEFAULT_SYNC_TIMEOUT_MS;
|
||||
c.max_wal_records = 10000;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
@ -78,12 +80,13 @@ struct persist_s {
|
|||
|
||||
/* Concurrency */
|
||||
pthread_mutex_t lock;
|
||||
_Atomic uint32_t wal_record_count; /* records appended since last checkpoint */
|
||||
_Atomic int checkpoint_in_progress; /* CAS guard: 0=idle, 1=scheduled/running */
|
||||
atomic_int fsync_stop;
|
||||
atomic_int fsync_thread_running;
|
||||
pthread_t fsync_thread;
|
||||
|
||||
/* Checkpoint (stubs for now — wired in Task 10) */
|
||||
atomic_int checkpoint_in_progress;
|
||||
atomic_int checkpoint_requested;
|
||||
pthread_cond_t checkpoint_done;
|
||||
pthread_mutex_t checkpoint_mutex;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue