rpuch commented on code in PR #1246:
URL: https://github.com/apache/ignite-3/pull/1246#discussion_r1006528230


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/outgoing/OutgoingSnapshot.java:
##########
@@ -284,44 +292,65 @@ private SnapshotMvDataResponse.ResponseEntry 
rowEntry(RowId rowId) {
     }
 
     /**
-     * Reads chunk of TX states from partition and returns a future with the 
response.
+     * Reads a chunk of TX states from partition and returns a future with the 
response.
      *
-     * @param txDataRequest Data request.
+     * @param request Data request.
      */
-    CompletableFuture<SnapshotTxDataResponse> 
handleSnapshotTxDataRequest(SnapshotTxDataRequest txDataRequest) {
-        //TODO https://issues.apache.org/jira/browse/IGNITE-17935
-        return null;
+    CompletableFuture<SnapshotTxDataResponse> 
handleSnapshotTxDataRequest(SnapshotTxDataRequest request) {
+        List<IgniteBiTuple<UUID, TxMeta>> rows = new ArrayList<>();
+
+        while (!finishedTxData && rows.size() < 
request.maxTransactionsInBatch()) {
+            if (txDataCursor.hasNext()) {
+                rows.add(txDataCursor.next());
+            } else {
+                finishedTxData = true;
+                closeQuietly(txDataCursor);
+            }
+        }
+
+        SnapshotTxDataResponse response = buildTxDataResponse(rows, 
finishedTxData);
+
+        return CompletableFuture.completedFuture(response);

Review Comment:
   It's executed in a pool owned by `OutgoingSnapshotsManager`.
   
   There is IGNITE-17935 in which TODOs will be resolved, but threading issues 
related to TX data sending seem to already be sorted out. If not, please 
elaborate what is not ok.



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