From 71aa3004997fda9b25efd2446cebf3c534d4a9fa Mon Sep 17 00:00:00 2001 From: yukun Date: Wed, 1 Sep 2021 12:03:58 +0800 Subject: [PATCH] Fix rocksmq retention panic when delete by message size (#7393) Signed-off-by: fishpenguin --- internal/util/rocksmq/server/rocksmq/rocksmq_retention.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/util/rocksmq/server/rocksmq/rocksmq_retention.go b/internal/util/rocksmq/server/rocksmq/rocksmq_retention.go index 3a5d2f383c..1a3b97c6a9 100644 --- a/internal/util/rocksmq/server/rocksmq/rocksmq_retention.go +++ b/internal/util/rocksmq/server/rocksmq/rocksmq_retention.go @@ -377,7 +377,7 @@ func (ri *retentionInfo) expiredCleanUp(topic string) error { if pageInfo != nil { // Judge expire by ackedSize if msgSizeExpiredCheck(deletedAckedSize, ackedInfo.ackedSize) { - for _, pEndID := range pageInfo.pageEndID[pageRetentionOffset:0] { + for _, pEndID := range pageInfo.pageEndID[pageRetentionOffset:] { curDeletedSize := deletedAckedSize + pageInfo.pageMsgSize[pEndID] if msgSizeExpiredCheck(curDeletedSize, ackedInfo.ackedSize) { endID = pEndID