实现全量持久化:save操作落盘,启动时读取到内存

增量持久化:执行修改操作时将cmd追加到log中,启动时逐条取出顺序执行
This commit is contained in:
2026-01-07 18:43:28 +08:00
parent cb0134a852
commit 3cc97b9454
9 changed files with 373 additions and 74 deletions

View File

@@ -18,8 +18,8 @@
#define BATCH_SIZE (65536)
#define TIME_SUB_MS(tv1, tv2) ((tv1.tv_sec - tv2.tv_sec) * 1000 + (tv1.tv_usec - tv2.tv_usec) / 1000)
// #define PRESP print_response
#define PRESP
#define PRESP print_response
// #define PRESP
typedef enum {
@@ -50,7 +50,8 @@ enum {
KVS_CMD_HDEL,
KVS_CMD_HMOD,
KVS_CMD_HEXIST,
KVS_CMD_SAVE,
KVS_CMD_COUNT,
};