smengcl opened a new pull request, #1104:
URL: https://github.com/apache/ratis/pull/1104

   ## What changes were proposed in this pull request?
   
   Background: [RATIS-1994](https://issues.apache.org/jira/browse/RATIS-1994) 
adds a feature allowing `AsyncApi#send()` to return only when a specified 
replication level is reached. This was done by adding `waitForReplication()` in 
RaftServer.
   
   However, two bugs are found with 
[RATIS-1994](https://issues.apache.org/jira/browse/RATIS-1994) when the (write) 
replication level is set to higher than `MAJORITY` (the default):
   
   1. When the request is retried (e.g. when timed out), the future retrieved 
from cache is not correctly waited on with `waitForReplication()` again. This 
causes divergence in the desired behavior depending on if the request is 
retried or not. This is fixed by invoking waitForReplication() in 
`writeAsync()` rather than `appendTransaction()`.
   
   2. `waitForReplication()`'s watch request reply was incorrectly ignored, 
this is fixed by combining the reply from write and watch together using 
`combineReplies()`.
   
   Thanks @szetszwo for the help during debugging and making the patch.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/RATIS-2102
   
   ## How was this patch tested?
   
   - Tested manually during HDDS-10108 dev. Maybe it is a good idea to add some 
test cases around this in Ratis.


-- 
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: issues-unsubscr...@ratis.apache.org

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

Reply via email to