Skip to content

add dropped count while open vnodes #28207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add dropped count while open vnodes
  • Loading branch information
xiao-77 committed Sep 30, 2024
commit 01a648bcc9d65afe858d925e4b05ca318730219f
5 changes: 3 additions & 2 deletions include/common/tmsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,7 @@ typedef struct {

typedef struct {
int32_t openVnodes;
int32_t dropVnodes;
int32_t totalVnodes;
int32_t masterNum;
int64_t numOfSelectReqs;
Expand Down Expand Up @@ -2822,8 +2823,8 @@ enum {
TOPIC_SUB_TYPE__COLUMN,
};

#define DEFAULT_MAX_POLL_INTERVAL 300000
#define DEFAULT_SESSION_TIMEOUT 12000
#define DEFAULT_MAX_POLL_INTERVAL 300000
#define DEFAULT_SESSION_TIMEOUT 12000

typedef struct {
char name[TSDB_TOPIC_FNAME_LEN]; // accout.topic
Expand Down
1 change: 1 addition & 0 deletions source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef struct {
typedef struct {
int32_t vnodeNum;
int32_t opened;
int32_t dropped;
int32_t failed;
bool updateVnodesList;
int32_t threadIndex;
Expand Down
8 changes: 5 additions & 3 deletions source/dnode/mgmt/mgmt_vnode/src/vmInt.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ static void *vmOpenVnodeInThread(void *param) {
snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, pCfg->vgId);
vnodeDestroy(pCfg->vgId, path, pMgmt->pTfs, 0);
pThread->updateVnodesList = true;
pThread->dropped++;
(void)atomic_add_fetch_32(&pMgmt->state.dropVnodes, 1);
continue;
}

Expand Down Expand Up @@ -352,8 +354,8 @@ static void *vmOpenVnodeInThread(void *param) {
(void)atomic_add_fetch_32(&pMgmt->state.openVnodes, 1);
}

dInfo("thread:%d, numOfVnodes:%d, opened:%d failed:%d", pThread->threadIndex, pThread->vnodeNum, pThread->opened,
pThread->failed);
dInfo("thread:%d, numOfVnodes:%d, opened:%d dropped:%d failed:%d", pThread->threadIndex, pThread->vnodeNum,
pThread->opened, pThread->dropped, pThread->failed);
return NULL;
}

Expand Down Expand Up @@ -427,7 +429,7 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
taosMemoryFree(threads);
taosMemoryFree(pCfgs);

if (pMgmt->state.openVnodes != pMgmt->state.totalVnodes) {
if ((pMgmt->state.openVnodes + pMgmt->state.dropVnodes) != pMgmt->state.totalVnodes) {
dError("there are total vnodes:%d, opened:%d", pMgmt->state.totalVnodes, pMgmt->state.openVnodes);
terrno = TSDB_CODE_VND_INIT_FAILED;
return -1;
Expand Down