From 47e6a753efd673e99be099dad2e381af4a3a9829 Mon Sep 17 00:00:00 2001 From: kailixu Date: Fri, 6 Jan 2023 16:52:34 +0800 Subject: [PATCH] fix: primary disk for taosd -u --- src/dnode/inc/dnodeInt.h | 1 + src/dnode/src/dnodeSystem.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dnode/inc/dnodeInt.h b/src/dnode/inc/dnodeInt.h index 7abff37383..dd4a6b992e 100644 --- a/src/dnode/inc/dnodeInt.h +++ b/src/dnode/inc/dnodeInt.h @@ -24,6 +24,7 @@ extern "C" { #include "tlog.h" #include "trpc.h" #include "tglobal.h" +#include "tfs.h" #include "dnode.h" #include "vnode.h" diff --git a/src/dnode/src/dnodeSystem.c b/src/dnode/src/dnodeSystem.c index e9a452726a..d8c7a10120 100644 --- a/src/dnode/src/dnodeSystem.c +++ b/src/dnode/src/dnodeSystem.c @@ -120,7 +120,15 @@ int32_t main(int32_t argc, char *argv[]) { if (0 != dump_cluster) { taosInitGlobalCfg(); - taosReadGlobalCfg(); + if (!taosReadGlobalCfg()) { + printf("TDengine read global config failed\n"); + exit(EXIT_FAILURE); + } + if (tfsInit(tsDiskCfg, tsDiskCfgNum) < 0) { + printf("failed to init TFS since %s", tstrerror(terrno)); + return -1; + } + strncpy(tsDataDir, TFS_PRIMARY_PATH(), TSDB_FILENAME_LEN); grantParseParameter("-u"); exit(EXIT_SUCCESS); } -- GitLab