fix: remove meaningless error logs when fetching child table metadata. (#30201)
* Enh: remove useless error logs. * Fix: solving performance issues. * fix: format code --------- Co-authored-by: Simon Guan <slguan@taosdata.com>
This commit is contained in:
parent
a70e840df6
commit
2523e60d3b
|
@ -1030,7 +1030,7 @@ int32_t ctgdShowStatInfo(void);
|
|||
int32_t ctgRemoveTbMetaFromCache(SCatalog* pCtg, SName* pTableName, bool syncReq);
|
||||
int32_t ctgGetTbMetaFromCache(SCatalog* pCtg, SCtgTbMetaCtx* ctx, STableMeta** pTableMeta);
|
||||
int32_t ctgGetTbMetasFromCache(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgTbMetasCtx* ctx, int32_t dbIdx,
|
||||
int32_t* fetchIdx, int32_t baseResIdx, SArray* pList);
|
||||
int32_t* fetchIdx, int32_t baseResIdx, SArray* pList, bool autoCreate);
|
||||
int32_t ctgGetTbNamesFromCache(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgTbNamesCtx* ctx, int32_t dbIdx,
|
||||
int32_t* fetchIdx, int32_t baseResIdx, SArray* pList);
|
||||
int32_t ctgCloneDbCfgInfo(void* pSrc, SDbCfgInfo** ppDst);
|
||||
|
|
|
@ -3263,7 +3263,7 @@ int32_t ctgLaunchGetTbMetasTask(SCtgTask* pTask) {
|
|||
autoCreate = pReq->autoCreate;
|
||||
|
||||
ctgDebug("start to check tb metas in db:%s, tbNum:%d", pReq->dbFName, (int32_t)taosArrayGetSize(pReq->pTables));
|
||||
CTG_ERR_RET(ctgGetTbMetasFromCache(pCtg, pConn, pCtx, i, &fetchIdx, baseResIdx, pReq->pTables));
|
||||
CTG_ERR_RET(ctgGetTbMetasFromCache(pCtg, pConn, pCtx, i, &fetchIdx, baseResIdx, pReq->pTables, autoCreate));
|
||||
baseResIdx += taosArrayGetSize(pReq->pTables);
|
||||
}
|
||||
|
||||
|
@ -3301,7 +3301,7 @@ int32_t ctgLaunchGetTbMetasTask(SCtgTask* pTask) {
|
|||
}
|
||||
|
||||
SCtgTaskReq tReq;
|
||||
tReq.autoCreateCtb = (autoCreate && i == pCtx->fetchNum - 1) ? 1 : 0;
|
||||
tReq.autoCreateCtb = (pFetch->flag & CTG_FLAG_NOT_STB) ? 1 : 0;
|
||||
tReq.pTask = pTask;
|
||||
tReq.msgIdx = pFetch->fetchIdx;
|
||||
CTG_ERR_RET(ctgAsyncRefreshTbMeta(&tReq, pFetch->flag, pName, &pFetch->vgId));
|
||||
|
|
|
@ -3483,7 +3483,7 @@ int32_t ctgGetTbMetaBFromCache(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
#endif
|
||||
|
||||
int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMetasCtx *ctx, int32_t dbIdx,
|
||||
int32_t *fetchIdx, int32_t baseResIdx, SArray *pList) {
|
||||
int32_t *fetchIdx, int32_t baseResIdx, SArray *pList, bool autoCreate) {
|
||||
int32_t tbNum = taosArrayGetSize(pList);
|
||||
char dbFName[TSDB_DB_FNAME_LEN] = {0};
|
||||
int32_t flag = CTG_FLAG_UNKNOWN_STB;
|
||||
|
@ -3527,6 +3527,11 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
CTG_ERR_JRET(TSDB_CODE_CTG_INVALID_INPUT);
|
||||
}
|
||||
|
||||
// for auto create, the second table is child table
|
||||
if (autoCreate && (i == 1)) {
|
||||
CTG_FLAG_SET_STB(flag, TSDB_CHILD_TABLE);
|
||||
}
|
||||
|
||||
pCache = taosHashAcquire(dbCache->tbCache, pName->tname, strlen(pName->tname));
|
||||
if (NULL == pCache) {
|
||||
ctgDebug("tb:%s, tb not in cache, db:%s", pName->tname, dbFName);
|
||||
|
|
|
@ -81,6 +81,8 @@ int32_t queryBuildTableMetaReqMsg(void *input, char **msg, int32_t msgSize, int3
|
|||
STableInfoReq infoReq = {0};
|
||||
infoReq.option = pInput->option;
|
||||
infoReq.header.vgId = pInput->vgId;
|
||||
infoReq.autoCreateCtb = pInput->autoCreateCtb;
|
||||
|
||||
if (pInput->dbFName) {
|
||||
tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue