Merge pull request #21588 from taosdata/fix/TD-24346-M
chore: unbind the dependency
This commit is contained in:
commit
b437024eca
|
@ -82,6 +82,7 @@ extern int64_t tsVndCommitMaxIntervalMs;
|
||||||
// mnode
|
// mnode
|
||||||
extern int64_t tsMndSdbWriteDelta;
|
extern int64_t tsMndSdbWriteDelta;
|
||||||
extern int64_t tsMndLogRetention;
|
extern int64_t tsMndLogRetention;
|
||||||
|
extern int8_t tsGrant;
|
||||||
|
|
||||||
// monitor
|
// monitor
|
||||||
extern bool tsEnableMonitor;
|
extern bool tsEnableMonitor;
|
||||||
|
@ -197,6 +198,7 @@ void taosSetAllDebugFlag(int32_t flag, bool rewrite);
|
||||||
void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal, bool rewrite);
|
void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal, bool rewrite);
|
||||||
int32_t taosApplyLocalCfg(SConfig *pCfg, char *name);
|
int32_t taosApplyLocalCfg(SConfig *pCfg, char *name);
|
||||||
void taosLocalCfgForbiddenToChange(char *name, bool *forbidden);
|
void taosLocalCfgForbiddenToChange(char *name, bool *forbidden);
|
||||||
|
int8_t taosGranted();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
|
#include "os.h"
|
||||||
#include "tglobal.h"
|
#include "tglobal.h"
|
||||||
#include "tconfig.h"
|
#include "tconfig.h"
|
||||||
#include "tgrant.h"
|
#include "tgrant.h"
|
||||||
|
@ -73,6 +74,7 @@ int64_t tsVndCommitMaxIntervalMs = 600 * 1000;
|
||||||
// mnode
|
// mnode
|
||||||
int64_t tsMndSdbWriteDelta = 200;
|
int64_t tsMndSdbWriteDelta = 200;
|
||||||
int64_t tsMndLogRetention = 2000;
|
int64_t tsMndLogRetention = 2000;
|
||||||
|
int8_t tsGrant = 1;
|
||||||
|
|
||||||
// monitor
|
// monitor
|
||||||
bool tsEnableMonitor = true;
|
bool tsEnableMonitor = true;
|
||||||
|
@ -1522,3 +1524,5 @@ void taosSetAllDebugFlag(int32_t flag, bool rewrite) {
|
||||||
taosSetDebugFlag(&metaDebugFlag, "metaDebugFlag", flag, rewrite);
|
taosSetDebugFlag(&metaDebugFlag, "metaDebugFlag", flag, rewrite);
|
||||||
uInfo("all debug flag are set to %d", flag);
|
uInfo("all debug flag are set to %d", flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int8_t taosGranted() { return atomic_load_8(&tsGrant); }
|
||||||
|
|
|
@ -366,7 +366,7 @@ int32_t qWorkerPreprocessQueryMsg(void *qWorkerMgmt, SRpcMsg *pMsg, bool chkGran
|
||||||
QW_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT);
|
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);
|
QW_ELOG("query failed cause of grant expired, msgMask:%d", msg.msgMask);
|
||||||
tFreeSSubQueryMsg(&msg);
|
tFreeSSubQueryMsg(&msg);
|
||||||
QW_ERR_RET(TSDB_CODE_GRANT_EXPIRED);
|
QW_ERR_RET(TSDB_CODE_GRANT_EXPIRED);
|
||||||
|
|
Loading…
Reference in New Issue