提交 0b494d25 编写于 作者: M Minghao Li

refactor(sync): add ref id in raft entry

上级 75f9f415
...@@ -36,6 +36,7 @@ typedef struct SSyncRaftEntry { ...@@ -36,6 +36,7 @@ typedef struct SSyncRaftEntry {
bool isWeak; bool isWeak;
SyncTerm term; SyncTerm term;
SyncIndex index; SyncIndex index;
int64_t rid;
uint32_t dataLen; // origin RpcMsg.contLen uint32_t dataLen; // origin RpcMsg.contLen
char data[]; // origin RpcMsg.pCont char data[]; // origin RpcMsg.pCont
} SSyncRaftEntry; } SSyncRaftEntry;
......
...@@ -137,6 +137,8 @@ cJSON* syncEntry2Json(const SSyncRaftEntry* pEntry) { ...@@ -137,6 +137,8 @@ cJSON* syncEntry2Json(const SSyncRaftEntry* pEntry) {
cJSON_AddStringToObject(pRoot, "term", u64buf); cJSON_AddStringToObject(pRoot, "term", u64buf);
snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pEntry->index); snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pEntry->index);
cJSON_AddStringToObject(pRoot, "index", u64buf); cJSON_AddStringToObject(pRoot, "index", u64buf);
snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pEntry->rid);
cJSON_AddStringToObject(pRoot, "rid", u64buf);
cJSON_AddNumberToObject(pRoot, "dataLen", pEntry->dataLen); cJSON_AddNumberToObject(pRoot, "dataLen", pEntry->dataLen);
char* s; char* s;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册