From c693384ec4c794087d3d7f1f603f9c72cdf1f3ed Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Sun, 9 Oct 2022 11:58:28 +0800 Subject: [PATCH] enh: replace asserts with error logs in walReadVer --- source/libs/wal/src/walRead.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/wal/src/walRead.c b/source/libs/wal/src/walRead.c index 248ab91fab..1ac15e4bb8 100644 --- a/source/libs/wal/src/walRead.c +++ b/source/libs/wal/src/walRead.c @@ -476,7 +476,7 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) { } else { terrno = TSDB_CODE_WAL_FILE_CORRUPTED; } - ASSERT(0); + wError("vgId:%d, failed to read WAL record head from log file since %s", pReader->pWal->cfg.vgId, terrstr()); taosThreadMutexUnlock(&pReader->mutex); return -1; } @@ -509,6 +509,7 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) { else { terrno = TSDB_CODE_WAL_FILE_CORRUPTED; } + wError("vgId:%d, failed to read WAL record body from log file since %s", pReader->pWal->cfg.vgId, terrstr()); taosThreadMutexUnlock(&pReader->mutex); return -1; }