主从同步性能优化,主从同步性能测试。
This commit is contained in:
@@ -2,34 +2,25 @@
|
||||
#define __REPLICA_H__
|
||||
|
||||
|
||||
#define MAX_CMD_LEN 256
|
||||
#define MAX_IP_LEN 64
|
||||
|
||||
enum event_type {
|
||||
EVENT_COMPLETED_CMD,
|
||||
EVENT_SSYNC,
|
||||
EVENT_SREADY,
|
||||
};
|
||||
#define MAX_IP_LEN 64
|
||||
|
||||
struct complete_cmd_evt {
|
||||
__u64 seq;
|
||||
__u32 len;
|
||||
__u8 cmd[MAX_CMD_LEN];
|
||||
};
|
||||
|
||||
struct sync_evt {
|
||||
__u64 seq;
|
||||
char ip[MAX_IP_LEN];
|
||||
__s32 port;
|
||||
enum {
|
||||
EVENT_SSYNC = 1,
|
||||
EVENT_SREADY = 2,
|
||||
};
|
||||
|
||||
struct replica_event {
|
||||
__u32 type;
|
||||
__u32 _pad;
|
||||
uint32_t type;
|
||||
uint32_t _pad;
|
||||
|
||||
union {
|
||||
struct complete_cmd_evt complete;
|
||||
struct sync_evt sync;
|
||||
struct {
|
||||
uint64_t seq; // SYNC_SEQ:从这个 seq 开始增量
|
||||
int32_t port;
|
||||
uint32_t ip_len;
|
||||
char ip[MAX_IP_LEN];
|
||||
} sync;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user