From 478eec76a4e3eb9f77aef91c33b004637d4d6ac9 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 16 Jan 2023 16:34:12 +0800 Subject: [PATCH] enh: update epset on dnode info changed --- source/dnode/mgmt/node_util/src/dmEps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 0e8a1a0748..2b06a24a54 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -428,9 +428,11 @@ static int32_t dmDecodeEpPairs(SJson *pJson, SDnodeData *pData) { void dmRemoveDnodePairs(SDnodeData *pData) { char file[PATH_MAX] = {0}; + char bak[PATH_MAX] = {0}; snprintf(file, sizeof(file), "%s%sdnode%sep.json", tsDataDir, TD_DIRSEP, TD_DIRSEP); - dInfo("dnode file:%s is removed", file); - (void)taosRemoveFile(file); + snprintf(bak, sizeof(bak), "%s%sdnode%sep.json.bak", tsDataDir, TD_DIRSEP, TD_DIRSEP); + dInfo("dnode file:%s is rename to bak file", file); + (void)taosRenameFile(file, bak); } static int32_t dmReadDnodePairs(SDnodeData *pData) {