From a0420f6f493604f63c6a139504d83be452f255a3 Mon Sep 17 00:00:00 2001 From: slzhou Date: Tue, 22 Aug 2023 14:17:49 +0800 Subject: [PATCH] fix: compact time range - fix minor error --- src/client/src/tscSQLParser.c | 4 ++-- src/client/src/tscServer.c | 4 ++-- src/mnode/src/mnodeDb.c | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index a0c9744d1e..31cfb35edd 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -4260,9 +4260,9 @@ static int32_t setCompactVnodeInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { if (pInfo->pCompactRange->end) { if (getTimeRange(&pQueryInfo->range, pInfo->pCompactRange->end, TK_LE, TSDB_TIME_PRECISION_NANO) != TSDB_CODE_SUCCESS) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); - } else { - pQueryInfo->range.ekey = INT64_MAX; } + } else { + pQueryInfo->range.ekey = INT64_MAX; } return TSDB_CODE_SUCCESS; } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 32e68e335e..a2a23abc38 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -2060,8 +2060,8 @@ int tscBuildCompactMsg(SSqlObj *pSql, SSqlInfo *pInfo) { tlv->len = htonl(sizeof(int64_t) * 2); SQueryInfo* pQueryInfo = tscGetQueryInfo(pCmd); - *(int16_t*)tlv->value = htobe64(pQueryInfo->range.skey); - *(int16_t*)(tlv->value+sizeof(int64_t)) = htobe64(pQueryInfo->range.ekey); + *(int64_t*)tlv->value = htobe64(pQueryInfo->range.skey); + *(int64_t*)(tlv->value+sizeof(int64_t)) = htobe64(pQueryInfo->range.ekey); p += sizeof(*tlv) + sizeof(int64_t) * 2; diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index 34d0cdc6f0..3573ee0c98 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -1346,7 +1346,8 @@ static int32_t mnodeCompact(SDbObj *pDb, SCompactMsg *pCompactMsg) { if (pVgroup == NULL) break; if (pVgroup->pDb == pDb && pVgroup->vgId == buf[i]) { skey = convertTimePrecision(skey, TSDB_TIME_PRECISION_NANO, pVgroup->pDb->cfg.precision); - ekey = convertTimePrecision(skey, TSDB_TIME_PRECISION_NANO, pVgroup->pDb->cfg.precision); + ekey = convertTimePrecision(ekey, TSDB_TIME_PRECISION_NANO, pVgroup->pDb->cfg.precision); + mInfo("vgId: %d send compact msg. start %"PRId64 " end %"PRId64, pVgroup->vgId, skey, ekey); mnodeSendCompactVgroupMsg(pVgroup, skey, ekey); mnodeDecVgroupRef(pVgroup); valid = true; -- GitLab