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