diff --git a/include/util/tdef.h b/include/util/tdef.h index ee3284991f..36ef36260d 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -364,7 +364,7 @@ typedef enum ELogicConditionType { #define TSDB_MAX_REPLICA 5 #define TSDB_MAX_LEARNER_REPLICA 10 #define TSDB_SYNC_RESTORE_lEN 20 -#define TSDB_SYNC_APPLY_COMMIT_LEN 27 +#define TSDB_SYNC_APPLY_COMMIT_LEN 41 #define TSDB_SYNC_LOG_BUFFER_SIZE 4096 #define TSDB_SYNC_LOG_BUFFER_RETENTION 256 #define TSDB_SYNC_LOG_BUFFER_THRESHOLD (1024 * 1024 * 5) diff --git a/source/common/src/msg/tmsg.c b/source/common/src/msg/tmsg.c index 609e60e3e6..edaf7fa2c1 100644 --- a/source/common/src/msg/tmsg.c +++ b/source/common/src/msg/tmsg.c @@ -1432,8 +1432,6 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { TAOS_CHECK_EXIT(tEncodeI32(&encoder, pload->learnerProgress)); TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->roleTimeMs)); TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->startTimeMs)); - TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->syncAppliedIndex)); - TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->syncCommitIndex)); } // mnode loads diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index ca48b23e6f..311beb0daa 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1125,8 +1125,8 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p return code; } - char applyStr[TSDB_SYNC_APPLY_COMMIT_LEN] = {0}; - char buf[TSDB_SYNC_APPLY_COMMIT_LEN] = {0}; + char applyStr[TSDB_SYNC_APPLY_COMMIT_LEN + 1] = {0}; + char buf[TSDB_SYNC_APPLY_COMMIT_LEN + VARSTR_HEADER_SIZE + 1] = {0}; snprintf(applyStr, sizeof(applyStr), "%" PRId64 "/%" PRId64, pVgroup->vnodeGid[i].syncAppliedIndex, pVgroup->vnodeGid[i].syncCommitIndex); STR_WITH_MAXSIZE_TO_VARSTR(buf, applyStr, pShow->pMeta->pSchemas[cols].bytes); @@ -1358,7 +1358,7 @@ static int32_t mndRetrieveVnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB calculateRstoreFinishTime(pGid->appliedRate, unappliedCount, restoreStr, sizeof(restoreStr)); } STR_TO_VARSTR(buf, restoreStr); - colDataSetVal(pColInfo, numOfRows, (const char *)&buf, false); + code = colDataSetVal(pColInfo, numOfRows, (const char *)&buf, false); if (code != 0) { mError("vgId:%d, failed to set syncRestore finish time, since %s", pVgroup->vgId, tstrerror(code)); return code;