From 43fffd644bc768f5636bcfa08f3443c6ee2e05f0 Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Mon, 17 Feb 2025 14:42:20 +0800 Subject: [PATCH] resolve compatibility issues --- source/common/src/msg/tmsg.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/common/src/msg/tmsg.c b/source/common/src/msg/tmsg.c index 5d4c5b5cc4..609e60e3e6 100644 --- a/source/common/src/msg/tmsg.c +++ b/source/common/src/msg/tmsg.c @@ -1473,6 +1473,12 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->analVer)); TAOS_CHECK_EXIT(tSerializeSMonitorParas(&encoder, &pReq->clusterCfg.monitorParas)); + for (int32_t i = 0; i < vlen; ++i) { + SVnodeLoad *pload = taosArrayGet(pReq->pVloads, i); + TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->syncAppliedIndex)); + TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->syncCommitIndex)); + } + tEndEncode(&encoder); _exit: @@ -1544,8 +1550,6 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { TAOS_CHECK_EXIT(tDecodeI32(&decoder, &vload.learnerProgress)); TAOS_CHECK_EXIT(tDecodeI64(&decoder, &vload.roleTimeMs)); TAOS_CHECK_EXIT(tDecodeI64(&decoder, &vload.startTimeMs)); - TAOS_CHECK_EXIT(tDecodeI64(&decoder, &vload.syncAppliedIndex)); - TAOS_CHECK_EXIT(tDecodeI64(&decoder, &vload.syncCommitIndex)); if (taosArrayPush(pReq->pVloads, &vload) == NULL) { TAOS_CHECK_EXIT(terrno); } @@ -1604,6 +1608,14 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { TAOS_CHECK_EXIT(tDeserializeSMonitorParas(&decoder, &pReq->clusterCfg.monitorParas)); } + if (!tDecodeIsEnd(&decoder)) { + for (int32_t i = 0; i < vlen; ++i) { + SVnodeLoad *pLoad = taosArrayGet(pReq->pVloads, i); + TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pLoad->syncAppliedIndex)); + TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pLoad->syncCommitIndex)); + } + } + tEndDecode(&decoder); _exit: