refactor(sync): add ref id in raft entry
This commit is contained in:
parent
75f9f415e6
commit
0b494d256f
|
@ -36,6 +36,7 @@ typedef struct SSyncRaftEntry {
|
|||
bool isWeak;
|
||||
SyncTerm term;
|
||||
SyncIndex index;
|
||||
int64_t rid;
|
||||
uint32_t dataLen; // origin RpcMsg.contLen
|
||||
char data[]; // origin RpcMsg.pCont
|
||||
} SSyncRaftEntry;
|
||||
|
|
|
@ -137,6 +137,8 @@ cJSON* syncEntry2Json(const SSyncRaftEntry* pEntry) {
|
|||
cJSON_AddStringToObject(pRoot, "term", u64buf);
|
||||
snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pEntry->index);
|
||||
cJSON_AddStringToObject(pRoot, "index", u64buf);
|
||||
snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pEntry->rid);
|
||||
cJSON_AddStringToObject(pRoot, "rid", u64buf);
|
||||
cJSON_AddNumberToObject(pRoot, "dataLen", pEntry->dataLen);
|
||||
|
||||
char* s;
|
||||
|
|
Loading…
Reference in New Issue