[ 
https://issues.apache.org/jira/browse/ROCKETMQ-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15833473#comment-15833473
 ] 

ASF subversion and git services commented on ROCKETMQ-45:
---------------------------------------------------------

Commit 11ff542c4382faf3bb7a74a80329f1fcab6a07a6 in incubator-rocketmq's branch 
refs/heads/ROCKETMQ-54 from [~lizhanhui]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=11ff542 ]

[ROCKETMQ-45]Delete hanged consume queue files


> Delete consume queue hang file
> ------------------------------
>
>                 Key: ROCKETMQ-45
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-45
>             Project: Apache RocketMQ
>          Issue Type: Bug
>          Components: rocketmq-store
>    Affects Versions: 4.1.0-incubating
>            Reporter: Zhanhui Li
>            Assignee: yukon
>             Fix For: 4.1.0-incubating
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Consume queue file may hang and stop further deleting under concurrent 
> scenario.
> If the consume queue file is concurrently held by another thread, 
> mappedFile.destroy(interval) will only set firstShutdownTimestamp to current 
> timestamp and available false, then  return false directly. 
> Check MappedFileQueue.java#deleteExpiredFileByOffset, 
> if (destroy && mappedFile.destroy(1000 * 60)) {
>     files.add(mappedFile);
>     deleteCount++;
> } else {
>     break;
> }
> the current round of deletion will be stopped and current mapped file becomes 
> handed.
> Next time trying to delete mapped file of this mapped file queue,  
> MappedFileQueue.java#deleteExpiredFileByOffset(offset, unitSize) line No.390
> MappedFile mappedFile = (MappedFile) mfs[i];
> SelectMappedBufferResult result = 
> mappedFile.selectMappedBuffer(this.mappedFileSize - unitSize);
> will always return null as the mapped file is no longer available and cannot 
> hold. Current implementation will only log a warn and exit.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to