Add unapplied to show vnodes.
This commit is contained in:
parent
b62d8d37b1
commit
a1a3f83283
|
@ -372,6 +372,7 @@ static const SSysDbTableSchema vnodesSchema[] = {
|
|||
{.name = "start_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
|
||||
{.name = "restored", .bytes = 1, .type = TSDB_DATA_TYPE_BOOL, .sysInfo = true},
|
||||
{.name = "restored_finish", .bytes = TSDB_SYNC_RESOTRE_lEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
|
||||
{.name = "unapplied", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true},
|
||||
};
|
||||
|
||||
static const SSysDbTableSchema userUserPrivilegesSchema[] = {
|
||||
|
|
|
@ -1345,11 +1345,11 @@ static int32_t mndRetrieveVnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
|
|||
return code;
|
||||
}
|
||||
|
||||
int64_t unappliedCount = pGid->syncCommitIndex - pGid->syncAppliedIndex;
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
char restoreStr[20] = {0};
|
||||
if (!pGid->syncRestore) {
|
||||
calculateRstoreFinishTime(pGid->appliedRate, pGid->syncCommitIndex - pGid->syncAppliedIndex, restoreStr,
|
||||
sizeof(restoreStr));
|
||||
calculateRstoreFinishTime(pGid->appliedRate, unappliedCount, restoreStr, sizeof(restoreStr));
|
||||
}
|
||||
STR_TO_VARSTR(buf, restoreStr);
|
||||
colDataSetVal(pColInfo, numOfRows, (const char *)&buf, false);
|
||||
|
@ -1358,6 +1358,13 @@ static int32_t mndRetrieveVnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
|
|||
return code;
|
||||
}
|
||||
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
code = colDataSetVal(pColInfo, numOfRows, (const char *)&unappliedCount, false);
|
||||
if (code != 0) {
|
||||
mError("vgId:%d, failed to set syncRestore, since %s", pVgroup->vgId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
numOfRows++;
|
||||
sdbRelease(pSdb, pDnode);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue