From 90173d94c814182c6b5f7470e001d68f5c2b458a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 9 Aug 2020 05:33:08 +0000 Subject: [PATCH] TD-1102 --- src/vnode/src/vnodeMain.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index 6abd255dc4..9695f90c30 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -251,10 +251,17 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { appH.cqCreateFunc = cqCreate; appH.cqDropFunc = cqDrop; sprintf(temp, "%s/tsdb", rootDir); + + terrno = 0; pVnode->tsdb = tsdbOpenRepo(temp, &appH); if (pVnode->tsdb == NULL) { vnodeCleanUp(pVnode); return terrno; + } else if (terrno != 0 && pVnode->syncCfg.replica <= 1) { + vError("vgId:%d, failed to open tsdb, replica:%d reason:%s", pVnode->vgId, pVnode->syncCfg.replica, + tstrerror(terrno)); + vnodeCleanUp(pVnode); + return terrno; } sprintf(temp, "%s/wal", rootDir);