ebpf的主从同步实现,QPS测试与内存池QPS测试。

This commit is contained in:
1iaan
2026-01-30 16:00:06 +00:00
parent 2bdb48d63d
commit fbdcff6878
23 changed files with 599 additions and 383 deletions

View File

@@ -1,36 +1,37 @@
#ifndef __REPLICA_H__
#define __REPLICA_H__
#define MAX_CMD_LEN 256
#define MAX_IP_LEN 64
enum event_type {
EVENT_CREATE_SNAPSHOT_ASYNC,
EVENT_CREATE_SNAPSHOT_OK,
EVENT_CREATE_SNAPSHOT_READY,
EVENT_COMPLETED_CMD
EVENT_COMPLETED_CMD,
EVENT_SSYNC,
EVENT_SREADY,
};
struct event {
enum event_type type;
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;
};
struct replica_event {
__u32 type;
__u32 _pad;
union {
struct {
char ip[16];
__u32 port;
} sync;
struct {
__u8 cmd[256];
__u64 len;
} cmd;
struct {
char array_file[128];
char rbtree_file[128];
char hash_file[128];
} ok;
} data;
struct complete_cmd_evt complete;
struct sync_evt sync;
};
};
enum state {
NOSLAVE,
PREPARING,
ONLINE
};
#endif