fix: use correct keep2 when set least ts for query
This commit is contained in:
parent
946f1101fd
commit
6c5e8bae55
|
@ -65,9 +65,12 @@ struct SRSmaInfo {
|
||||||
|
|
||||||
static SRSmaInfo *tdGetRSmaInfoByItem(SRSmaInfoItem *pItem) {
|
static SRSmaInfo *tdGetRSmaInfoByItem(SRSmaInfoItem *pItem) {
|
||||||
// adapt accordingly if definition of SRSmaInfo update
|
// adapt accordingly if definition of SRSmaInfo update
|
||||||
|
SRSmaInfo *pResult = NULL;
|
||||||
int32_t rsmaInfoHeadLen = sizeof(int64_t) + sizeof(STSchema *);
|
int32_t rsmaInfoHeadLen = sizeof(int64_t) + sizeof(STSchema *);
|
||||||
ASSERT(pItem->level == 0 || pItem->level == 1);
|
ASSERT(pItem->level == TSDB_RETENTION_L1 || pItem->level == TSDB_RETENTION_L2);
|
||||||
return (SRSmaInfo *)POINTER_SHIFT(pItem, -sizeof(SRSmaInfoItem) * pItem->level - rsmaInfoHeadLen);
|
pResult = (SRSmaInfo *)POINTER_SHIFT(pItem, -(sizeof(SRSmaInfoItem) * (pItem->level - 1) + rsmaInfoHeadLen));
|
||||||
|
ASSERT(pResult->pTSchema->numOfCols > 1);
|
||||||
|
return pResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SRSmaQTaskInfoItem {
|
struct SRSmaQTaskInfoItem {
|
||||||
|
@ -276,7 +279,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat
|
||||||
if (pItem->maxDelay > TSDB_MAX_ROLLUP_MAX_DELAY) {
|
if (pItem->maxDelay > TSDB_MAX_ROLLUP_MAX_DELAY) {
|
||||||
pItem->maxDelay = TSDB_MAX_ROLLUP_MAX_DELAY;
|
pItem->maxDelay = TSDB_MAX_ROLLUP_MAX_DELAY;
|
||||||
}
|
}
|
||||||
pItem->level = idx;
|
pItem->level = idx == 0 ? TSDB_RETENTION_L1 : TSDB_RETENTION_L2;
|
||||||
smaInfo("vgId:%d table:%" PRIi64 " level:%" PRIi8 " maxdelay:%" PRIi64 " watermark:%" PRIi64
|
smaInfo("vgId:%d table:%" PRIi64 " level:%" PRIi8 " maxdelay:%" PRIi64 " watermark:%" PRIi64
|
||||||
", finally maxdelay:%" PRIi32,
|
", finally maxdelay:%" PRIi32,
|
||||||
SMA_VID(pSma), pRSmaInfo->suid, idx + 1, param->maxdelay[idx], param->watermark[idx], pItem->maxDelay);
|
SMA_VID(pSma), pRSmaInfo->suid, idx + 1, param->maxdelay[idx], param->watermark[idx], pItem->maxDelay);
|
||||||
|
@ -1236,8 +1239,6 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
|
||||||
|
|
||||||
SRSmaInfo *pRSmaInfo = tdGetRSmaInfoByItem(pItem);
|
SRSmaInfo *pRSmaInfo = tdGetRSmaInfoByItem(pItem);
|
||||||
|
|
||||||
ASSERT(pRSmaInfo->items[pItem->level].level == pItem->level);
|
|
||||||
|
|
||||||
int8_t fetchTriggerStat =
|
int8_t fetchTriggerStat =
|
||||||
atomic_val_compare_exchange_8(&pItem->triggerStat, TASK_TRIGGER_STAT_ACTIVE, TASK_TRIGGER_STAT_INACTIVE);
|
atomic_val_compare_exchange_8(&pItem->triggerStat, TASK_TRIGGER_STAT_ACTIVE, TASK_TRIGGER_STAT_INACTIVE);
|
||||||
switch (fetchTriggerStat) {
|
switch (fetchTriggerStat) {
|
||||||
|
|
|
@ -400,7 +400,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
|
||||||
pReader->idStr = (idstr != NULL) ? strdup(idstr) : NULL;
|
pReader->idStr = (idstr != NULL) ? strdup(idstr) : NULL;
|
||||||
pReader->verRange = getQueryVerRange(pVnode, pCond, level);
|
pReader->verRange = getQueryVerRange(pVnode, pCond, level);
|
||||||
pReader->type = pCond->type;
|
pReader->type = pCond->type;
|
||||||
pReader->window = updateQueryTimeWindow(pVnode->pTsdb, &pCond->twindows);
|
pReader->window = updateQueryTimeWindow(pReader->pTsdb, &pCond->twindows);
|
||||||
|
|
||||||
ASSERT(pCond->numOfCols > 0);
|
ASSERT(pCond->numOfCols > 0);
|
||||||
|
|
||||||
|
@ -2203,15 +2203,15 @@ static STsdb* getTsdbByRetentions(SVnode* pVnode, TSKEY winSKey, SRetention* ret
|
||||||
|
|
||||||
if (level == TSDB_RETENTION_L0) {
|
if (level == TSDB_RETENTION_L0) {
|
||||||
*pLevel = TSDB_RETENTION_L0;
|
*pLevel = TSDB_RETENTION_L0;
|
||||||
tsdbDebug("vgId:%d, read handle %p rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L0, str);
|
tsdbDebug("vgId:%d, rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L0, str);
|
||||||
return VND_RSMA0(pVnode);
|
return VND_RSMA0(pVnode);
|
||||||
} else if (level == TSDB_RETENTION_L1) {
|
} else if (level == TSDB_RETENTION_L1) {
|
||||||
*pLevel = TSDB_RETENTION_L1;
|
*pLevel = TSDB_RETENTION_L1;
|
||||||
tsdbDebug("vgId:%d, read handle %p rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L1, str);
|
tsdbDebug("vgId:%d, rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L1, str);
|
||||||
return VND_RSMA1(pVnode);
|
return VND_RSMA1(pVnode);
|
||||||
} else {
|
} else {
|
||||||
*pLevel = TSDB_RETENTION_L2;
|
*pLevel = TSDB_RETENTION_L2;
|
||||||
tsdbDebug("vgId:%d, read handle %p rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L2, str);
|
tsdbDebug("vgId:%d, rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L2, str);
|
||||||
return VND_RSMA2(pVnode);
|
return VND_RSMA2(pVnode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue