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


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -858,10 +858,14 @@ private void enlist(int tableId, List<NodeWithTerm> 
assignments) {
                     tx.assignCommitPartition(new TablePartitionId(tableId, 
ThreadLocalRandom.current().nextInt(partsCnt)));
 
                     for (int p = 0; p < partsCnt; p++) {
-                        NodeWithTerm enlistmentToken = assignments.get(p);
+                        TablePartitionId tablePartId = new 
TablePartitionId(tableId, p);
 
-                        tx.enlist(new TablePartitionId(tableId, p),
-                                new 
IgniteBiTuple<>(topSrvc.getByConsistentId(enlistmentToken.name()), 
enlistmentToken.term()));
+                        if (tx.enlistedNodeAndTerm(tablePartId) == null) {

Review Comment:
   It's not that was expected.
   First of all proposed solution isn't thread safe. However it doesn't matter 
because enlist() itself won't re-enlist the partition. The main point here was 
in a fact that we shouldn't re-await primary replicas if they were already 
enlisted.



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