refactor(sync): add ref id in raft entry

This commit is contained in:
Minghao Li 2022-07-23 19:18:18 +08:00
parent 75f9f415e6
commit 0b494d256f
2 changed files with 3 additions and 0 deletions

View File

@ -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;

View File

@ -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;