You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "denis-chudov (via GitHub)" <gi...@apache.org> on 2024/07/08 11:20:23 UTC

[PR] IGNITE-22555 [ignite-3]

denis-chudov opened a new pull request, #4055:
URL: https://github.com/apache/ignite-3/pull/4055

   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
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-22555 Fixed assertion in ReplicaStateManager.onPrimaryElected [ignite-3]

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


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/negotiation/LeaseAgreement.java:
##########
@@ -158,4 +158,12 @@ public void checkValid(
             }
         }
     }
+
+    void onResponse(LeaseGrantedMessageResponse response) {
+        responseFut.complete(response);

Review Comment:
   This future should be created internally, because it is controlled by these new methods.
   I would use a private constructor to create UNDEFINED_AGREEMENT.



##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/negotiation/LeaseNegotiator.java:
##########
@@ -120,12 +120,26 @@ public LeaseAgreement getAndRemoveIfReady(ReplicationGroupId groupId) {
         return res[0] == null ? UNDEFINED_AGREEMENT : res[0];
     }
 
+    /**
+     * Creates an agreement.
+     *
+     * @param groupId Group id.
+     * @param lease Lease to negotiate.
+     */
+    public void createAgreement(ReplicationGroupId groupId, Lease lease) {
+        leaseToNegotiate.put(groupId, new LeaseAgreement(lease, new CompletableFuture<>()));

Review Comment:
   Use constructor without future as a parameter here.



##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -449,12 +460,16 @@ private void updateLeaseBatchInternal() {
                 if (e != null) {
                     LOG.error("Lease update invocation failed", e);
 
+                    cancelAgreements(toBeNegotiated.keySet());
+
                     return;
                 }
 
                 if (!success) {
                     LOG.debug("Lease update invocation failed");

Review Comment:
   Maybe we will log this as a warning because, in ordinary cases, it should pass.



-- 
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-22555 Fixed assertion in ReplicaStateManager.onPrimaryElected [ignite-3]

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


-- 
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-22555 Fixed assertion in ReplicaStateManager.onPrimaryElected [ignite-3]

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


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -449,12 +460,16 @@ private void updateLeaseBatchInternal() {
                 if (e != null) {
                     LOG.error("Lease update invocation failed", e);
 
+                    cancelAgreements(toBeNegotiated.keySet());
+
                     return;
                 }
 
                 if (!success) {
                     LOG.debug("Lease update invocation failed");

Review Comment:
   done



##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/negotiation/LeaseNegotiator.java:
##########
@@ -120,12 +120,26 @@ public LeaseAgreement getAndRemoveIfReady(ReplicationGroupId groupId) {
         return res[0] == null ? UNDEFINED_AGREEMENT : res[0];
     }
 
+    /**
+     * Creates an agreement.
+     *
+     * @param groupId Group id.
+     * @param lease Lease to negotiate.
+     */
+    public void createAgreement(ReplicationGroupId groupId, Lease lease) {
+        leaseToNegotiate.put(groupId, new LeaseAgreement(lease, new CompletableFuture<>()));

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-22555 Fixed assertion in ReplicaStateManager.onPrimaryElected [ignite-3]

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


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/negotiation/LeaseAgreement.java:
##########
@@ -158,4 +158,12 @@ public void checkValid(
             }
         }
     }
+
+    void onResponse(LeaseGrantedMessageResponse response) {
+        responseFut.complete(response);

Review Comment:
   exactly



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