summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZheng Chao <[email protected]>2022-11-25 21:12:18 +0800
committerZheng Chao <[email protected]>2022-11-25 21:12:18 +0800
commit7622a2949a8d73bbdb476f03ff8fcc50cf29709f (patch)
tree53102e5b08e52e2a53d6323ce49ed2691ae08fa0 /src
parent698c99c69c1a77d2ea401474bc6c66ec68745473 (diff)
:sparkles: Command `CLUSTER ADDKEYOWNER` can add multiple nodes as key owner.
Diffstat (limited to 'src')
-rw-r--r--src/inc_internal/swarmkv_error.h4
-rw-r--r--src/swarmkv.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/inc_internal/swarmkv_error.h b/src/inc_internal/swarmkv_error.h
index 4eb47c3..8d3fa88 100644
--- a/src/inc_internal/swarmkv_error.h
+++ b/src/inc_internal/swarmkv_error.h
@@ -19,6 +19,6 @@
#define error_read_slot_table_failed "ERR read slot table failed"
#define error_keyspace_obj_owner_not_found "ERR can't find object owner from keyspace"
-#define error_cluster_addnode_node_is_not_active "ERR candinate node is not active"
-#define error_cluster_addnode_node_has_slot "ERR candinate node already has some slots"
+#define error_cluster_addkeyowner_node_is_not_active "ERR candinate node %s is not active"
+#define error_cluster_addkeyowner_node_has_slot "ERR candinate node %s already has some slots"
diff --git a/src/swarmkv.c b/src/swarmkv.c
index 69ae741..5fadad7 100644
--- a/src/swarmkv.c
+++ b/src/swarmkv.c
@@ -1087,6 +1087,7 @@ const char *swarmkv_get_command_hint(struct swarmkv *db, const char* cmd_name)
}
return NULL;
}
+/*
static void libevent_log_cb(int severity, const char *msg)
{
const char *s;
@@ -1096,15 +1097,16 @@ static void libevent_log_cb(int severity, const char *msg)
case _EVENT_LOG_MSG: s = "msg"; break;
case _EVENT_LOG_WARN: s = "warn"; break;
case _EVENT_LOG_ERR: s = "error"; break;
- default: s = "?"; break; /* never reached */
+ default: s = "?"; break; // never reached
}
fprintf(logfile, "[%s] %s\n", s, msg);
fclose(logfile);
}
+*/
struct swarmkv *swarmkv_open(struct swarmkv_options* opts, const char * db_name, char **err)
{
struct swarmkv *db = NULL;
- event_set_log_callback(libevent_log_cb);
+// event_set_log_callback(libevent_log_cb);
db=ALLOC(struct swarmkv, 1);
strncpy(db->db_name, db_name, sizeof(db->db_name));