vldpyatkov commented on code in PR #2483:
URL: https://github.com/apache/ignite-3/pull/2483#discussion_r1304337079


##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java:
##########
@@ -235,7 +235,9 @@ private void onReplicaMessageReceived(NetworkMessage 
message, String senderConsi
             // replicaFut is always completed here.
             Replica replica = replicaFut.join();
 
-            CompletableFuture<?> result = replica.processRequest(request);
+            String senderId = 
clusterNetSvc.topologyService().getByConsistentId(senderConsistentId).id();
+
+            CompletableFuture<?> result = replica.processRequest(request, 
senderId);

Review Comment:
   I don't like this way because we have no guarantee that the consistent id 
for the sender of the request matches the node id.



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java:
##########
@@ -608,7 +610,7 @@ private void idleSafeTimeSync() {
                         .groupId(r.join().groupId())
                         .build();
 
-                r.join().processRequest(req);
+                r.join().processRequest(req, 
clusterNetSvc.topologyService().localMember().id());

Review Comment:
   we can calculae the local memeber id once on starting of the manager.



##########
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java:
##########
@@ -374,7 +374,13 @@ public class IgniteImpl implements Ignite {
         ReplicaService replicaSvc = new 
ReplicaService(clusterSvc.messagingService(), clock);
 
         // TODO: IGNITE-19344 - use nodeId that is validated on join (and 
probably generated differently).
-        txManager = new TxManagerImpl(replicaSvc, lockMgr, clock, new 
TransactionIdGenerator(() -> clusterSvc.nodeName().hashCode()));
+        txManager = new TxManagerImpl(
+                replicaSvc,
+                lockMgr,
+                clock,
+                new TransactionIdGenerator(() -> 
clusterSvc.nodeName().hashCode()),
+                () -> clusterSvc.topologyService().localMember().id()

Review Comment:
   I think it's better to initialize the manager by a local member on start 
than pass the two closures through a constructor.



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