transport: drop cql protocol versions 1 and 2

Version 3 was introduced in 2014 (Cassandra 2.1) and was supported
in the very first version of Scylla (2a7da21481 "CQL binary protocol").

Cassandra 3.0 (2015) dropped protocols 1 and 2 as well.
It's safe enough to drop it now, 9 years after introduction of v3
and 7 years after Cassandra stopped supporting it.

Dropping it allows dropping cql_serialization_format, which causes
quite a lot of pain, and is probably broken. This will be dropped in the
following patch.
This commit is contained in:
Avi Kivity
2023-01-02 16:59:13 +02:00
parent b4e4bbd64a
commit 424dbf43f3
2 changed files with 2 additions and 30 deletions

View File

@@ -266,11 +266,7 @@ cql_server::unadvertise_connection(shared_ptr<generic_server::connection> raw_co
unsigned
cql_server::connection::frame_size() const {
if (_version < 3) {
return 8;
} else {
return 9;
}
return 9;
}
cql_binary_frame_v3
@@ -280,17 +276,6 @@ cql_server::connection::parse_frame(temporary_buffer<char> buf) const {
}
cql_binary_frame_v3 v3;
switch (_version) {
case 1:
case 2: {
cql_binary_frame_v1 raw = read_unaligned<cql_binary_frame_v1>(buf.get());
auto cooked = net::ntoh(raw);
v3.version = cooked.version;
v3.flags = cooked.flags;
v3.opcode = cooked.opcode;
v3.stream = cooked.stream;
v3.length = cooked.length;
break;
}
case 3:
case 4: {
cql_binary_frame_v3 raw = read_unaligned<cql_binary_frame_v3>(buf.get());
@@ -319,7 +304,7 @@ cql_server::connection::read_frame() {
}
_version = buf[0];
init_cql_serialization_format();
if (_version < 1 || _version > current_version) {
if (_version < 3 || _version > current_version) {
auto client_version = _version;
_version = current_version;
throw exceptions::protocol_exception(format("Invalid or unsupported protocol version: {:d}", client_version));

View File

@@ -77,19 +77,6 @@ enum cql_frame_flags {
warning = 0x08,
};
struct [[gnu::packed]] cql_binary_frame_v1 {
uint8_t version;
uint8_t flags;
uint8_t stream;
uint8_t opcode;
net::packed<uint32_t> length;
template <typename Adjuster>
void adjust_endianness(Adjuster a) {
return a(length);
}
};
struct [[gnu::packed]] cql_binary_frame_v3 {
uint8_t version;
uint8_t flags;