提交 29cb13cf 编写于 作者: S Shengliang Guan

update vload info every time

上级 ce661e41
...@@ -322,6 +322,27 @@ static int32_t mndProcessStatusReq(SMnodeMsg *pReq) { ...@@ -322,6 +322,27 @@ static int32_t mndProcessStatusReq(SMnodeMsg *pReq) {
} }
} }
int32_t numOfVloads = (int32_t)taosArrayGetSize(statusReq.pVloads);
for (int32_t v = 0; v < numOfVloads; ++v) {
SVnodeLoad *pVload = taosArrayGet(statusReq.pVloads, v);
SVgObj *pVgroup = mndAcquireVgroup(pMnode, pVload->vgId);
if (pVgroup != NULL) {
if (pVload->role == TAOS_SYNC_STATE_LEADER) {
pVgroup->numOfTables = pVload->numOfTables;
pVgroup->numOfTimeSeries = pVload->numOfTimeSeries;
pVgroup->totalStorage = pVload->totalStorage;
pVgroup->compStorage = pVload->compStorage;
pVgroup->pointsWritten = pVload->pointsWritten;
}
for (int32_t vg = 0; vg < pVgroup->replica; ++vg) {
pVgroup->vnodeGid[vg].role = pVload->role;
}
}
mndReleaseVgroup(pMnode, pVgroup);
}
int64_t curMs = taosGetTimestampMs(); int64_t curMs = taosGetTimestampMs();
bool online = mndIsDnodeOnline(pMnode, pDnode, curMs); bool online = mndIsDnodeOnline(pMnode, pDnode, curMs);
bool dnodeChanged = (statusReq.dver != sdbGetTableVer(pMnode->pSdb, SDB_DNODE)); bool dnodeChanged = (statusReq.dver != sdbGetTableVer(pMnode->pSdb, SDB_DNODE));
...@@ -374,27 +395,6 @@ static int32_t mndProcessStatusReq(SMnodeMsg *pReq) { ...@@ -374,27 +395,6 @@ static int32_t mndProcessStatusReq(SMnodeMsg *pReq) {
pDnode->numOfCores = statusReq.numOfCores; pDnode->numOfCores = statusReq.numOfCores;
pDnode->numOfSupportVnodes = statusReq.numOfSupportVnodes; pDnode->numOfSupportVnodes = statusReq.numOfSupportVnodes;
int32_t numOfVloads = (int32_t)taosArrayGetSize(statusReq.pVloads);
for (int32_t v = 0; v < numOfVloads; ++v) {
SVnodeLoad *pVload = taosArrayGet(statusReq.pVloads, v);
SVgObj *pVgroup = mndAcquireVgroup(pMnode, pVload->vgId);
if (pVgroup != NULL) {
if (pVload->role == TAOS_SYNC_STATE_LEADER) {
pVgroup->numOfTables = pVload->numOfTables;
pVgroup->numOfTimeSeries = pVload->numOfTimeSeries;
pVgroup->totalStorage = pVload->totalStorage;
pVgroup->compStorage = pVload->compStorage;
pVgroup->pointsWritten = pVload->pointsWritten;
}
for (int32_t vg = 0; vg < pVgroup->replica; ++vg) {
pVgroup->vnodeGid[vg].role = pVload->role;
}
}
mndReleaseVgroup(pMnode, pVgroup);
}
SStatusRsp statusRsp = {0}; SStatusRsp statusRsp = {0};
statusRsp.dver = sdbGetTableVer(pMnode->pSdb, SDB_DNODE); statusRsp.dver = sdbGetTableVer(pMnode->pSdb, SDB_DNODE);
statusRsp.dnodeCfg.dnodeId = pDnode->id; statusRsp.dnodeCfg.dnodeId = pDnode->id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册