From ef46a9a9c8e35fcfbc887542e07c7f446d534f0d Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Mon, 6 Apr 2020 14:09:09 +0800 Subject: [PATCH] checksum error --- src/vnode/wal/src/walMain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vnode/wal/src/walMain.c b/src/vnode/wal/src/walMain.c index 9708b0d9dc..569d14bad7 100644 --- a/src/vnode/wal/src/walMain.c +++ b/src/vnode/wal/src/walMain.c @@ -150,7 +150,7 @@ int walWrite(void *handle, SWalHead *pHead) { if (pWal->level == TAOS_WAL_NOLOG) return 0; pHead->signature = walSignature; - taosCalcChecksumAppend(0, (uint8_t *)pHead, sizeof(SWal)); + taosCalcChecksumAppend(0, (uint8_t *)pHead, sizeof(SWalHead)); int contLen = pHead->len + sizeof(SWalHead); if(write(pWal->fd, pHead, contLen) != contLen) { @@ -272,7 +272,7 @@ static int walRestoreWalFile(char *name, void *pVnode, int (*writeFp)(void *, SW break; } - if (taosCheckChecksumWhole((uint8_t *)pHead, sizeof(SWalHead))) { + if (!taosCheckChecksumWhole((uint8_t *)pHead, sizeof(SWalHead))) { wWarn("wal:%s, cksum is messed up, skip the rest of file", name); break; } -- GitLab