diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index e08a56fb326849b63bf511ca8cc8d80103f6f881..054c8942516702efeb64f9b7c9e26a3d5c28c847 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -131,7 +131,6 @@ extern char tsDataDir[]; extern char tsLogDir[]; extern char tsScriptDir[]; extern int64_t tsMsPerDay[3]; -extern char tsVnodeBakDir[]; // system info extern char tsOsName[]; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index c24ba490ba7f4cb25ba032b0404790d68540c826..c02c8af1e4d4a0fbbddd9228f147a88091148f7f 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -160,7 +160,6 @@ char tsDnodeDir[TSDB_FILENAME_LEN] = {0}; char tsMnodeDir[TSDB_FILENAME_LEN] = {0}; char tsDataDir[TSDB_FILENAME_LEN] = {0}; char tsScriptDir[TSDB_FILENAME_LEN] = {0}; -char tsVnodeBakDir[TSDB_FILENAME_LEN] = {0}; /* * minimum scale for whole system, millisecond by default diff --git a/src/dnode/src/dnodeMain.c b/src/dnode/src/dnodeMain.c index 6abe55e22751c0ee175216fd688df47d4599cfd8..995734b3315d2fe2e08200c3c312a50c9a7b6167 100644 --- a/src/dnode/src/dnodeMain.c +++ b/src/dnode/src/dnodeMain.c @@ -181,15 +181,17 @@ static int32_t dnodeInitStorage() { dError("failed to add disks to dnode tier since %s", tstrerror(terrno)); return -1; } + strncpy(tsDataDir, DNODE_PRIMARY_DISK(pDnodeTier)->dir, TSDB_FILENAME_LEN); + tdGetVnodeRootDir(tsDataDir, tsVnodeDir); //TODO(dengyihao): no need to init here - tdGetMnodeRootDir(DNODE_PRIMARY_DISK(pDnodeTier)->dir, tsMnodeDir); + tdGetMnodeRootDir(tsDataDir, tsMnodeDir); if (dnodeCreateDir(tsMnodeDir) < 0) { dError("failed to create dir: %s, reason: %s", tsMnodeDir, strerror(errno)); return -1; } - tdGetDnodeRootDir(DNODE_PRIMARY_DISK(pDnodeTier)->dir, tsDnodeDir); + tdGetDnodeRootDir(tsDataDir, tsDnodeDir); if (dnodeCreateDir(tsDnodeDir) < 0) { dError("failed to create dir: %s, reason: %s", tsDnodeDir, strerror(errno)); return -1;