You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/11/16 01:36:33 UTC

[GitHub] jiangxinlingdu opened a new pull request #543: When first Store message mappedFile is null ,Concurrency create will more one mappedFile

jiangxinlingdu opened a new pull request #543: When first Store message mappedFile is null ,Concurrency create will more one mappedFile
URL: https://github.com/apache/rocketmq/pull/543
 
 
   ## What is the purpose of the change
   
   Fixes [#542](https://github.com/apache/rocketmq/issues/542)
   
   ## Brief changelog
   
   ```
    putMessageLock.lock(); //spin or ReentrantLock ,depending on store config
           try {
               MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile();
   
               long beginLockTimestamp = this.defaultMessageStore.getSystemClock().now();
               this.beginTimeInLock = beginLockTimestamp;
   
               // Here settings are stored timestamp, in order to ensure an orderly
               // global
               msg.setStoreTimestamp(beginLockTimestamp);
   
               if (null == mappedFile || mappedFile.isFull()) {
                   mappedFile = this.mappedFileQueue.getLastMappedFile(0); // Mark: NewFile may be cause noise
               }
               if (null == mappedFile) {
                   log.error("create mapped file1 error, topic: " + msg.getTopic() + " clientAddr: " + msg.getBornHostString());
                   beginTimeInLock = 0;
                   return new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, null);
               }
   ```
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services