Merge pull request #22617 from taosdata/FIX/TD-25995-3.0

enh: adjust criteria of completion to retrieve SShowObj info from mnode in mndProcessSysTableReq
This commit is contained in:
wade zhang 2023-08-30 11:33:13 +08:00 committed by GitHub
commit bbed968256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -329,7 +329,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) {
pReq->info.rsp = pRsp;
pReq->info.rspLen = size;
if (rowsRead == 0 || ((rowsRead < rowsToRead) && !pShow->restore)) {
if (rowsRead == 0 || mndCheckRetrieveFinished(pShow)) {
pRsp->completed = 1;
mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id);
mndReleaseShowObj(pShow, true);

View File

@ -1324,7 +1324,14 @@ static int32_t mndRetrieveIdx(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
pShow->pIter = taosMemoryCalloc(1, sizeof(SSmaAndTagIter));
}
int32_t read = mndRetrieveSma(pReq, pShow, pBlock, rows);
if (read < rows) read += mndRetrieveTagIdx(pReq, pShow, pBlock, rows - read);
if (read < rows) {
read += mndRetrieveTagIdx(pReq, pShow, pBlock, rows - read);
}
// no more to read
if (read < rows) {
taosMemoryFree(pShow->pIter);
pShow->pIter = NULL;
}
return read;
}
static void mndCancelRetrieveIdx(SMnode *pMnode, void *pIter) {

View File

@ -1091,7 +1091,7 @@ static int32_t mndRetrieveVnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
int32_t cols = 0;
int64_t curMs = taosGetTimestampMs();
while (numOfRows < rows) {
while (numOfRows < rows - TSDB_MAX_REPLICA) {
pShow->pIter = sdbFetch(pSdb, SDB_VGROUP, pShow->pIter, (void **)&pVgroup);
if (pShow->pIter == NULL) break;