add NtyCo as submodule & 搭建设计ebpf主从同步代码框架

This commit is contained in:
1iaan
2026-01-28 12:05:28 +00:00
parent 226f9a510f
commit fe257cafec
49 changed files with 249 additions and 8922 deletions

View File

@@ -1,5 +1,6 @@
#include "kvs_protocol_resp.h"
#include "kvs_rw_tools.h"
#include "dump/kvs_dump.h"
#if ENABLE_ARRAY
extern kvs_array_t global_array;
@@ -535,12 +536,14 @@ int resp_dispatch(const resp_cmd_t *cmd, resp_value_t *out_value) {
/* ---------------- misc ---------------- */
case KVS_CMD_SAVE: {
if (cmd->argc != 1) { *out_value = resp_error("ERR wrong number of arguments for 'save'"); return 0; }
int r = kvs_save_to_file();
int r = kvs_create_snapshot(global_array_file, global_rbtree_file, global_hash_file);
if(r == 0) ksv_clear_log(global_oplog_fd);
if (r < 0) { *out_value = resp_error("ERR save failed"); return 0; }
*out_value = resp_simple("OK");
return 0;
}
case KVS_CMD_PSYNC:
kvs_create_snapshot_async(cmd->argv[1].ptr, atoi(cmd->argv[2].ptr));
*out_value = resp_simple("OK");
return 0;
default: