jacek-lewandowski commented on a change in pull request #892:
URL: https://github.com/apache/cassandra/pull/892#discussion_r577531522
##########
File path: src/java/org/apache/cassandra/gms/Gossiper.java
##########
@@ -2130,7 +2136,12 @@ public boolean waitForSchemaAgreement(long maxWait,
TimeUnit unit, BooleanSuppli
public boolean haveMajorVersion3Nodes()
{
- return haveMajorVersion3NodesMemoized.get();
+ return isUpgradingFromVersionLowerThan(4, 0);
+ }
+
+ public boolean isUpgradingFromVersionLowerThan(int major, int minor) {
+ CassandraVersion v = upgradeFromVersionMemoized.get();
+ return v != null && v.isLowerThan(major, minor);
Review comment:
Given we use `isLowerThan(major, minor)`, the supplier will not detect
any upgrade because `isLowerThan(4, 0)` returns false in all cases. So we only
need the Gossiper to figure out versions of other nodes.
We start from `NULL_VERSION`, so we reduce the significantly digest
mismatches during the phase when the Gossiper does not know the versions around
the cluster. Another advantage of this approach is the monotonicity of the
attribute we use to keep the current minimum version - once it is set to null
(the cluster is consistent and stable) we avoid further checks.
Disadvantage is that when we do not do the minor version upgrade (we do
patch version upgrade or we just restart the cluster), we will run in legacy
mode until the Gossiper detects versions of all the nodes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]