You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "vadimkolodingg (via GitHub)" <gi...@apache.org> on 2025/03/03 13:14:59 UTC

[PR] IGNITE-24067 Adjust placement driver for the usage of learners [ignite-3]

vadimkolodingg opened a new pull request, #5332:
URL: https://github.com/apache/ignite-3/pull/5332

   Lease placement driver is adjusted: primary replica should be colocated with consensus group, so the lease placement driver should filter the assignments to get only peers before choosing the lease candidate. 


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


Re: [PR] IGNITE-24067 Adjust placement driver for the usage of learners [ignite-3]

Posted by "vadimkolodingg (via GitHub)" <gi...@apache.org>.
vadimkolodingg commented on code in PR #5332:
URL: https://github.com/apache/ignite-3/pull/5332#discussion_r1981308063


##########
modules/placement-driver/src/test/java/org/apache/ignite/internal/placementdriver/LeaseUpdaterTest.java:
##########
@@ -301,11 +288,69 @@ public void testLeaseAmongPendings() throws Exception {
         Lease lease = awaitForLease();
 
         assertEquals(pendingNode.name(), lease.getLeaseholder());
+    }
 
-        leaseUpdater.deactivate();
+    @Test
+    public void testLeaseAmongPendingsSkipsLearners() throws Exception {
+        var peer = Assignment.forPeer("test-node-pending-peer");
+        var learner = Assignment.forLearner("test-node-pending-learner");
+
+        // no stable, pending peer and learner
+        mockTopology(Set.of(), Set.of(peer, learner));
+
+        Lease lease = awaitForLease();
+
+        assertEquals(peer.consistentId(), lease.getLeaseholder());
+
+        // no stable, pending learner only
+        mockTopology(Set.of(), Set.of(learner));
+
+        assertThrows(AssertionError.class, this::awaitForLease);

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

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


Re: [PR] IGNITE-24067 Adjust placement driver for the usage of learners [ignite-3]

Posted by "Pochatkin (via GitHub)" <gi...@apache.org>.
Pochatkin merged PR #5332:
URL: https://github.com/apache/ignite-3/pull/5332


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


Re: [PR] IGNITE-24067 Adjust placement driver for the usage of learners [ignite-3]

Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on code in PR #5332:
URL: https://github.com/apache/ignite-3/pull/5332#discussion_r1981173929


##########
modules/placement-driver/src/test/java/org/apache/ignite/internal/placementdriver/LeaseUpdaterTest.java:
##########
@@ -301,11 +288,69 @@ public void testLeaseAmongPendings() throws Exception {
         Lease lease = awaitForLease();
 
         assertEquals(pendingNode.name(), lease.getLeaseholder());
+    }
 
-        leaseUpdater.deactivate();
+    @Test
+    public void testLeaseAmongPendingsSkipsLearners() throws Exception {
+        var peer = Assignment.forPeer("test-node-pending-peer");
+        var learner = Assignment.forLearner("test-node-pending-learner");
+
+        // no stable, pending peer and learner
+        mockTopology(Set.of(), Set.of(peer, learner));
+
+        Lease lease = awaitForLease();
+
+        assertEquals(peer.consistentId(), lease.getLeaseholder());
+
+        // no stable, pending learner only
+        mockTopology(Set.of(), Set.of(learner));
+
+        assertThrows(AssertionError.class, this::awaitForLease);

Review Comment:
   This check will last 10 seconds, which is not needed. Maybe add an overloaded method with timeout and call it here with 1 sec value?



##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -330,6 +330,10 @@ private static IgniteTuple3<List<Lease>, Boolean, Boolean> replaceProlongableLea
         ClusterNode primaryCandidate = null;
 
         for (Assignment assignment : assignments) {

Review Comment:
   Previously I suggested to rename variables like `deserFunction`, but there is one left: in parameters of `AssignmentsTracker#updateGroupAssignments`. Would you rename it please?



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


Re: [PR] IGNITE-24067 Adjust placement driver for the usage of learners [ignite-3]

Posted by "vadimkolodingg (via GitHub)" <gi...@apache.org>.
vadimkolodingg commented on code in PR #5332:
URL: https://github.com/apache/ignite-3/pull/5332#discussion_r1981309625


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -330,6 +330,10 @@ private static IgniteTuple3<List<Lease>, Boolean, Boolean> replaceProlongableLea
         ClusterNode primaryCandidate = null;
 
         for (Assignment assignment : assignments) {

Review Comment:
   my bad, 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: notifications-unsubscribe@ignite.apache.org

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