From bf3e692374844dd4cc10da3ac56e8f1235c4bab5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 17 Nov 2020 03:03:07 +0000 Subject: [PATCH] TD-2065 --- src/inc/taoserror.h | 2 +- src/sync/inc/syncInt.h | 2 +- src/vnode/src/vnodeMain.c | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/inc/taoserror.h b/src/inc/taoserror.h index 7d13e16c46..1aa9095b30 100644 --- a/src/inc/taoserror.h +++ b/src/inc/taoserror.h @@ -201,7 +201,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_SUCH_FILE_OR_DIR, 0, 0x0507, "Missing da TAOS_DEFINE_ERROR(TSDB_CODE_VND_OUT_OF_MEMORY, 0, 0x0508, "Out of memory") TAOS_DEFINE_ERROR(TSDB_CODE_VND_APP_ERROR, 0, 0x0509, "Unexpected generic error in vnode") TAOS_DEFINE_ERROR(TSDB_CODE_VND_INVALID_VRESION_FILE, 0, 0x050A, "Invalid version file") -TAOS_DEFINE_ERROR(TSDB_CODE_VND_IS_FULL, 0, 0x050B, "Vnode memory is full for commit is failed") +TAOS_DEFINE_ERROR(TSDB_CODE_VND_IS_FULL, 0, 0x050B, "Vnode memory is full because commit failed") TAOS_DEFINE_ERROR(TSDB_CODE_VND_NOT_SYNCED, 0, 0x0511, "Database suspended") TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_WRITE_AUTH, 0, 0x0512, "Write operation denied") diff --git a/src/sync/inc/syncInt.h b/src/sync/inc/syncInt.h index cb452752e5..7156a2d08a 100644 --- a/src/sync/inc/syncInt.h +++ b/src/sync/inc/syncInt.h @@ -36,7 +36,7 @@ extern "C" { #define TAOS_SMSG_STATUS 7 #define SYNC_MAX_SIZE (TSDB_MAX_WAL_SIZE + sizeof(SWalHead) + sizeof(SSyncHead) + 16) -#define SYNC_RECV_BUFFER_SIZE (5*1024*1024) +#define SYNC_RECV_BUFFER_SIZE (5*1024*1024) #define nodeRole pNode->peerInfo[pNode->selfIndex]->role #define nodeVersion pNode->peerInfo[pNode->selfIndex]->version diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index 26b3b7233c..7447acc488 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -419,7 +419,11 @@ void vnodeRelease(void *pVnodeRaw) { } if (pVnode->wal) { - if (code == 0) walRemoveAllOldFiles(pVnode->wal); + if (code != 0) { + vError("vgId:%d, failed to commit while close tsdb repo, keep wal", pVnode->vgId); + } else { + walRemoveAllOldFiles(pVnode->wal); + } walClose(pVnode->wal); pVnode->wal = NULL; } -- GitLab