“101b5dd7c7f0606ef489b584262fb2320bca5cca”上不存在“...cn/images/git@gitcode.net:taosdata/tdengine.git”
提交 55ad0357 编写于 作者: H Hongze Cheng

refactor more code

上级 d0f1e625
...@@ -303,27 +303,28 @@ static int tsdbCommitToFileGroup(STsdbRepo *pRepo, SFileGroup *pOldGroup, SFileG ...@@ -303,27 +303,28 @@ static int tsdbCommitToFileGroup(STsdbRepo *pRepo, SFileGroup *pOldGroup, SFileG
for (int tid = 1; tid < pTSCh->maxIters; tid++) { for (int tid = 1; tid < pTSCh->maxIters; tid++) {
if (tsdbCommitTableData(pTSCh, tid) < 0) { if (tsdbCommitTableData(pTSCh, tid) < 0) {
tsdbHelperCloseFile(pWHelper, true /* hasError = false */); tsdbCloseAndUnsetCommitFGroup(pTSCh, true /* hasError = true */);
return -1; return -1;
} }
if (tsdbTryMoveLastBlock(pTSCh) < 0) { if (tsdbTryMoveLastBlock(pTSCh) < 0) {
tsdbHelperCloseFile(pWHelper, true /* hasError = false */); tsdbCloseAndUnsetCommitFGroup(pTSCh, true /* hasError = true */);
return -1; return -1;
} }
if (tsdbWriteBlockInfo(pWHelper) < 0) { if (tsdbWriteBlockInfo(pWHelper) < 0) {
tsdbHelperCloseFile(pWHelper, true /* hasError = false */); tsdbCloseAndUnsetCommitFGroup(pTSCh, true /* hasError = true */);
return -1; return -1;
} }
} }
if (tsdbWriteBlockIdx(pWHelper) < 0) { if (tsdbWriteBlockIdx(pWHelper) < 0) {
tsdbHelperCloseFile(pWHelper, true /* hasError = false */); tsdbCloseAndUnsetCommitFGroup(pTSCh, true /* hasError = true */);
return -1; return -1;
} }
tsdbHelperCloseFile(pWHelper, false /* hasError = false */); tsdbCloseAndUnsetCommitFGroup(pTSCh, false /* hasError = true */);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册