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

[PR] IGNITE-23632 Support force deactivation flag in thin client [ignite]

NSAmelchev opened a new pull request, #11647:
URL: https://github.com/apache/ignite/pull/11647

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] 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 pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _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.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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-23632 Support force deactivation flag in thin client [ignite]

Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov commented on code in PR #11647:
URL: https://github.com/apache/ignite/pull/11647#discussion_r1839808132


##########
modules/core/src/main/java/org/apache/ignite/client/ClientCluster.java:
##########
@@ -41,6 +42,19 @@ public interface ClientCluster extends ClientClusterGroup {
      */
     public void state(ClusterState newState) throws ClientException;
 
+    /**
+     * Changes current cluster state to given {@code newState} cluster state.
+     * <p>
+     * <b>NOTE:</b>
+     * Deactivation clears in-memory caches (without persistence) including the system caches.
+     *
+     * @param newState New cluster state.
+     * @param forceDeactivation If {@code true}, cluster deactivation will be forced.
+     * @throws ClientException If change state operation failed.
+     */
+    @IgniteExperimental
+    public void state(ClusterState newState, boolean forceDeactivation) throws ClientException;

Review Comment:
   Corresponding method for a node implemented in private API - IgniteClusterEx.
   Can we implement this into private thin client methods, also?



-- 
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-23632 Support force deactivation flag in thin client [ignite]

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #11647:
URL: https://github.com/apache/ignite/pull/11647#issuecomment-2462471492

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11647) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=11647&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=11647&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=11647&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=11647&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=11647&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11647)
   
   


-- 
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-23632 Support force deactivation flag in thin client [ignite]

Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov commented on code in PR #11647:
URL: https://github.com/apache/ignite/pull/11647#discussion_r1839811527


##########
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterImpl.java:
##########
@@ -67,6 +72,15 @@ class ClientClusterImpl extends ClientClusterGroupImpl implements ClientCluster
                     }
 
                     req.out().writeByte((byte)newState.ordinal());
+
+                    if (protocolCtx.isFeatureSupported(ProtocolBitmaskFeature.FORCE_DEACTIVATION_FLAG)) {
+                        req.out().writeBoolean(forceDeactivation);
+                    }
+                    else if (forceDeactivation) {

Review Comment:
   This will break change state from new client to old servers:
   
   `state(ClusterState newState)` always pass `true` and old server not support `forceDeactivation`.
   
   So, any change of cluster state from thin client will throw `ClientFeatureNotSupportedByServerException`.



-- 
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-23632 Support force deactivation flag in thin client [ignite]

Posted by "NSAmelchev (via GitHub)" <gi...@apache.org>.
NSAmelchev commented on code in PR #11647:
URL: https://github.com/apache/ignite/pull/11647#discussion_r1853326128


##########
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterImpl.java:
##########
@@ -67,6 +72,15 @@ class ClientClusterImpl extends ClientClusterGroupImpl implements ClientCluster
                     }
 
                     req.out().writeByte((byte)newState.ordinal());
+
+                    if (protocolCtx.isFeatureSupported(ProtocolBitmaskFeature.FORCE_DEACTIVATION_FLAG)) {
+                        req.out().writeBoolean(forceDeactivation);
+                    }
+                    else if (forceDeactivation) {

Review Comment:
   Fixed, thank you.



##########
modules/core/src/main/java/org/apache/ignite/client/ClientCluster.java:
##########
@@ -41,6 +42,19 @@ public interface ClientCluster extends ClientClusterGroup {
      */
     public void state(ClusterState newState) throws ClientException;
 
+    /**
+     * Changes current cluster state to given {@code newState} cluster state.
+     * <p>
+     * <b>NOTE:</b>
+     * Deactivation clears in-memory caches (without persistence) including the system caches.
+     *
+     * @param newState New cluster state.
+     * @param forceDeactivation If {@code true}, cluster deactivation will be forced.
+     * @throws ClientException If change state operation failed.
+     */
+    @IgniteExperimental
+    public void state(ClusterState newState, boolean forceDeactivation) throws ClientException;

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-23632 Support force deactivation flag in thin client [ignite]

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


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