提交 5abb8224 编写于 作者: H Hongze Cheng

fix more bug

上级 6192fa9b
...@@ -334,7 +334,7 @@ static int tsdbApplyFSTxn(STsdbFS *pfs, int vid) { ...@@ -334,7 +334,7 @@ static int tsdbApplyFSTxn(STsdbFS *pfs, int vid) {
ASSERT(taosArrayGetSize(pfs->nstatus->df) == 0); ASSERT(taosArrayGetSize(pfs->nstatus->df) == 0);
fsheader.len = 0; fsheader.len = 0;
} else { } else {
fsheader.len = tsdbEncodeFSHeader(NULL, &fsheader) + sizeof(TSCKSUM); fsheader.len = tsdbEncodeFSStatus(NULL, pfs->nstatus) + sizeof(TSCKSUM);
} }
// Encode header part and write // Encode header part and write
...@@ -598,15 +598,15 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) { ...@@ -598,15 +598,15 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) {
goto _err; goto _err;
} }
SFSStatus *pStatus = pfs->cstatus;
ptr = buffer; ptr = buffer;
ptr = tsdbDecodeFSHeader(ptr, &fsheader); ptr = tsdbDecodeFSHeader(ptr, &fsheader);
ptr = tsdbDecodeFSMeta(ptr, &(pStatus->meta));
if (fsheader.version != TSDB_FS_VERSION) { if (fsheader.version != TSDB_FS_VERSION) {
// TODO: handle file version change // TODO: handle file version change
} }
SFSStatus *pStatus = pfs->cstatus;
if (fsheader.len > 0) { if (fsheader.len > 0) {
if (tsdbMakeRoom(&buffer, fsheader.len) < 0) { if (tsdbMakeRoom(&buffer, fsheader.len) < 0) {
goto _err; goto _err;
...@@ -632,7 +632,6 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) { ...@@ -632,7 +632,6 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) {
} }
ptr = buffer; ptr = buffer;
ptr = tsdbDecodeFSMeta(ptr, &(pStatus->meta));
ptr = tsdbDecodeFSStatus(ptr, pStatus); ptr = tsdbDecodeFSStatus(ptr, pStatus);
} else { } else {
tsdbResetFSStatus(pStatus); tsdbResetFSStatus(pStatus);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册