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/07/28 15:56:11 UTC

[GitHub] [ignite] Mmuzaf opened a new pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

Mmuzaf opened a new pull request #9285:
URL: https://github.com/apache/ignite/pull/9285


   
   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] Mmuzaf merged pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

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


   


-- 
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] Mmuzaf commented on a change in pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

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



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
##########
@@ -305,9 +306,6 @@
     /** Histogram of blocking PME durations. */
     private volatile HistogramMetricImpl blockingDurationHistogram;
 
-    /** Delay before rebalancing code is start executing after exchange completion. For tests only. */

Review comment:
       This parameter is used only for tests (to delay the exchange thread) and doesn't relate to the rebalance procedure itself. I agree with you that the naming of this property is confusing, so it's better to remove it at all.
   
   The 'right' rebalance delay still available through public API.
   org.apache.ignite.client.ClientCacheConfiguration#getRebalanceDelay
   




-- 
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] Mmuzaf commented on a change in pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

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



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
##########
@@ -1315,4 +1316,22 @@ public void removeIOStatistic(boolean destroy) {
         if (statHolderIdx != IoStatisticsHolderNoOp.INSTANCE)
             ctx.kernalContext().metric().remove(statHolderIdx.metricRegistryName(), destroy);
     }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {

Review comment:
       Fixed.




-- 
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] sk0x50 commented on a change in pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

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



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
##########
@@ -305,9 +306,6 @@
     /** Histogram of blocking PME durations. */
     private volatile HistogramMetricImpl blockingDurationHistogram;
 
-    /** Delay before rebalancing code is start executing after exchange completion. For tests only. */

Review comment:
       Yes, that is my fault. You are absolutely right. Thank you for the clarification.




-- 
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] sk0x50 commented on a change in pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

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



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
##########
@@ -1315,4 +1316,22 @@ public void removeIOStatistic(boolean destroy) {
         if (statHolderIdx != IoStatisticsHolderNoOp.INSTANCE)
             ctx.kernalContext().metric().remove(statHolderIdx.metricRegistryName(), destroy);
     }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {

Review comment:
       These methods are not required because you use a custom comparator anyway.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
##########
@@ -305,9 +306,6 @@
     /** Histogram of blocking PME durations. */
     private volatile HistogramMetricImpl blockingDurationHistogram;
 
-    /** Delay before rebalancing code is start executing after exchange completion. For tests only. */

Review comment:
       This change does not correlate with the description of the Jira ticket.
   I think it should be done under a separate issue https://issues.apache.org/jira/browse/IGNITE-12662
   and this change must be properly described here: https://ignite.apache.org/docs/latest/data-rebalancing#other-properties
   (At least, we should mark this property as deprecated and noop).

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
##########
@@ -4028,61 +3960,32 @@ void trim() {
      * Represents a cache rebalance order that takes into account both values: rebalance order itself and rebalance mode.
      * It is assumed SYNC caches should be rebalanced in the first place.
      */
-    private static class CacheRebalanceOrder implements Comparable<CacheRebalanceOrder> {
-        /** Cache rebalance order. */
-        private int order;
-
-        /** Cache rebalance mode. */
-        private CacheRebalanceMode mode;
-
-        /**
-         * Creates a new instance of CacheRebalanceOrder.
-         *
-         * @param order Cache rebalance order.
-         * @param mode Cache rebalance mode.
-         */
-        public CacheRebalanceOrder(int order, CacheRebalanceMode mode) {
-            this.order = order;
-            this.mode = mode;
-        }
+    private static class CacheRebalanceOrderComparator implements Comparator<CacheGroupContext>, Serializable {

Review comment:
       Yes, this is a common practice to implement `Serializable` interface by a comparator.
   In this particular case, `assignsSet` is always a "local map" and will never be serialized/deserialized.
   So, it is not required to implement `Serializable` 




-- 
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] Mmuzaf commented on a change in pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

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



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
##########
@@ -305,9 +306,6 @@
     /** Histogram of blocking PME durations. */
     private volatile HistogramMetricImpl blockingDurationHistogram;
 
-    /** Delay before rebalancing code is start executing after exchange completion. For tests only. */

Review comment:
       This parameter is used only for tests (to delay the exchange thread) and doesn't relate to the rebalance procedure itself. I agree with you that the naming of this property is confusing, so it's better to remove it at all.
   
   The 'right' rebalance delay still available through public API.
   `org.apache.ignite.client.ClientCacheConfiguration#getRebalanceDelay`
   `org.apache.ignite.configuration.CacheConfiguration#getRebalanceDelay`




-- 
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] Mmuzaf commented on a change in pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

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



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
##########
@@ -4028,61 +3960,32 @@ void trim() {
      * Represents a cache rebalance order that takes into account both values: rebalance order itself and rebalance mode.
      * It is assumed SYNC caches should be rebalanced in the first place.
      */
-    private static class CacheRebalanceOrder implements Comparable<CacheRebalanceOrder> {
-        /** Cache rebalance order. */
-        private int order;
-
-        /** Cache rebalance mode. */
-        private CacheRebalanceMode mode;
-
-        /**
-         * Creates a new instance of CacheRebalanceOrder.
-         *
-         * @param order Cache rebalance order.
-         * @param mode Cache rebalance mode.
-         */
-        public CacheRebalanceOrder(int order, CacheRebalanceMode mode) {
-            this.order = order;
-            this.mode = mode;
-        }
+    private static class CacheRebalanceOrderComparator implements Comparator<CacheGroupContext>, Serializable {

Review comment:
       Fixed.




-- 
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] Mmuzaf commented on pull request #9285: IGNITE-15208 Remove unnecessary rebalance order classes for exchange thread

Posted by GitBox <gi...@apache.org>.
Mmuzaf commented on pull request #9285:
URL: https://github.com/apache/ignite/pull/9285#issuecomment-894288751


   @sk0x50 If everything is OK, can I proceed with the merge?


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