From 74384547f5318011a6a4596142eb54f88e321462 Mon Sep 17 00:00:00 2001 From: root <314218900@qq.com> Date: Mon, 13 Jun 2022 14:36:28 +0800 Subject: [PATCH] Failed to start TDengine server service.(vnode tsdb data file has wrong size , report to upper layer to fix it) #13529 --- src/tsdb/inc/tsdbFile.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tsdb/inc/tsdbFile.h b/src/tsdb/inc/tsdbFile.h index 4ad1e5b317..6b275b31e9 100644 --- a/src/tsdb/inc/tsdbFile.h +++ b/src/tsdb/inc/tsdbFile.h @@ -257,11 +257,11 @@ static FORCE_INLINE int tsdbAppendDFile(SDFile* pDFile, void* buf, int64_t nbyte return -1; } - //bug fix. To avoid data corruption, close the data file in advance. - //ASSERT(pDFile->info.size == toffset); + //bug fix. To avoid data corruption, + //the end offset of current file should be checked with file size, + //if not equal, known as file corrupted and return error. if (pDFile->info.size != toffset) { - tsdbCloseDFile(pDFile); - terrno = TAOS_SYSTEM_ERROR(errno); + terrno = TSDB_CODE_TDB_FILE_CORRUPTED; return -1; } -- GitLab