diff --git a/src/tsdb/src/tsdbFile.c b/src/tsdb/src/tsdbFile.c index 01d264b59c0b1ecd1d54d67a6ad5eec4d3addad8..a2f1e2aac320c249534c5b8fbe2c2292b12a1f90 100644 --- a/src/tsdb/src/tsdbFile.c +++ b/src/tsdb/src/tsdbFile.c @@ -86,7 +86,7 @@ void *tsdbDecodeSMFileEx(void *buf, SMFile *pMFile) { } int tsdbApplyMFileChange(SMFile *from, SMFile *to) { - ASSERT(from != NULL || to != NULL); + if (from == NULL && to == NULL) return 0; if (from != NULL) { if (to == NULL) { diff --git a/src/tsdb/src/tsdbSync.c b/src/tsdb/src/tsdbSync.c index b40a667d79eaa220bf6973bcf269b95a0c86b702..226f6c207608c46d75a0615a2fcc64d18af18603 100644 --- a/src/tsdb/src/tsdbSync.c +++ b/src/tsdb/src/tsdbSync.c @@ -238,7 +238,7 @@ static int32_t tsdbSendMetaInfo(SSyncH *pSynch) { 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)); return -1; }