amaliujia commented on PR #1707:
URL: https://github.com/apache/ratis/pull/1707#issuecomment-7153801564

   Thanks @ivandika3 for all the context in:
   https://issues.apache.org/jira/browse/RATIS-2509
   https://issues.apache.org/jira/browse/RATIS-2831
   https://issues.apache.org/jira/browse/RATIS-2524
    
   I'm concerned that `readIndexAsync` idea in this PR moves the 
linearizability contract from Ratis to every embedded caller: applications must 
query after the barrier, on the same division, against live state (not cache), 
and must handle a snapshot install happens in between. 
   
   Ratis can no longer enforce any of these. The returned Long also exposes a 
log index that callers might misuse (as it is just a number not a proto). 
   
   The root cause in RATIS-2831 is that thenCompose runs the query on the 
thread who completes the ReadIndex future. Could we fix that while keeping the 
read inside Ratis? 
   
   For example, add `readOnlyAsync(clientId, type, query, Executor),` which 
then uses `thenComposeAsync`? Per my understanding, now the gRPC thread 
bottleneck you mentioned is migrated off: the gRPC threads only need to do a 
lightweight submit, and the real query happens in the provided executor which 
is designed by the applications?


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

Reply via email to