amaliujia opened a new pull request, #1618: URL: https://github.com/apache/ratis/pull/1618
## What changes were proposed in this pull request? Summary Fix pending write capacity leak when leader rejects a client write in preAppend (or otherwise fails appendLog before the request is queued). Leaders limit concurrent client writes with pending request quotas (element count and approximate total message bytes). For each write, the server calls tryAcquire to reserve capacity, then addPendingRequest once the entry is appended and queued. The pending requests will handle the resource release upon removal from the map. However, if the write fails after tryAcquire but before addPendingRequest, the reservation was never released. Each failure permanently consumed quota even though no request remained pending and the client already received an error. After enough failures (e.g. repeated state-machine rejection in preAppendTransaction), the leader still appeared healthy but new writes failed with ResourceUnavailableException while the pending queue was empty. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/RATIS-2722 ## How was this patch tested? Integration test. -- 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]
