Repository: cassandra Updated Branches: refs/heads/trunk 4c727f6f9 -> 8c6541715
Undo CASSANDRA-6707 from trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8c654171 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8c654171 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8c654171 Branch: refs/heads/trunk Commit: 8c6541715067a4ae9e3bb583c49d4b7ac0bb2fff Parents: 4c727f6 Author: Aleksey Yeschenko <alek...@apache.org> Authored: Mon Feb 17 17:08:23 2014 +0300 Committer: Aleksey Yeschenko <alek...@apache.org> Committed: Mon Feb 17 17:08:23 2014 +0300 ---------------------------------------------------------------------- .../cql3/statements/SelectStatement.java | 2 +- .../apache/cassandra/net/MessagingService.java | 26 +------------------- 2 files changed, 2 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c654171/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java index 6b61ea5..e08b960 100644 --- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java @@ -166,7 +166,7 @@ public class SelectStatement implements CQLStatement, MeasurableForPreparedCache // A count query will never be paged for the user, but we always page it internally to avoid OOM. // If we user provided a pageSize we'll use that to page internally (because why not), otherwise we use our default // Note that if there are some nodes in the cluster with a version less than 2.0, we can't use paging (CASSANDRA-6707). - if (parameters.isCount && pageSize <= 0 && MessagingService.instance().allNodesAtLeast20) + if (parameters.isCount && pageSize <= 0) pageSize = DEFAULT_COUNT_PAGE_SIZE; if (pageSize <= 0 || command == null || !QueryPagers.mayNeedPaging(command, pageSize)) http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c654171/src/java/org/apache/cassandra/net/MessagingService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java index 22bdbe8..9713576 100644 --- a/src/java/org/apache/cassandra/net/MessagingService.java +++ b/src/java/org/apache/cassandra/net/MessagingService.java @@ -74,8 +74,6 @@ public final class MessagingService implements MessagingServiceMBean public static final int VERSION_21 = 8; public static final int current_version = VERSION_21; - public boolean allNodesAtLeast20 = true; - /** * we preface every message with this number so the recipient can validate the sender is sane */ @@ -745,36 +743,14 @@ public final class MessagingService implements MessagingServiceMBean public int setVersion(InetAddress endpoint, int version) { logger.debug("Setting version {} for {}", version, endpoint); - if (version < VERSION_20) - allNodesAtLeast20 = false; Integer v = versions.put(endpoint, version); - - // if the version was increased to 2.0 or later, see if all nodes are >= 2.0 now - if (v != null && v < VERSION_20 && version >= VERSION_20) - refreshAllNodesAtLeast20(); - return v == null ? version : v; } public void resetVersion(InetAddress endpoint) { logger.debug("Reseting version for {}", endpoint); - Integer removed = versions.remove(endpoint); - if (removed != null && removed <= VERSION_20) - refreshAllNodesAtLeast20(); - } - - private void refreshAllNodesAtLeast20() - { - for (Integer version: versions.values()) - { - if (version < VERSION_20) - { - allNodesAtLeast20 = false; - return; - } - } - allNodesAtLeast20 = true; + versions.remove(endpoint); } public int getVersion(InetAddress endpoint)