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 2022/04/12 14:15:04 UTC

[GitHub] [rocketmq] iamqq23ue opened a new issue, #4159: Is FlushConsumeQueueService necessary?

iamqq23ue opened a new issue, #4159:
URL: https://github.com/apache/rocketmq/issues/4159

   version 4.9.1
   
   From the ReputMessageService code, we can finally locate the following code。 “this.fileChannel.write(ByteBuffer.wrap(data));” is already possible to write data to disk, why do we need FlushConsumeQueueService?
   ————————————————————————————————————————————
   public boolean appendMessage(final byte[] data) {
       int currentPos = this.wrotePosition.get();
   
       if ((currentPos + data.length) <= this.fileSize) {
           try {
               this.fileChannel.position(currentPos);
               this.fileChannel.write(ByteBuffer.wrap(data));
           } catch (Throwable e) {
               log.error("Error occurred when append message to mappedFile.", e);
           }
           this.wrotePosition.addAndGet(data.length);
           return true;
       }
   
       return false;
   }
   ——————————————————————————————————————
   
   


-- 
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: dev-unsubscribe@rocketmq.apache.org.apache.org

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


[GitHub] [rocketmq] lizhimins commented on issue #4159: Is FlushConsumeQueueService necessary?

Posted by GitBox <gi...@apache.org>.
lizhimins commented on issue #4159:
URL: https://github.com/apache/rocketmq/issues/4159#issuecomment-1098807741

   对于索引来说每次写入的数据量小但是更新频繁,用 mmap 确实会更好,还有 commitlog 应该用 filechannel。


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] iamqq23ue closed issue #4159: Is FlushConsumeQueueService necessary?

Posted by GitBox <gi...@apache.org>.
iamqq23ue closed issue #4159: Is  FlushConsumeQueueService necessary?
URL: https://github.com/apache/rocketmq/issues/4159


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] panzhi33 commented on issue #4159: Is FlushConsumeQueueService necessary?

Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #4159:
URL: https://github.com/apache/rocketmq/issues/4159#issuecomment-1097585829

   fileChannel.write does not directly write ByteBuffer data to disk


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] panzhi33 commented on issue #4159: Is FlushConsumeQueueService necessary?

Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #4159:
URL: https://github.com/apache/rocketmq/issues/4159#issuecomment-1097685227

   Every time the data is written, it will be forced, and the disk io pressure will be relatively large, so it needs to be changed to this asynchronous。
   and 5.0 has been modified to mappedbytebuffer 


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] iamqq23ue commented on issue #4159: Is FlushConsumeQueueService necessary?

Posted by GitBox <gi...@apache.org>.
iamqq23ue commented on issue #4159:
URL: https://github.com/apache/rocketmq/issues/4159#issuecomment-1097589216

   yes,I know that data is written to the system cache first, but eventually it is written to disk.And FlushConsumeQueueService is also executed asynchronously。
   If it's to ensure data is written to disk, why not use filechannel.force.&nbsp;
   
   
   Or write to mappedbytebuffer like commitlog.
   
   
   
   
   ------------------&nbsp;原始邮件&nbsp;------------------
   发件人:                                                                                                                        "apache/rocketmq"                                                                                    ***@***.***&gt;;
   发送时间:&nbsp;2022年4月13日(星期三) 中午1:50
   ***@***.***&gt;;
   ***@***.******@***.***&gt;;
   主题:&nbsp;Re: [apache/rocketmq] Is  FlushConsumeQueueService necessary? (Issue #4159)
   
   
   
   
   
    
   fileChannel.write does not directly write ByteBuffer data to disk
    
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   You are receiving this because you authored the thread.Message ID: ***@***.***&gt;


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] lizhimins commented on issue #4159: Is FlushConsumeQueueService necessary?

Posted by GitBox <gi...@apache.org>.
lizhimins commented on issue #4159:
URL: https://github.com/apache/rocketmq/issues/4159#issuecomment-1098808862

   个人认为这里主要是避免 os 积累太多的脏页导致 io 抖动


-- 
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: dev-unsubscribe@rocketmq.apache.org

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