fix filter error

This commit is contained in:
yihaoDeng 2023-02-08 23:04:49 +08:00
parent 4b6c073623
commit 9ba5381b5a
1 changed files with 5 additions and 3 deletions

View File

@ -1268,6 +1268,8 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
int count = 0; int count = 0;
int32_t valid = 0; int32_t valid = 0;
static const int8_t TRY_ERROR_LIMIT = 4;
while (1) { while (1) {
void *entryKey = NULL, *entryVal = NULL; void *entryKey = NULL, *entryVal = NULL;
int32_t nEntryKey, nEntryVal; int32_t nEntryKey, nEntryVal;
@ -1279,7 +1281,7 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
STagIdxKey *p = entryKey; STagIdxKey *p = entryKey;
if (p == NULL) break; if (p == NULL) break;
if (count >= 4) { if (count >= TRY_ERROR_LIMIT) {
if (p->type != pCursor->type || p->suid != pCursor->suid || p->cid != pCursor->cid) { if (p->type != pCursor->type || p->suid != pCursor->suid || p->cid != pCursor->cid) {
break; break;
} }
@ -1305,11 +1307,11 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
} }
taosArrayPush(pUids, &tuid); taosArrayPush(pUids, &tuid);
} else if (cmp == 1) { } else if (cmp == 1) {
if (count >= 4) break; if (count >= TRY_ERROR_LIMIT) break;
// not match but should continue to iter // not match but should continue to iter
} else { } else {
// not match and no more result // not match and no more result
if (count >= 4) break; if (count >= TRY_ERROR_LIMIT) break;
} }
count++; count++;
valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur); valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur);