ss77892 opened a new pull request, #10522:
URL: https://github.com/apache/ozone/pull/10522
## What changes were proposed in this pull request?
When the Ozone client performs a streaming block read,
XceiverClientGrpc.streamRead() previously called onNext() on the gRPC request
observer unconditionally, without checking whether the underlying gRPC stream
was ready to accept more data. Under load, this ignores gRPC's flow control:
when the transport buffer is full, isReady() returns false, and writing anyway
causes unbounded buffering on the client side instead of applying backpressure.
New gRPC flow control backpressure:
• Before sending a request, streamRead() now checks
ClientCallStreamObserver.isReady(). If the stream is not ready, it parks the
calling thread (10ms intervals via LockSupport.parkNanos) and waits for the
stream to become ready, only then calling onNext().
• The wait is bounded by a deadline. If the caller supplies a read deadline
(StreamingReadResponse.getReadDeadlineNs()), that deadline is honored;
otherwise it falls back to the client-level read timeout. A TimeoutIOException
is thrown if the stream never becomes ready within the deadline.
• The wait is interrupt-aware: on interruption it throws
InterruptedIOException and restores the thread's interrupt flag.
• A new readDeadlineNs field is added to StreamingReadResponse.
StreamBlockInputStream sets it before/after streamRead() so a single deadline
bounds both the isReady() flow-control wait and the subsequent response wait in
poll(). The poll() timeout logic is switched from a start-time/elapsed
computation to this shared deadline, and the read path refreshes the deadline
before each readBlock() so time spent waiting on flow control does not eat into
the response-wait budget.
• XceiverClientSpi.streamRead() and the overridden
XceiverClientGrpc.streamRead() signatures now declare throws IOException to
surface the timeout/interrupt conditions.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15551
## How was this patch tested?
• new UTs in TestXceiverClientGrpc and TestStreamBlockInputStream
• HBase cluster with HFiles stored on ozone FS.
--
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]