From ca809924cd0ad28523877388cf8546e05b8a4f0f Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Sun, 8 Oct 2023 15:10:54 +0800 Subject: [PATCH 1/2] fix(tsdb/retention): free fopArr & fs snapshot resources --- source/dnode/vnode/src/tsdb/tsdbRetention.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/dnode/vnode/src/tsdb/tsdbRetention.c b/source/dnode/vnode/src/tsdb/tsdbRetention.c index cb53876d97..c3b1a18fd8 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRetention.c +++ b/source/dnode/vnode/src/tsdb/tsdbRetention.c @@ -372,6 +372,14 @@ static int32_t tsdbDoRetention2(void *arg) { _exit: if (code) { + if (TARRAY2_DATA(rtner->fopArr)) { + TARRAY2_DESTROY(rtner->fopArr, NULL); + } + TFileSetArray **fsetArr = &rtner->fsetArr; + if (fsetArr[0]) { + tsdbFSDestroyCopySnapshot(&rtner->fsetArr); + } + TSDB_ERROR_LOG(TD_VID(rtner->tsdb->pVnode), lino, code); } return code; From 99e930ff8baebf9916b20a9e743242a553f9dfd2 Mon Sep 17 00:00:00 2001 From: dm chen Date: Sun, 8 Oct 2023 16:16:33 +0800 Subject: [PATCH 2/2] fix/TD-26547 --- include/common/tmsg.h | 1 + source/common/src/tmsg.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 7f0b9de321..18a0d119f8 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2048,6 +2048,7 @@ int32_t tDeserializeSRedistributeVgroupReq(void* buf, int32_t bufLen, SRedistrib typedef struct { int32_t useless; + int32_t vgId; } SBalanceVgroupLeaderReq; int32_t tSerializeSBalanceVgroupLeaderReq(void* buf, int32_t bufLen, SBalanceVgroupLeaderReq* pReq); diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 4b5663b126..0ba9539124 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -5240,6 +5240,7 @@ int32_t tSerializeSBalanceVgroupLeaderReq(void *buf, int32_t bufLen, SBalanceVgr if (tStartEncode(&encoder) < 0) return -1; if (tEncodeI32(&encoder, pReq->useless) < 0) return -1; + if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -5253,6 +5254,9 @@ int32_t tDeserializeSBalanceVgroupLeaderReq(void *buf, int32_t bufLen, SBalanceV if (tStartDecode(&decoder) < 0) return -1; if (tDecodeI32(&decoder, &pReq->useless) < 0) return -1; + if(!tDecodeIsEnd(&decoder)){ + if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder);