revert drop vnode
This commit is contained in:
parent
d85d698074
commit
4448e7d159
|
@ -305,18 +305,11 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t numOfDropped = 0;
|
pMgmt->state.totalVnodes = numOfVnodes;
|
||||||
for (int32_t v = 0; v < numOfVnodes; ++v){
|
|
||||||
if(pCfgs[v].dropped == 1) numOfDropped++;
|
|
||||||
}
|
|
||||||
|
|
||||||
dInfo("there are %d dropped vnodes", numOfDropped);
|
|
||||||
|
|
||||||
pMgmt->state.totalVnodes = numOfVnodes - numOfDropped;
|
|
||||||
|
|
||||||
int32_t threadNum = tsNumOfCores / 2;
|
int32_t threadNum = tsNumOfCores / 2;
|
||||||
if (threadNum < 1) threadNum = 1;
|
if (threadNum < 1) threadNum = 1;
|
||||||
int32_t vnodesPerThread = (numOfVnodes - numOfDropped) / threadNum + 1;
|
int32_t vnodesPerThread = numOfVnodes / threadNum + 1;
|
||||||
|
|
||||||
SVnodeThread *threads = taosMemoryCalloc(threadNum, sizeof(SVnodeThread));
|
SVnodeThread *threads = taosMemoryCalloc(threadNum, sizeof(SVnodeThread));
|
||||||
for (int32_t t = 0; t < threadNum; ++t) {
|
for (int32_t t = 0; t < threadNum; ++t) {
|
||||||
|
@ -326,13 +319,12 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t v = 0; v < numOfVnodes; ++v) {
|
for (int32_t v = 0; v < numOfVnodes; ++v) {
|
||||||
if(pCfgs[v].dropped == 1) continue;
|
|
||||||
int32_t t = v % threadNum;
|
int32_t t = v % threadNum;
|
||||||
SVnodeThread *pThread = &threads[t];
|
SVnodeThread *pThread = &threads[t];
|
||||||
pThread->pCfgs[pThread->vnodeNum++] = pCfgs[v];
|
pThread->pCfgs[pThread->vnodeNum++] = pCfgs[v];
|
||||||
}
|
}
|
||||||
|
|
||||||
dInfo("open %d vnodes with %d threads", numOfVnodes - numOfDropped, threadNum);
|
dInfo("open %d vnodes with %d threads", numOfVnodes, threadNum);
|
||||||
|
|
||||||
for (int32_t t = 0; t < threadNum; ++t) {
|
for (int32_t t = 0; t < threadNum; ++t) {
|
||||||
SVnodeThread *pThread = &threads[t];
|
SVnodeThread *pThread = &threads[t];
|
||||||
|
@ -373,7 +365,7 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dInfo("successfully opened %d vnodes, %d dropped vnodes", pMgmt->state.totalVnodes, numOfDropped);
|
dInfo("successfully opened %d vnodes", pMgmt->state.totalVnodes);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue