You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/08/26 13:09:26 UTC

[GitHub] [ignite] ololo3000 opened a new pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

ololo3000 opened a new pull request #9357:
URL: https://github.com/apache/ignite/pull/9357


   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



[GitHub] [ignite] ololo3000 commented on a change in pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

Posted by GitBox <gi...@apache.org>.
ololo3000 commented on a change in pull request #9357:
URL: https://github.com/apache/ignite/pull/9357#discussion_r698585259



##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedNode.java
##########
@@ -150,4 +150,9 @@ public IsolatedNode(UUID id, Map<String, Object> attrs, IgniteProductVersion ver
     @Override public void setCacheMetrics(Map<Integer, CacheMetrics> cacheMetrics) {
         this.cacheMetrics = cacheMetrics != null ? cacheMetrics : Collections.emptyMap();
     }
+
+    /** */
+    public void setAttributes(Map<String, Object> attrs) {
+        this.attrs = U.sealMap(attrs);

Review comment:
       To avoid attributes change after node start outside DiscoverySpi. As mentioned in org.apache.ignite.cluster.ClusterNode#attributes javadoc.




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



[GitHub] [ignite] ololo3000 commented on a change in pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

Posted by GitBox <gi...@apache.org>.
ololo3000 commented on a change in pull request #9357:
URL: https://github.com/apache/ignite/pull/9357#discussion_r698585259



##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedNode.java
##########
@@ -150,4 +150,9 @@ public IsolatedNode(UUID id, Map<String, Object> attrs, IgniteProductVersion ver
     @Override public void setCacheMetrics(Map<Integer, CacheMetrics> cacheMetrics) {
         this.cacheMetrics = cacheMetrics != null ? cacheMetrics : Collections.emptyMap();
     }
+
+    /** */
+    public void setAttributes(Map<String, Object> attrs) {
+        this.attrs = U.sealMap(attrs);

Review comment:
       To avoid attributes change after node start outside DiscoverySpi. As mentioned in org.apache.ignite.cluster.ClusterNode#attributes.

##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedNode.java
##########
@@ -150,4 +150,9 @@ public IsolatedNode(UUID id, Map<String, Object> attrs, IgniteProductVersion ver
     @Override public void setCacheMetrics(Map<Integer, CacheMetrics> cacheMetrics) {
         this.cacheMetrics = cacheMetrics != null ? cacheMetrics : Collections.emptyMap();
     }
+
+    /** */
+    public void setAttributes(Map<String, Object> attrs) {
+        this.attrs = U.sealMap(attrs);

Review comment:
       To avoid attributes change after node start outside DiscoverySpi. As mentioned in org.apache.ignite.cluster.ClusterNode#attributes javadoc.

##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java
##########
@@ -189,6 +206,23 @@
 
     /** {@inheritDoc} */
     @Override public void spiStart(@Nullable String igniteInstanceName) throws IgniteSpiException {
+        if (auth != null) {
+            Map<String, Object> nodeAttrs = new HashMap<>(locNode.attributes());

Review comment:
       Done.

##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedNode.java
##########
@@ -150,4 +150,9 @@ public IsolatedNode(UUID id, Map<String, Object> attrs, IgniteProductVersion ver
     @Override public void setCacheMetrics(Map<Integer, CacheMetrics> cacheMetrics) {
         this.cacheMetrics = cacheMetrics != null ? cacheMetrics : Collections.emptyMap();
     }
+
+    /** */
+    public void setAttributes(Map<String, Object> attrs) {
+        this.attrs = U.sealMap(attrs);

Review comment:
       To avoid attributes change after node start outside DiscoverySpi. As mentioned in `org.apache.ignite.cluster.ClusterNode#attributes` javadoc.




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



[GitHub] [ignite] nizhikov commented on a change in pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #9357:
URL: https://github.com/apache/ignite/pull/9357#discussion_r697543692



##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedNode.java
##########
@@ -150,4 +150,9 @@ public IsolatedNode(UUID id, Map<String, Object> attrs, IgniteProductVersion ver
     @Override public void setCacheMetrics(Map<Integer, CacheMetrics> cacheMetrics) {
         this.cacheMetrics = cacheMetrics != null ? cacheMetrics : Collections.emptyMap();
     }
+
+    /** */
+    public void setAttributes(Map<String, Object> attrs) {
+        this.attrs = U.sealMap(attrs);

Review comment:
       Why do we need `sealMap` here?




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



[GitHub] [ignite] ololo3000 commented on a change in pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

Posted by GitBox <gi...@apache.org>.
ololo3000 commented on a change in pull request #9357:
URL: https://github.com/apache/ignite/pull/9357#discussion_r698586143



##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java
##########
@@ -189,6 +206,23 @@
 
     /** {@inheritDoc} */
     @Override public void spiStart(@Nullable String igniteInstanceName) throws IgniteSpiException {
+        if (auth != null) {
+            Map<String, Object> nodeAttrs = new HashMap<>(locNode.attributes());

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



[GitHub] [ignite] nizhikov merged pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

Posted by GitBox <gi...@apache.org>.
nizhikov merged pull request #9357:
URL: https://github.com/apache/ignite/pull/9357


   


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



[GitHub] [ignite] ololo3000 commented on a change in pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

Posted by GitBox <gi...@apache.org>.
ololo3000 commented on a change in pull request #9357:
URL: https://github.com/apache/ignite/pull/9357#discussion_r698585259



##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedNode.java
##########
@@ -150,4 +150,9 @@ public IsolatedNode(UUID id, Map<String, Object> attrs, IgniteProductVersion ver
     @Override public void setCacheMetrics(Map<Integer, CacheMetrics> cacheMetrics) {
         this.cacheMetrics = cacheMetrics != null ? cacheMetrics : Collections.emptyMap();
     }
+
+    /** */
+    public void setAttributes(Map<String, Object> attrs) {
+        this.attrs = U.sealMap(attrs);

Review comment:
       To avoid attributes change after node start outside DiscoverySpi. As mentioned in `org.apache.ignite.cluster.ClusterNode#attributes` javadoc.




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



[GitHub] [ignite] nizhikov commented on a change in pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #9357:
URL: https://github.com/apache/ignite/pull/9357#discussion_r697542431



##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java
##########
@@ -189,6 +206,23 @@
 
     /** {@inheritDoc} */
     @Override public void spiStart(@Nullable String igniteInstanceName) throws IgniteSpiException {
+        if (auth != null) {
+            Map<String, Object> nodeAttrs = new HashMap<>(locNode.attributes());

Review comment:
       This code duplicates `ServerImpl#localAuthentication`, `ZookeepeDiscoveryImp#localAuthentication` and `ZookeepeDiscoveryImp#authenticateNode`
   
   Let's deduplicate it.




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



[GitHub] [ignite] ololo3000 commented on a change in pull request #9357: IGNITE-15378 Fixes node restart in maintenance mode with security enabled.

Posted by GitBox <gi...@apache.org>.
ololo3000 commented on a change in pull request #9357:
URL: https://github.com/apache/ignite/pull/9357#discussion_r698585259



##########
File path: modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedNode.java
##########
@@ -150,4 +150,9 @@ public IsolatedNode(UUID id, Map<String, Object> attrs, IgniteProductVersion ver
     @Override public void setCacheMetrics(Map<Integer, CacheMetrics> cacheMetrics) {
         this.cacheMetrics = cacheMetrics != null ? cacheMetrics : Collections.emptyMap();
     }
+
+    /** */
+    public void setAttributes(Map<String, Object> attrs) {
+        this.attrs = U.sealMap(attrs);

Review comment:
       To avoid attributes change after node start outside DiscoverySpi. As mentioned in org.apache.ignite.cluster.ClusterNode#attributes.




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