petrov-mg commented on code in PR #12656:
URL: https://github.com/apache/ignite/pull/12656#discussion_r2728000501
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java:
##########
@@ -402,8 +405,10 @@ final void map(ClusterNode nearNode,
needReplyToNear = true;
}
- // If there are readers updates then nearNode should not finish before
primary response received.
- sendDhtRequests(nearNode, ret, !readersOnlyNodes);
+ // "Near" node should not finish until it receives a response from
primary node in the following cases:
+ // - only "near cache" is updated
+ // - primary failed to process any keys
+ sendDhtRequests(nearNode, ret, !(readersOnlyNodes ||
hasPrimaryUpdErrors));
Review Comment:
The last argument of `sendDhtRequests` method is `boolean sndRes`. It
controls whether backups, after processing GridDhtAtomicUpdateRequest, will
send a response to the `near` node with `hasResult` flag set to true or false.
If `near` node receives responses from all backups with
`GridDhtAtomicNearResponse#hasResult`set to true - it can complete cache
operation without waiting for a response from the primary node
(GridNearAtomicUpdateFuture#onDhtResponse).
Problem this PR is intended to solve - `near` node revceives responses from
all backups and completes `putAll` operation before primary node sends
GridNearAtomicUpdateResponse message with a list of entries that it failed to
process. `near` node receives no information from backup nodes that primary
node failed to process some entries but completes putAll operation
successfully. Near node must rise exception or successfully insert all
inserting entries.
So `!(readersOnlyNodes || hasPrimaryUpdErrors)` makes `near node` not to
complete `putAll` operation even if it receives all responses from backup
nodes, but wait for the responce from primary node (it contains entries which
processing is failed).
--
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]