From 5abb8224cf6418a00e28b5790d09ec1b2cd296be Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sun, 17 Jan 2021 15:18:16 +0800 Subject: [PATCH] fix more bug --- src/tsdb/src/tsdbFS.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tsdb/src/tsdbFS.c b/src/tsdb/src/tsdbFS.c index 1b1c8b70b4..9b0c94aed3 100644 --- a/src/tsdb/src/tsdbFS.c +++ b/src/tsdb/src/tsdbFS.c @@ -334,7 +334,7 @@ static int tsdbApplyFSTxn(STsdbFS *pfs, int vid) { ASSERT(taosArrayGetSize(pfs->nstatus->df) == 0); fsheader.len = 0; } else { - fsheader.len = tsdbEncodeFSHeader(NULL, &fsheader) + sizeof(TSCKSUM); + fsheader.len = tsdbEncodeFSStatus(NULL, pfs->nstatus) + sizeof(TSCKSUM); } // Encode header part and write @@ -598,15 +598,15 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) { goto _err; } + SFSStatus *pStatus = pfs->cstatus; ptr = buffer; ptr = tsdbDecodeFSHeader(ptr, &fsheader); + ptr = tsdbDecodeFSMeta(ptr, &(pStatus->meta)); if (fsheader.version != TSDB_FS_VERSION) { // TODO: handle file version change } - SFSStatus *pStatus = pfs->cstatus; - if (fsheader.len > 0) { if (tsdbMakeRoom(&buffer, fsheader.len) < 0) { goto _err; @@ -632,7 +632,6 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) { } ptr = buffer; - ptr = tsdbDecodeFSMeta(ptr, &(pStatus->meta)); ptr = tsdbDecodeFSStatus(ptr, pStatus); } else { tsdbResetFSStatus(pStatus);