diff --git a/include/common/tgrant.h b/include/common/tgrant.h index 46e09a56b6c0ec27cb1728ce49c543778595c9ba..d46a74073b0d7174e2bc5d258f16130340160dda 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -48,6 +48,10 @@ typedef enum { TSDB_GRANT_TABLE, } EGrantType; +static int8_t tsGrant = 1; + +static FORCE_INLINE int8_t taosGranted() { return atomic_load_8(&tsGrant); } + int32_t grantCheck(EGrantType grant); #ifndef GRANTS_CFG diff --git a/source/dnode/vnode/src/sma/smaTimeRange.c b/source/dnode/vnode/src/sma/smaTimeRange.c index 3542ea9ffb2e767200c2ba4cf5e8aa959d931c1d..6a6007cae4560d848c25d70ebc997e8b18c91f5b 100644 --- a/source/dnode/vnode/src/sma/smaTimeRange.c +++ b/source/dnode/vnode/src/sma/smaTimeRange.c @@ -355,7 +355,7 @@ _end: */ static int32_t tdProcessTSmaInsertImpl(SSma *pSma, int64_t indexUid, const char *msg) { const SArray *pDataBlocks = (const SArray *)msg; - // TODO: destroy SSDataBlocks(msg) + if (!pDataBlocks) { terrno = TSDB_CODE_TSMA_INVALID_PTR; smaWarn("vgId:%d, insert tsma data failed since pDataBlocks is NULL", SMA_VID(pSma)); diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index b950437f236fe690eaccec09dd53e9b9d5be5d03..12a55049c3c051c89d8a0bb9bf273bbf9d064ca7 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -588,9 +588,7 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) { } } -// TODO: remove the function void smaHandleRes(void *pVnode, int64_t smaId, const SArray *data) { - // TODO // blockDebugShowDataBlocks(data, __func__); tdProcessTSmaInsert(((SVnode *)pVnode)->pSma, smaId, (const char *)data); } diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index 231e597724f7bb03c4e1a726bb9e59e18660d532..508e957e265d295b51db83aedb22ac92575bec9c 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -366,7 +366,7 @@ int32_t qWorkerPreprocessQueryMsg(void *qWorkerMgmt, SRpcMsg *pMsg, bool chkGran QW_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT); } - if (chkGrant && (!TEST_SHOW_REWRITE_MASK(msg.msgMask)) && (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS)) { + if (chkGrant && (!TEST_SHOW_REWRITE_MASK(msg.msgMask)) && !taosGranted()) { QW_ELOG("query failed cause of grant expired, msgMask:%d", msg.msgMask); tFreeSSubQueryMsg(&msg); QW_ERR_RET(TSDB_CODE_GRANT_EXPIRED);