This is an automated email from the ASF dual-hosted git repository.
brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push:
new 78b13cd Reinstate removed ApplicationState padding
78b13cd is described below
commit 78b13cd0e7a33d45c2081bb135e860bbaca7cbe5
Author: Brandon Williams <[email protected]>
AuthorDate: Thu Mar 4 09:24:05 2021 -0600
Reinstate removed ApplicationState padding
Patch by brandonwilliams; reviewed by edimitrova and blerer for
CASSANDRA-16484
---
CHANGES.txt | 1 +
src/java/org/apache/cassandra/gms/ApplicationState.java | 4 ++++
test/unit/org/apache/cassandra/gms/GossiperTest.java | 16 ++++++++++++++++
3 files changed, 21 insertions(+)
diff --git a/CHANGES.txt b/CHANGES.txt
index b7a7e74..6370760 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
4.0-beta5
+ * Reinstate removed ApplicationState padding (CASSANDRA-16484)
* Expose data dirs to ColumnFamilyStoreMBean (CASSANDRA-16335)
* Add possibility to copy SSTables in SSTableImporter instead of moving them
(CASSANDRA-16407)
* Fix DESCRIBE statement for CUSTOM indices with options (CASSANDRA-16482)
diff --git a/src/java/org/apache/cassandra/gms/ApplicationState.java
b/src/java/org/apache/cassandra/gms/ApplicationState.java
index 211387d..d31f50c 100644
--- a/src/java/org/apache/cassandra/gms/ApplicationState.java
+++ b/src/java/org/apache/cassandra/gms/ApplicationState.java
@@ -19,6 +19,7 @@ package org.apache.cassandra.gms;
public enum ApplicationState
{
+ // never remove a state here, ordering matters.
@Deprecated STATUS, //Deprecated and unsued in 4.0, stop publishing in
5.0, reclaim in 6.0
LOAD,
SCHEMA,
@@ -38,6 +39,9 @@ public enum ApplicationState
INTERNAL_ADDRESS_AND_PORT, //Replacement for INTERNAL_IP with up to two
ports
NATIVE_ADDRESS_AND_PORT, //Replacement for RPC_ADDRESS
STATUS_WITH_PORT, //Replacement for STATUS
+ // DO NOT EDIT OR REMOVE PADDING STATES BELOW - only add new states above.
See CASSANDRA-16484
+ X1,
+ X2,
X3,
X4,
X5,
diff --git a/test/unit/org/apache/cassandra/gms/GossiperTest.java
b/test/unit/org/apache/cassandra/gms/GossiperTest.java
index 74f3dbb..c7abb44 100644
--- a/test/unit/org/apache/cassandra/gms/GossiperTest.java
+++ b/test/unit/org/apache/cassandra/gms/GossiperTest.java
@@ -82,6 +82,22 @@ public class GossiperTest
}
@Test
+ public void testPaddingIntact() throws Exception
+ {
+ // sanity check that all 10 pads still exist
+ assert ApplicationState.X1 == ApplicationState.X1;
+ assert ApplicationState.X2 == ApplicationState.X2;
+ assert ApplicationState.X3 == ApplicationState.X3;
+ assert ApplicationState.X4 == ApplicationState.X4;
+ assert ApplicationState.X5 == ApplicationState.X5;
+ assert ApplicationState.X6 == ApplicationState.X6;
+ assert ApplicationState.X7 == ApplicationState.X7;
+ assert ApplicationState.X8 == ApplicationState.X8;
+ assert ApplicationState.X9 == ApplicationState.X9;
+ assert ApplicationState.X10 == ApplicationState.X10;
+ }
+
+ @Test
public void testHasVersion3Nodes() throws Exception
{
Gossiper.instance.expireUpgradeFromVersion();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]