hexueyuan opened a new pull request, #8897:
URL: https://github.com/apache/rocketmq/pull/8897

   <!-- Please make sure the target branch is right. In most case, the target 
branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and 
[link this pull request to that issue using 
keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>)
 to ensure automatic closure. -->
   
   Fixes #8859 
   
   ### Brief Description
   <!-- Write a brief description for your pull request to help the maintainer 
understand the reasons behind your changes. -->
   I changed the key of the requestTable in the AllocateMappedFileService class 
from the FilePath to the FileName(this must be the only one), and then added a 
getCachedMappedFilePath method to provide to the MultiPathMappedFileQueue to 
check whether the MappedFile of a specified offset MappedFile create request 
has been submitted, and if so, obtain the cached FilePath, otherwise a new path 
is generated based on the previous rules.
   
   ### How Did You Test This Change?
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every 
pull request to have undergone thorough testing. -->
   I make a unit test to recurrence this case in testUniqueNextNextMappedFile().
   
   In the previous implementation, the results obtained were as shown in the 
picture below, the MappedFile 00000000000000001024 repeatedly appear in 
directory a and directory b.
   
![9daf3e5014d7447a1328fbb5da7a1382](https://github.com/user-attachments/assets/4ff7f0c7-6f46-40e2-a580-16e4a709cf55)
   
   This problem was solved in the new implementation and the result is as 
follows:
   
![45446178a8a361c316316b62997e64eb](https://github.com/user-attachments/assets/971f681d-0f46-4ea1-a8c6-b47a8940a161)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to