rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

[Bug] Tiered storage may cause commitLog undeleted once dispatch was held

Open bxfjb opened this issue 1 year ago • 0 comments

Before Creating the Bug Report

  • [X] I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • [X] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • [X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

Any

RocketMQ version

develop

JDK Version

1.8

Describe the Bug

  • The bug was found under dledger mode and it should reproduce under normal commitLog.
  • The MessageDispatcherImpl didn't release the refCount of mapped file (DefaultMappedFile or DefaultMmapFile) correctly when diapatch was held, which may cause the refered commitLog undeleted.

Steps to Reproduce

  • Enable tiered store, produce message under low rate which cause MessageDispatcher#dispatch hold at least once.
  • When CleanCommitLogService#deleteExpiredFiles deleting the held file, the log highlighted below should be shown. image

What Did You Expect to See?

The expired commitLog should be deleted correctly.

What Did You See Instead?

Unexpected warn log. image

Additional Context

No response

bxfjb avatar Jun 27 '24 02:06 bxfjb