diff --git a/CHANGES.txt b/CHANGES.txt index 1c8be70f37..e83b385258 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -3.0 +2.2 * Allow roles cache to be invalidated (CASSANDRA-8967) * Upgrade Snappy (CASSANDRA-9063) * Don't start Thrift rpc by default (CASSANDRA-9319) diff --git a/NEWS.txt b/NEWS.txt index 1358c35d35..c16b55a518 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -13,7 +13,7 @@ restore snapshots created with the previous major version using the 'sstableloader' tool. You can upgrade the file format of your snapshots using the provided 'sstableupgrade' tool. -3.0 +2.2 === New features diff --git a/build.xml b/build.xml index bdcb33c4ee..f613478b28 100644 --- a/build.xml +++ b/build.xml @@ -25,7 +25,7 @@ - + diff --git a/interface/cassandra.thrift b/interface/cassandra.thrift index 0af7e645cd..f5041c897f 100644 --- a/interface/cassandra.thrift +++ b/interface/cassandra.thrift @@ -884,7 +884,7 @@ service Cassandra { /** - * @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead. + * @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead. */ CqlResult execute_cql_query(1:required binary query, 2:required Compression compression) throws (1:InvalidRequestException ire, @@ -904,7 +904,7 @@ service Cassandra { /** - * @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead. + * @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead. */ CqlPreparedResult prepare_cql_query(1:required binary query, 2:required Compression compression) throws (1:InvalidRequestException ire) @@ -920,7 +920,7 @@ service Cassandra { /** - * @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead. + * @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead. */ CqlResult execute_prepared_cql_query(1:required i32 itemId, 2:required list values) throws (1:InvalidRequestException ire, diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java index bf15559a79..cd4314bee0 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java @@ -386,7 +386,7 @@ public class Cassandra { public String system_update_column_family(CfDef cf_def) throws InvalidRequestException, SchemaDisagreementException, org.apache.thrift.TException; /** - * @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead. + * @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead. * * @param query * @param compression @@ -404,7 +404,7 @@ public class Cassandra { public CqlResult execute_cql3_query(ByteBuffer query, Compression compression, ConsistencyLevel consistency) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, org.apache.thrift.TException; /** - * @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead. + * @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead. * * @param query * @param compression @@ -423,7 +423,7 @@ public class Cassandra { public CqlPreparedResult prepare_cql3_query(ByteBuffer query, Compression compression) throws InvalidRequestException, org.apache.thrift.TException; /** - * @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead. + * @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead. * * @param itemId * @param values diff --git a/src/java/org/apache/cassandra/auth/IAuthorizer.java b/src/java/org/apache/cassandra/auth/IAuthorizer.java index 21b64dc75b..01c05af3ae 100644 --- a/src/java/org/apache/cassandra/auth/IAuthorizer.java +++ b/src/java/org/apache/cassandra/auth/IAuthorizer.java @@ -30,7 +30,7 @@ public interface IAuthorizer { /** * Returns a set of permissions of a user on a resource. - * Since Roles were introduced in version 3.0, Cassandra does not distinguish in any + * Since Roles were introduced in version 2.2, Cassandra does not distinguish in any * meaningful way between users and roles. A role may or may not have login privileges * and roles may be granted to other roles. In fact, Cassandra does not really have the * concept of a user, except to link a client session to role. AuthenticatedUser can be diff --git a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java index 6803e2165c..87bc073220 100644 --- a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java +++ b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java @@ -45,7 +45,7 @@ import static org.apache.cassandra.auth.CassandraRoleManager.consistencyForRole; * PasswordAuthenticator is an IAuthenticator implementation * that keeps credentials (rolenames and bcrypt-hashed passwords) * internally in C* - in system_auth.roles CQL3 table. - * Since 3.0, the management of roles (creation, modification, + * Since 2.2, the management of roles (creation, modification, * querying etc is the responsibility of IRoleManager. Use of * PasswordAuthenticator requires the use of CassandraRoleManager * for storage and retrieval of encrypted passwords. diff --git a/src/java/org/apache/cassandra/db/SystemKeyspace.java b/src/java/org/apache/cassandra/db/SystemKeyspace.java index 6b4bb73ed8..6e754a454c 100644 --- a/src/java/org/apache/cassandra/db/SystemKeyspace.java +++ b/src/java/org/apache/cassandra/db/SystemKeyspace.java @@ -1119,7 +1119,7 @@ public final class SystemKeyspace try { DataOutputBuffer out = new DataOutputBuffer(); - Range.tokenSerializer.serialize(range, out, MessagingService.VERSION_30); + Range.tokenSerializer.serialize(range, out, MessagingService.VERSION_22); return out.buffer(); } catch (IOException e) @@ -1135,7 +1135,7 @@ public final class SystemKeyspace { return (Range) Range.tokenSerializer.deserialize(ByteStreams.newDataInput(ByteBufferUtil.getArray(rawRange)), partitioner, - MessagingService.VERSION_30); + MessagingService.VERSION_22); } catch (IOException e) { diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java index c795d66f45..27abae3838 100644 --- a/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java +++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java @@ -212,7 +212,7 @@ public class CommitLogArchiver descriptor = fromHeader; else descriptor = fromName; - if (descriptor.version > CommitLogDescriptor.VERSION_30) + if (descriptor.version > CommitLogDescriptor.VERSION_22) throw new IllegalStateException("Unsupported commit log version: " + descriptor.version); if (descriptor.compression != null) { diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java index c872677cc2..c4728fdafc 100644 --- a/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java +++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java @@ -36,7 +36,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Objects; import com.github.tjake.ICRC32; -import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.ParameterizedClass; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.io.FSReadError; @@ -57,13 +56,13 @@ public class CommitLogDescriptor public static final int VERSION_12 = 2; public static final int VERSION_20 = 3; public static final int VERSION_21 = 4; - public static final int VERSION_30 = 5; + public static final int VERSION_22 = 5; /** * Increment this number if there is a changes in the commit log disc layout or MessagingVersion changes. * Note: make sure to handle {@link #getMessagingVersion()} */ @VisibleForTesting - public static final int current_version = VERSION_30; + public static final int current_version = VERSION_22; final int version; public final long id; @@ -89,7 +88,7 @@ public class CommitLogDescriptor out.putLong(descriptor.id); crc.updateInt((int) (descriptor.id & 0xFFFFFFFFL)); crc.updateInt((int) (descriptor.id >>> 32)); - if (descriptor.version >= VERSION_30) { + if (descriptor.version >= VERSION_22) { String parametersString = constructParametersString(descriptor); byte[] parametersBytes = parametersString.getBytes(StandardCharsets.UTF_8); if (parametersBytes.length != (((short) parametersBytes.length) & 0xFFFF)) @@ -142,7 +141,7 @@ public class CommitLogDescriptor checkcrc.updateInt((int) (id & 0xFFFFFFFFL)); checkcrc.updateInt((int) (id >>> 32)); int parametersLength = 0; - if (version >= VERSION_30) { + if (version >= VERSION_22) { parametersLength = input.readShort() & 0xFFFF; checkcrc.updateInt(parametersLength); } @@ -194,8 +193,8 @@ public class CommitLogDescriptor return MessagingService.VERSION_20; case VERSION_21: return MessagingService.VERSION_21; - case VERSION_30: - return MessagingService.VERSION_30; + case VERSION_22: + return MessagingService.VERSION_22; default: throw new IllegalStateException("Unknown commitlog version " + version); } diff --git a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java index e1a5622422..a1e32cf977 100644 --- a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java +++ b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java @@ -134,7 +134,7 @@ public class BigFormat implements SSTableFormat // index summaries can be downsampled and the sampling level is persisted // switch uncompressed checksums to adler32 // tracks presense of legacy (local and remote) counter shards - // la (3.0.0): new file name format + // la (2.2.0): new file name format private final boolean isLatestVersion; private final boolean hasSamplingLevel; diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java index a7346f3f69..c54d5eeee1 100644 --- a/src/java/org/apache/cassandra/net/MessagingService.java +++ b/src/java/org/apache/cassandra/net/MessagingService.java @@ -80,8 +80,8 @@ public final class MessagingService implements MessagingServiceMBean public static final int VERSION_12 = 6; public static final int VERSION_20 = 7; public static final int VERSION_21 = 8; - public static final int VERSION_30 = 9; - public static final int current_version = VERSION_30; + public static final int VERSION_22 = 9; + public static final int current_version = VERSION_22; public static final String FAILURE_CALLBACK_PARAM = "CAL_BAC"; public static final byte[] ONE_BYTE = new byte[1]; diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index be7361b8ed..c0ea87210c 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -1758,7 +1758,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE private boolean isRpcReady(InetAddress endpoint) { - return MessagingService.instance().getVersion(endpoint) < MessagingService.VERSION_30 || + return MessagingService.instance().getVersion(endpoint) < MessagingService.VERSION_22 || Gossiper.instance.getEndpointStateForEndpoint(endpoint).isRpcReady(); } diff --git a/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java b/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java index 5266e45e6c..e9c99fed8e 100644 --- a/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java +++ b/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java @@ -137,10 +137,10 @@ public class FileMessageHeader out.writeUTF(header.version); //We can't stream to a node that doesn't understand a new sstable format - if (version < StreamMessage.VERSION_30 && header.format != SSTableFormat.Type.LEGACY && header.format != SSTableFormat.Type.BIG) - throw new UnsupportedOperationException("Can't stream non-legacy sstables to nodes < 3.0"); + if (version < StreamMessage.VERSION_22 && header.format != SSTableFormat.Type.LEGACY && header.format != SSTableFormat.Type.BIG) + throw new UnsupportedOperationException("Can't stream non-legacy sstables to nodes < 2.2"); - if (version >= StreamMessage.VERSION_30) + if (version >= StreamMessage.VERSION_22) out.writeUTF(header.format.name); out.writeLong(header.estimatedKeys); @@ -162,7 +162,7 @@ public class FileMessageHeader String sstableVersion = in.readUTF(); SSTableFormat.Type format = SSTableFormat.Type.LEGACY; - if (version >= StreamMessage.VERSION_30) + if (version >= StreamMessage.VERSION_22) format = SSTableFormat.Type.validate(in.readUTF()); long estimatedKeys = in.readLong(); @@ -182,7 +182,7 @@ public class FileMessageHeader size += TypeSizes.NATIVE.sizeof(header.sequenceNumber); size += TypeSizes.NATIVE.sizeof(header.version); - if (version >= StreamMessage.VERSION_30) + if (version >= StreamMessage.VERSION_22) size += TypeSizes.NATIVE.sizeof(header.format.name); size += TypeSizes.NATIVE.sizeof(header.estimatedKeys); @@ -198,4 +198,4 @@ public class FileMessageHeader return size; } } -} \ No newline at end of file +} diff --git a/src/java/org/apache/cassandra/streaming/messages/StreamMessage.java b/src/java/org/apache/cassandra/streaming/messages/StreamMessage.java index 8e3eeef6d0..d4e8a81ac9 100644 --- a/src/java/org/apache/cassandra/streaming/messages/StreamMessage.java +++ b/src/java/org/apache/cassandra/streaming/messages/StreamMessage.java @@ -33,8 +33,8 @@ public abstract class StreamMessage { /** Streaming protocol version */ public static final int VERSION_20 = 2; - public static final int VERSION_30 = 3; - public static final int CURRENT_VERSION = VERSION_30; + public static final int VERSION_22 = 3; + public static final int CURRENT_VERSION = VERSION_22; public static void serialize(StreamMessage message, DataOutputStreamPlus out, int version, StreamSession session) throws IOException { diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java index b558a13e68..04d3d13033 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraServer.java +++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java @@ -1869,7 +1869,7 @@ public class CassandraServer implements Cassandra.Iface public CqlResult execute_cql_query(ByteBuffer query, Compression compression) throws TException { - throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); + throw new InvalidRequestException("CQL2 has been removed in Cassandra 2.2. Please use CQL3 instead"); } public CqlResult execute_cql3_query(ByteBuffer query, Compression compression, ConsistencyLevel cLevel) throws TException @@ -1909,7 +1909,7 @@ public class CassandraServer implements Cassandra.Iface public CqlPreparedResult prepare_cql_query(ByteBuffer query, Compression compression) throws TException { - throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); + throw new InvalidRequestException("CQL2 has been removed in Cassandra 2.2. Please use CQL3 instead"); } public CqlPreparedResult prepare_cql3_query(ByteBuffer query, Compression compression) throws TException @@ -1934,7 +1934,7 @@ public class CassandraServer implements Cassandra.Iface public CqlResult execute_prepared_cql_query(int itemId, List bindVariables) throws TException { - throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); + throw new InvalidRequestException("CQL2 has been removed in Cassandra 2.2. Please use CQL3 instead"); } public CqlResult execute_prepared_cql3_query(int itemId, List bindVariables, ConsistencyLevel cLevel) throws TException @@ -2053,7 +2053,7 @@ public class CassandraServer implements Cassandra.Iface } /* - * No-op since 3.0. + * No-op since 2.2. */ public void set_cql_version(String version) { diff --git a/test/unit/org/apache/cassandra/db/CommitLogTest.java b/test/unit/org/apache/cassandra/db/CommitLogTest.java index 4db6057cc5..1ab678f939 100644 --- a/test/unit/org/apache/cassandra/db/CommitLogTest.java +++ b/test/unit/org/apache/cassandra/db/CommitLogTest.java @@ -386,9 +386,9 @@ public class CommitLogTest { testDescriptorPersistence(new CommitLogDescriptor(11, null)); testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_21, 13, null)); - testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30, 15, null)); - testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30, 17, new ParameterizedClass("LZ4Compressor", null))); - testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30, 19, + testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_22, 15, null)); + testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_22, 17, new ParameterizedClass("LZ4Compressor", null))); + testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_22, 19, new ParameterizedClass("StubbyCompressor", ImmutableMap.of("parameter1", "value1", "flag2", "55", "argument3", "null")))); } @@ -399,7 +399,7 @@ public class CommitLogTest for (int i=0; i<65535; ++i) params.put("key"+i, Integer.toString(i, 16)); try { - CommitLogDescriptor desc = new CommitLogDescriptor(CommitLogDescriptor.VERSION_30, + CommitLogDescriptor desc = new CommitLogDescriptor(CommitLogDescriptor.VERSION_22, 21, new ParameterizedClass("LZ4Compressor", params)); ByteBuffer buf = ByteBuffer.allocate(1024000);