enh: add show rewrite mask in query msg
This commit is contained in:
parent
33d64b67ff
commit
ae5f6ef175
|
@ -216,9 +216,14 @@ typedef struct SEp {
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
} SEp;
|
} SEp;
|
||||||
|
|
||||||
|
#define SHOW_REWRITE_MASK() (1 << 0)
|
||||||
|
|
||||||
|
#define TEST_SHOW_REWRITE_MASK(m) ((m) & SHOW_REWRITE_MASK() != 0)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t contLen;
|
int32_t contLen;
|
||||||
int32_t vgId;
|
int32_t vgId;
|
||||||
|
int32_t msgMask;
|
||||||
} SMsgHead;
|
} SMsgHead;
|
||||||
|
|
||||||
// Submit message for one table
|
// Submit message for one table
|
||||||
|
|
|
@ -786,6 +786,9 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) {
|
||||||
case 'd': {
|
case 'd': {
|
||||||
if (strcasecmp("dDebugFlag", name) == 0) {
|
if (strcasecmp("dDebugFlag", name) == 0) {
|
||||||
dDebugFlag = cfgGetItem(pCfg, "dDebugFlag")->i32;
|
dDebugFlag = cfgGetItem(pCfg, "dDebugFlag")->i32;
|
||||||
|
} else if (strcasecmp("debugFlag", name) == 0) {
|
||||||
|
int32_t flag = cfgGetItem(pCfg, "debugFlag")->i32;
|
||||||
|
taosSetAllDebugFlag(flag, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,7 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
|
||||||
|
|
||||||
pHead->contLen = ntohl(pHead->contLen);
|
pHead->contLen = ntohl(pHead->contLen);
|
||||||
pHead->vgId = ntohl(pHead->vgId);
|
pHead->vgId = ntohl(pHead->vgId);
|
||||||
|
pHead->msgMask = ntohl(pHead->msgMask);
|
||||||
|
|
||||||
SVnodeObj *pVnode = vmAcquireVnode(pMgmt, pHead->vgId);
|
SVnodeObj *pVnode = vmAcquireVnode(pMgmt, pHead->vgId);
|
||||||
if (pVnode == NULL) {
|
if (pVnode == NULL) {
|
||||||
|
@ -155,7 +156,7 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
|
||||||
|
|
||||||
switch (qtype) {
|
switch (qtype) {
|
||||||
case QUERY_QUEUE:
|
case QUERY_QUEUE:
|
||||||
if ((pMsg->msgType == TDMT_SCH_QUERY) && (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS)) {
|
if ((pMsg->msgType == TDMT_SCH_QUERY) && (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) && !TEST_SHOW_REWRITE_MASK(pHead->msgMask)) {
|
||||||
terrno = TSDB_CODE_GRANT_EXPIRED;
|
terrno = TSDB_CODE_GRANT_EXPIRED;
|
||||||
code = terrno;
|
code = terrno;
|
||||||
dDebug("vgId:%d, msg:%p put into vnode-query queue failed since %s", pVnode->vgId, pMsg, terrstr(code));
|
dDebug("vgId:%d, msg:%p put into vnode-query queue failed since %s", pVnode->vgId, pMsg, terrstr(code));
|
||||||
|
|
|
@ -1047,6 +1047,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr,
|
||||||
|
|
||||||
SSubQueryMsg *pMsg = msg;
|
SSubQueryMsg *pMsg = msg;
|
||||||
pMsg->header.vgId = htonl(addr->nodeId);
|
pMsg->header.vgId = htonl(addr->nodeId);
|
||||||
|
pMsg->header.msgMask = htonl((pTask->plan->showRewrite) ? SHOW_REWRITE_MASK() : 0);
|
||||||
pMsg->sId = htobe64(schMgmt.sId);
|
pMsg->sId = htobe64(schMgmt.sId);
|
||||||
pMsg->queryId = htobe64(pJob->queryId);
|
pMsg->queryId = htobe64(pJob->queryId);
|
||||||
pMsg->taskId = htobe64(pTask->taskId);
|
pMsg->taskId = htobe64(pTask->taskId);
|
||||||
|
|
Loading…
Reference in New Issue