Cczzzz edited a comment on issue #3315:
URL: https://github.com/apache/rocketmq/issues/3315#issuecomment-914124366


   I add Metrics and recompile。write page cache  is quickly。the part of raft 
sync is bottleneck。
   specifically is :
   
        long now = this.defaultMessageStore.getSystemClock().now();
           return dledgerFuture.thenApply(appendEntryResponse -> { 
               
metrics.putRtRAFT(this.defaultMessageStore.getSystemClock().now() - now);
               PutMessageStatus putMessageStatus = 
PutMessageStatus.UNKNOWN_ERROR;
               switch 
(DLedgerResponseCode.valueOf(appendEntryResponse.getCode())) {
                   case SUCCESS:
                       putMessageStatus = PutMessageStatus.PUT_OK;
                       break;
                   case INCONSISTENT_LEADER:
                   case NOT_LEADER:
                   case LEADER_NOT_READY:
                   case DISK_FULL:
                       putMessageStatus = 
PutMessageStatus.SERVICE_NOT_AVAILABLE;
                       break;
                   case WAIT_QUORUM_ACK_TIMEOUT:
                       //Do not return flush_slave_timeout to the client, for 
the ons client will ignore it.
                       putMessageStatus = PutMessageStatus.OS_PAGECACHE_BUSY;
                       break;
                   case LEADER_PENDING_FULL:
                       putMessageStatus = PutMessageStatus.OS_PAGECACHE_BUSY;
                       break;
               }
               PutMessageResult putMessageResult = new 
PutMessageResult(putMessageStatus, appendResult);
               if (putMessageStatus == PutMessageStatus.PUT_OK) {
                   // Statistics
                   
storeStatsService.getSinglePutMessageTopicTimesTotal(finalTopic).incrementAndGet();
                   
storeStatsService.getSinglePutMessageTopicSizeTotal(msg.getTopic()).addAndGet(appendResult.getWroteBytes());
               }
               return putMessageResult;
           });
   
   
   wait dledgerFuture complete。I looked at the code inside ,all actions is 
asynch,and use completableFuture。
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to