Skip to content
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

enh: adjust criteria of completion to retrieve SShowObj info from mnode in mndProcessSysTableReq #22617

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/dnode/mnode/impl/src/mndShow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 8 additions & 1 deletion source/dnode/mnode/impl/src/mndSma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion source/dnode/mnode/impl/src/mndVgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down