SzyWilliam commented on code in PR #930:
URL: https://github.com/apache/ratis/pull/930#discussion_r1349533432


##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLog.java:
##########
@@ -298,7 +308,7 @@ public EntryWithData getEntryWithData(long index) throws 
RaftLogIOException {
     try {
       CompletableFuture<ByteString> future = null;
       if (stateMachine != null) {
-        future = stateMachine.data().read(entry).exceptionally(ex -> {
+        future = stateMachine.data().read(entry, 
server.getTransactionContext(entry, false)).exceptionally(ex -> {

Review Comment:
   The `TransactionManager` manages the `TransactionContext` for non-leaders, 
while `PendingRequests` manages the context for the leader, am I getting it 
right?
   Normally when `DataApi.read` is called, this peer is leader and is going to 
replicate the full log to non-leaders. Why do we need to call 
`getTransactionContext` here?



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