fix sync bug

This commit is contained in:
Hongze Cheng 2021-01-21 18:34:00 +08:00
parent ab8fa1d36b
commit 2e6e995593
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ void *tsdbDecodeSMFileEx(void *buf, SMFile *pMFile) {
} }
int tsdbApplyMFileChange(SMFile *from, SMFile *to) { int tsdbApplyMFileChange(SMFile *from, SMFile *to) {
ASSERT(from != NULL || to != NULL); if (from == NULL && to == NULL) return 0;
if (from != NULL) { if (from != NULL) {
if (to == NULL) { if (to == NULL) {

View File

@ -238,7 +238,7 @@ static int32_t tsdbSendMetaInfo(SSyncH *pSynch) {
tlen = tlen + tsdbEncodeSMFileEx(NULL, pMFile) + sizeof(TSCKSUM); tlen = tlen + tsdbEncodeSMFileEx(NULL, pMFile) + sizeof(TSCKSUM);
} }
if (tsdbMakeRoom((void **)(&SYNC_BUFFER(pSynch)), tlen) < 0) { if (tsdbMakeRoom((void **)(&SYNC_BUFFER(pSynch)), tlen + sizeof(tlen)) < 0) {
tsdbError("vgId:%d, failed to makeroom while send metainfo since %s", REPO_ID(pRepo), tstrerror(terrno)); tsdbError("vgId:%d, failed to makeroom while send metainfo since %s", REPO_ID(pRepo), tstrerror(terrno));
return -1; return -1;
} }