From 2e6e9955933b878c97c105857f8d76179b755843 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 21 Jan 2021 18:34:00 +0800 Subject: [PATCH] fix sync bug --- src/tsdb/src/tsdbFile.c | 2 +- src/tsdb/src/tsdbSync.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tsdb/src/tsdbFile.c b/src/tsdb/src/tsdbFile.c index 01d264b59c..a2f1e2aac3 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 b40a667d79..226f6c2076 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; } -- GitLab