未验证 提交 90cfb150 编写于 作者: W wade zhang 提交者: GitHub

Merge pull request #13776 from taosdata/fix/issue-13529

fix: port the fixing of issue 13529 from develop to 2.6
......@@ -257,7 +257,13 @@ static FORCE_INLINE int tsdbAppendDFile(SDFile* pDFile, void* buf, int64_t nbyte
return -1;
}
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) {
terrno = TSDB_CODE_TDB_FILE_CORRUPTED;
return -1;
}
if (offset) {
*offset = toffset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册