You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/10/11 09:17:46 UTC

[GitHub] [ignite-3] sanpwc commented on a diff in pull request #1181: IGNITE-17856

sanpwc commented on code in PR #1181:
URL: https://github.com/apache/ignite-3/pull/1181#discussion_r992065548


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -1051,4 +1062,42 @@ private CompletableFuture<Void> ensureReplicaIsPrimary(ReplicaRequest request) {
             return CompletableFuture.completedFuture(null);
         }
     }
+
+    /**
+     * Resolves read result to an appropriate binary row. Following rules are used for read result resolution:
+     * <ol>
+     *     <li>If txId is not null (RW request), assert that retrieved tx id matches proposed one or that retrieved tx id is null
+     *     and return binary row. Currently it's only possible to retrieve write intents if they belong to the same transaction,
+     *     locks prevent reading write intents created by others.</li>
+     *     <li>If txId is not null (RO request), perform write intent resolution if given readResult is a write intent iselft
+     *     or return binary row otherwise.</li>
+     * </ol>
+     *
+     * @param readResult Read result to resolve.
+     * @param txId Nullable transaction id, should be provided if resolution is performed within the context of RW transaction.
+     * @return Resolved binary row.
+     */
+    private BinaryRow resolveReadResult(ReadResult readResult, @Nullable UUID txId) {
+        if (readResult == null) {
+            return null;
+        } else {
+            if (txId != null) {

Review Comment:
   We will populate 
   ```
   else {
                   // RO request.
                   // TODO: IGNITE-17637 Implement a commit partition path write intent resolution logic
                   return readResult.binaryRow();
               }
   ```
   soon with writeIntent resolution code https://issues.apache.org/jira/browse/IGNITE-17637



-- 
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: notifications-unsubscribe@ignite.apache.org

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