refact: relocate func syncSnapInfoDataRealloc
This commit is contained in:
parent
f68804322c
commit
1a9b08fa08
|
@ -289,6 +289,9 @@ const char* syncStr(ESyncState state);
|
||||||
|
|
||||||
int32_t syncNodeGetConfig(int64_t rid, SSyncCfg *cfg);
|
int32_t syncNodeGetConfig(int64_t rid, SSyncCfg *cfg);
|
||||||
|
|
||||||
|
// util
|
||||||
|
int32_t syncSnapInfoDataRealloc(SSnapshot* pSnap, int32_t size);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -439,16 +439,6 @@ static int32_t tsdbPartitionInfoSerialize(STsdbPartitionInfo* pInfo, uint8_t* bu
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t syncSnapInfoDataRealloc(SSnapshot* pSnap, int32_t size) {
|
|
||||||
void* data = taosMemoryRealloc(pSnap->data, size);
|
|
||||||
if (data == NULL) {
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
pSnap->data = data;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t tsdbSnapPrepDescription(SVnode* pVnode, SSnapshot* pSnap) {
|
int32_t tsdbSnapPrepDescription(SVnode* pVnode, SSnapshot* pSnap) {
|
||||||
ASSERT(pSnap->type == TDMT_SYNC_PREP_SNAPSHOT || pSnap->type == TDMT_SYNC_PREP_SNAPSHOT_REPLY);
|
ASSERT(pSnap->type == TDMT_SYNC_PREP_SNAPSHOT || pSnap->type == TDMT_SYNC_PREP_SNAPSHOT_REPLY);
|
||||||
STsdbPartitionInfo partitionInfo = {0};
|
STsdbPartitionInfo partitionInfo = {0};
|
||||||
|
|
|
@ -487,3 +487,13 @@ void syncLogSendRequestVoteReply(SSyncNode* pSyncNode, const SyncRequestVoteRepl
|
||||||
sNInfo(pSyncNode, "send sync-request-vote-reply to dnode:%d {term:%" PRId64 ", grant:%d}, %s", DID(&pMsg->destId),
|
sNInfo(pSyncNode, "send sync-request-vote-reply to dnode:%d {term:%" PRId64 ", grant:%d}, %s", DID(&pMsg->destId),
|
||||||
pMsg->term, pMsg->voteGranted, s);
|
pMsg->term, pMsg->voteGranted, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t syncSnapInfoDataRealloc(SSnapshot* pSnap, int32_t size) {
|
||||||
|
void* data = taosMemoryRealloc(pSnap->data, size);
|
||||||
|
if (data == NULL) {
|
||||||
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
pSnap->data = data;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue