ss77892 opened a new pull request, #12104:
URL: https://github.com/apache/ozone/pull/12104

   ## What changes were proposed in this pull request?
   
   The datanode gRPC server uses Netty's default write-buffer watermarks on 
client connections. The default high watermark is 64 KiB, which is smaller than 
a single positioned-read reply (a 64 KiB range plus framing). So every 
positioned-read reply pushes the connection over the high watermark:
   
   1. The connection becomes unwritable, and the HTTP/2 flow controller stops 
part-way through the reply.
   2. The connection writes that first part to the socket and becomes writable 
again.
   3. The writable event makes the flow controller flush the rest of the reply 
in a separate socket write.
   
   Every reply flips writability off and on and is split across extra socket 
writes.
   
   Set the write-buffer watermarks of each client connection 
(`withChildOption(ChannelOption.WRITE_BUFFER_WATER_MARK, ...)`) to 512 KiB low 
/ 1 MiB high in `XceiverServerGrpc`. A reply, or several concurrent replies, 
now fit under the high watermark and are written without flipping writability. 
Memory per connection stays bounded: HTTP/2 flow control (gRPC's default 1 MiB 
connection window) still limits how much each connection can buffer.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17871
   
   ## How was this patch tested?
   
   Added `TestXceiverServerGrpc`. It sends 4 concurrent positioned-read replies 
(64 KiB + 1 KiB each) over an HTTP/2 connection whose flow controller is set up 
like gRPC's server (1 MiB window), and counts writability changes:
   
   - `defaultWaterMarkFlipsWritabilityOnEveryReply`: with Netty's default 
watermarks, writability changes at least twice per reply, reproducing the 
problem.
   - `childWaterMarkKeepsConnectionWritable`: with the new watermarks, 
writability never changes.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to