Repository: ignite Updated Branches: refs/heads/master 41dddb87d -> 1b2afbb8d
ignite-4154 Fixed node version check for compression feature usage Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/671a77a2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/671a77a2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/671a77a2 Branch: refs/heads/master Commit: 671a77a2d81cac401765dddf25f30fba4e4ab17f Parents: bbaa79a Author: sboikov <[email protected]> Authored: Thu Dec 8 12:56:46 2016 +0300 Committer: sboikov <[email protected]> Committed: Thu Dec 8 12:56:46 2016 +0300 ---------------------------------------------------------------------- .../GridCachePartitionExchangeManager.java | 23 +++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/671a77a2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java index f04a6ce..7f11dc4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java @@ -826,7 +826,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana break; } - else if (node.version().compareToIgnoreTimestamp(GridDhtPartitionsAbstractMessage.PART_MAP_COMPRESS_SINCE) < 0) + else if (!canUsePartitionMapCompression(node)) compress = false; } } @@ -964,8 +964,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana boolean clientOnlyExchange, boolean sndCounters) { - boolean compress = - targetNode.version().compareToIgnoreTimestamp(GridDhtPartitionsSingleMessage.PART_MAP_COMPRESS_SINCE) >= 0; + boolean compress = canUsePartitionMapCompression(targetNode); GridDhtPartitionsSingleMessage m = new GridDhtPartitionsSingleMessage(exchangeId, clientOnlyExchange, @@ -1555,6 +1554,24 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana } /** + * @param node Target node. + * @return {@code True} if can use compression for partition map messages. + */ + @SuppressWarnings("SimplifiableIfStatement") + private boolean canUsePartitionMapCompression(ClusterNode node) { + IgniteProductVersion ver = node.version(); + + if (ver.compareToIgnoreTimestamp(GridDhtPartitionsAbstractMessage.PART_MAP_COMPRESS_SINCE) >= 0) { + if (ver.minor() == 7 && ver.maintenance() < 4) + return false; + + return true; + } + + return false; + } + + /** * Exchange future thread. All exchanges happen only by one thread and next * exchange will not start until previous one completes. */
