cancel bg tasks when alter stt_trigger
This commit is contained in:
parent
9edfc82bf4
commit
b3be47fdbb
|
@ -738,7 +738,7 @@ int32_t vnodePreprocessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg) {
|
||||||
return qWorkerPreprocessQueryMsg(pVnode->pQuery, pMsg, TDMT_SCH_QUERY == pMsg->msgType);
|
return qWorkerPreprocessQueryMsg(pVnode->pQuery, pMsg, TDMT_SCH_QUERY == pMsg->msgType);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo* pInfo) {
|
int32_t vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) {
|
||||||
vTrace("message in vnode query queue is processing");
|
vTrace("message in vnode query queue is processing");
|
||||||
if ((pMsg->msgType == TDMT_SCH_QUERY || pMsg->msgType == TDMT_VND_TMQ_CONSUME ||
|
if ((pMsg->msgType == TDMT_SCH_QUERY || pMsg->msgType == TDMT_VND_TMQ_CONSUME ||
|
||||||
pMsg->msgType == TDMT_VND_TMQ_CONSUME_PUSH) &&
|
pMsg->msgType == TDMT_VND_TMQ_CONSUME_PUSH) &&
|
||||||
|
@ -1978,6 +1978,9 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int32_t tsdbDisableAndCancelAllBgTask(STsdb *pTsdb);
|
||||||
|
extern int32_t tsdbEnableBgTask(STsdb *pTsdb);
|
||||||
|
|
||||||
static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) {
|
static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) {
|
||||||
bool walChanged = false;
|
bool walChanged = false;
|
||||||
bool tsdbChanged = false;
|
bool tsdbChanged = false;
|
||||||
|
@ -2075,7 +2078,14 @@ static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t ver, void *pRe
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.sttTrigger != -1 && req.sttTrigger != pVnode->config.sttTrigger) {
|
if (req.sttTrigger != -1 && req.sttTrigger != pVnode->config.sttTrigger) {
|
||||||
|
if (req.sttTrigger > 1 && pVnode->config.sttTrigger > 1) {
|
||||||
pVnode->config.sttTrigger = req.sttTrigger;
|
pVnode->config.sttTrigger = req.sttTrigger;
|
||||||
|
} else {
|
||||||
|
vnodeAWait(&pVnode->commitTask);
|
||||||
|
tsdbDisableAndCancelAllBgTask(pVnode->pTsdb);
|
||||||
|
pVnode->config.sttTrigger = req.sttTrigger;
|
||||||
|
tsdbEnableBgTask(pVnode->pTsdb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.minRows != -1 && req.minRows != pVnode->config.tsdbCfg.minRows) {
|
if (req.minRows != -1 && req.minRows != pVnode->config.tsdbCfg.minRows) {
|
||||||
|
|
Loading…
Reference in New Issue