From 90830e54104512882bbf5c9e9c88645e15b00777 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Mon, 9 Jan 2023 09:08:28 +0800 Subject: [PATCH 1/3] fix: use pInfo->info.state.committed instead of the current one for async vnodeCommit --- source/dnode/vnode/src/vnd/vnodeCommit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 6c54c3cb5c..9a69299d9d 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -294,7 +294,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { SVnode *pVnode = pInfo->pVnode; vInfo("vgId:%d, start to commit, commitId:%" PRId64 " version:%" PRId64 " term: %" PRId64, TD_VID(pVnode), - pVnode->state.commitID, pVnode->state.applied, pVnode->state.applyTerm); + pInfo->info.state.commitID, pInfo->info.state.committed, pVnode->state.commitTerm); // persist wal before starting if (walPersist(pVnode->pWal) < 0) { @@ -308,8 +308,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { snprintf(dir, TSDB_FILENAME_LEN, "%s", pVnode->path); } - // walBeginSnapshot(pVnode->pWal, pVnode->state.applied); - syncBeginSnapshot(pVnode->sync, pVnode->state.applied); + syncBeginSnapshot(pVnode->sync, pInfo->info.state.committed); // commit each sub-system code = tsdbCommit(pVnode->pTsdb, pInfo); @@ -351,7 +350,6 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { return -1; } - // walEndSnapshot(pVnode->pWal); syncEndSnapshot(pVnode->sync); _exit: From d4d329ecce0250a4002b0b8b504eaed5d7219e34 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 9 Jan 2023 10:18:12 +0800 Subject: [PATCH 2/3] fix: rename global variables --- source/dnode/mgmt/node_mgmt/src/dmEnv.c | 6 +++--- source/libs/sync/inc/syncRaftStore.h | 2 -- source/libs/sync/src/syncRaftStore.c | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmEnv.c b/source/dnode/mgmt/node_mgmt/src/dmEnv.c index 1d0236c0c5..acf96ad397 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmEnv.c +++ b/source/dnode/mgmt/node_mgmt/src/dmEnv.c @@ -16,9 +16,9 @@ #define _DEFAULT_SOURCE #include "dmMgmt.h" -static SDnode global = {0}; +static SDnode globalDnode = {0}; -SDnode *dmInstance() { return &global; } +SDnode *dmInstance() { return &globalDnode; } static int32_t dmCheckRepeatInit(SDnode *pDnode) { if (atomic_val_compare_exchange_8(&pDnode->once, DND_ENV_INIT, DND_ENV_READY) != DND_ENV_INIT) { @@ -270,6 +270,6 @@ void dmReportStartup(const char *pName, const char *pDesc) { } int64_t dmGetClusterId() { - return global.data.clusterId; + return globalDnode.data.clusterId; } diff --git a/source/libs/sync/inc/syncRaftStore.h b/source/libs/sync/inc/syncRaftStore.h index bb6405f6b2..28faf8ea6d 100644 --- a/source/libs/sync/inc/syncRaftStore.h +++ b/source/libs/sync/inc/syncRaftStore.h @@ -37,8 +37,6 @@ typedef struct SRaftStore { SRaftStore *raftStoreOpen(const char *path); int32_t raftStoreClose(SRaftStore *pRaftStore); int32_t raftStorePersist(SRaftStore *pRaftStore); -int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len); -int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len); bool raftStoreHasVoted(SRaftStore *pRaftStore); void raftStoreVote(SRaftStore *pRaftStore, SRaftId *pRaftId); diff --git a/source/libs/sync/src/syncRaftStore.c b/source/libs/sync/src/syncRaftStore.c index b19cda2a44..8ef3ceeae7 100644 --- a/source/libs/sync/src/syncRaftStore.c +++ b/source/libs/sync/src/syncRaftStore.c @@ -20,6 +20,8 @@ // private function static int32_t raftStoreInit(SRaftStore *pRaftStore); static bool raftStoreFileExist(char *path); +static int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len); +static int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len); // public function SRaftStore *raftStoreOpen(const char *path) { From 902ab5b12f9238ee1ea03d49654b73adc816148a Mon Sep 17 00:00:00 2001 From: Xuefeng Tan <1172915550@qq.com> Date: Mon, 9 Jan 2023 11:36:36 +0800 Subject: [PATCH 3/3] fix: get vgid in batch (#19437) --- cmake/taosadapter_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index 3e2e879e38..ab1609f35f 100644 --- a/cmake/taosadapter_CMakeLists.txt.in +++ b/cmake/taosadapter_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosadapter ExternalProject_Add(taosadapter GIT_REPOSITORY https://github.com/taosdata/taosadapter.git - GIT_TAG a2e9920 + GIT_TAG 69eee2e SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE