wy96f commented on issue #2845: ARTEMIS-2336 Use zero copy to replicate journal/page/large message file (AGAIN) URL: https://github.com/apache/activemq-artemis/pull/2845#issuecomment-535440070 @franz1981 Have fun in vacation :) There is no problem with writability propagation, it works very well. when I set initial-replication-sync-timeout to a big value(E.g. 7 minutes), all of the queued up messages were sent and replication succeeded. The packet sending process with -Dio.netty.file.region=true or master is: 1. channel.writeAndFlush(artemis thread) 2. add bytebuf in outboundbuffer -- increase size, flush it -- decrease size(netty thread) The message sending process with -Dio.netty.file.region=false is: 1. channel.writeAndFlush(artemis thread) 2. add message in queue in ChunkedWriteHandler(netty thread) 3. if channel writable, add bytebuf in outboundbuffer -- increase size and flush it -- decrease size(netty thread) 4. If channel state transfers from unwritable to writable, call step3(netty thread) For -Dio.netty.file.region=false, given message will be first put into queue then put in `outboundbuffer` only when channel writable, size in `outboundbuffer` will be limited to highWaterMark(default 128k). When flush proceeds and size drops to lowWaterMark(default 32k), channel is writable again, over and over again. I guess `flowControl` often sees channel writable(actually lots of queued up messages in ChunkedWriteHandler's queue) so it's not limiting well. In the end, sync done message would not be delivered in time due to too many messages queued up. For -Dio.netty.file.region=true or master, size in `outboundbuffer` will continue to grow(netty thread is running all the time). When it exceeds 128k meaning channel not writable and `flowControl` triggers, broker(artemis thread) will not send packet until data in `outboundbuffer` is flushed. So there will be not much data queued up. Make sense?
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
