denis-chudov commented on code in PR #2918:
URL: https://github.com/apache/ignite-3/pull/2918#discussion_r1422784020
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/TransactionStateResolver.java:
##########
@@ -288,32 +291,28 @@ private void sendAndRetry(
ReplicationGroupId replicaGrp,
TxStateCommitPartitionRequest request
) {
- ClusterNode nodeToSend = primaryReplicaMapping.get(replicaGrp).stream()
- .map(clusterNodeResolver)
- .filter(Objects::nonNull)
- .findFirst()
- .orElseThrow(() -> new IgniteInternalException("All replica
nodes are unavailable"));
-
- replicaService.invoke(nodeToSend, request).thenAccept(resp -> {
- assert resp instanceof LeaderOrTxState : "Unsupported response
type [type=" + resp.getClass().getSimpleName() + ']';
-
- LeaderOrTxState stateOrLeader = (LeaderOrTxState) resp;
-
- String nextNodeToSend = stateOrLeader.leaderName();
-
- if (nextNodeToSend == null) {
- resFut.complete(stateOrLeader.txMeta());
- } else {
- LinkedHashSet<String> newAssignment = new LinkedHashSet<>();
-
- newAssignment.add(nextNodeToSend);
- newAssignment.addAll(primaryReplicaMapping.get(replicaGrp));
-
- primaryReplicaMapping.put(replicaGrp, newAssignment);
-
- sendAndRetry(resFut, replicaGrp, request);
- }
- });
+ HybridTimestamp now = clock.now();
+
+ placementDriver.awaitPrimaryReplica(replicaGrp, now,
AWAIT_PRIMARY_REPLICA_TIMEOUT, MILLISECONDS)
Review Comment:
done
--
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]