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

ASF GitHub Bot commented on ROCKETMQ-91:
----------------------------------------

Github user shroman commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/57#discussion_r101456741
  
    --- Diff: store/src/main/java/org/apache/rocketmq/store/CommitLog.java ---
    @@ -1154,7 +1249,7 @@ public AppendMessageResult doAppend(final long 
fileFromOffset, final ByteBuffer
     
                 if (propertiesLength > Short.MAX_VALUE) {
                     log.warn("putMessage message properties length too long. 
length={}", propertiesData.length);
    -                return new 
AppendMessageResult(AppendMessageStatus.PROPERTIES_SIZE_EXCEEDED);
    +                throw new RuntimeException("PROPERTIES_SIZE_EXCEEDED");
    --- End diff --
    
    By changing to this, `PROPERTIES_SIZE_EXCEEDED` won't be caught in the 
following switch.


> Reduce lock granularity for putMessage
> --------------------------------------
>
>                 Key: ROCKETMQ-91
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-91
>             Project: Apache RocketMQ
>          Issue Type: Improvement
>    Affects Versions: 4.1.0-incubating
>            Reporter: dongeforever
>            Assignee: dongeforever
>             Fix For: 4.1.0-incubating
>
>
> CommitLog putMessage has a lock as:
> lockForPutMessage()
> ....
> releasePutMessageLock()
> The logic inside the lock includes two main operations:
> 1 encode the message
> 2 write to the PageCache.
> However, we can take the first operation(encode message) out from the lock to 
> achieve better performance.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to