yifan-c commented on a change in pull request #892:
URL: https://github.com/apache/cassandra/pull/892#discussion_r577060773
##########
File path: src/java/org/apache/cassandra/gms/Gossiper.java
##########
@@ -158,38 +158,44 @@
private volatile long lastProcessedMessageAt = System.currentTimeMillis();
- //This property and anything that checks it should be removed in 5.0
- private boolean haveMajorVersion3Nodes = true;
+ // This property and anything that checks it should be removed in 5.0
+ /**
+ * This property is initially set to null version which means that we have
no information about the other nodes.
+ * Once we have information about the cluster, it is set to the earliest
version encountered in the cluster.
+ * Once all nodes are on at least this node version, it becomes null,
which means that we are not upgrading from
+ * the previous version (major, minor).
+ */
+ private CassandraVersion upgradeFromVersion = SystemKeyspace.NULL_VERSION;
- final Supplier<ExpiringMemoizingSupplier.ReturnValue<Boolean>>
haveMajorVersion3NodesSupplier = () ->
+ final Supplier<ExpiringMemoizingSupplier.ReturnValue<CassandraVersion>>
upgradeFromVersionSupplier = () ->
Review comment:
The cluster wide version check is a special treatment for specific
versions, i.e. 3.4 and `v < 4`. What if we keep the checker as-is and always
using the `3.4-` behavior during upgrade?
It could be more expensive (by how much? probably not a lot) during that
time period, but the gain is the simplification.
In practice, I think there won't be a case that the upgrading cluster have
nodes in `3.4-`, `3.11` and `4.0`. The upgrading path is most likely either 3.0
-> 4.0, or 3.x -> 4.0. With such assumption, if we want to lower the data size
being queried, we can define a temporarily system property in the 4.0 version
to select the behavior. e.g. `cassandra.upgrading_from_3_0_plus`, according to
the value use the corresponding behavior. The property, the same as
`Gossiper#upgradeFromVersion`, should be removed in 5.0. If we are adding the
property, we need to document it in the `NEWS.txt` too in order to inform the
instructor when upgrading.
(Maybe just using the `3.4-` behavior is the best option, as it add
complexity in operations)
----------------------------------------------------------------
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]