Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lift MessagingService.minimum_version to 40 (CASSANDRA-18314) #2506

Closed
wants to merge 3 commits into from

Conversation

michaelsembwever
Copy link
Member

No description provided.

@michaelsembwever
Copy link
Member Author

all comments addressed.
rebased off trunk.
CI runs: https://app.circleci.com/pipelines/github/michaelsembwever/cassandra/201

@adelapena
Copy link
Contributor

adelapena commented Jul 25, 2023

I think another thing that can be slightly simplified now that we don't expect 3.0 nodes is QueryProcessor#useNewPreparedStatementBehaviour(), where we don't need QueryProcessor.NEW_PREPARED_STATEMENT_BEHAVIOUR_SINCE_30 nor QueryProcessor.NEW_PREPARED_STATEMENT_BEHAVIOUR_SINCE_3X.

The JavaDoc for QueryProcessor#prepare should also be updated, since it contains some references to upgrades from 3.0.26 and 3.11.

@michaelsembwever
Copy link
Member Author

I think another thing that can be slightly simplified now that we don't expect 3.0 nodes is QueryProcessor

can we do that in a separate ticket, not related to MessagingService (see parent ticket)

@adelapena
Copy link
Contributor

adelapena commented Jul 25, 2023

I think another thing that can be slightly simplified now that we don't expect 3.0 nodes is QueryProcessor

can we do that in a separate ticket, not related to MessagingService (see parent ticket)

Yeah, it can be a separate ticket since the min cluster version doesn't come from MessagingService.

Edit: Created CASSANDRA-18695 for not considering 3.x nodes in QueryProcessor#useNewPreparedStatementBehaviour

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 25, 2023

These methods are not used and I think can be removed:

  • FwdFrmSerializer#pre40DeserializeWithLength
  • Verb#toPre40Verb

Do we need to generate benchmarks for a 'pre40'?
MessageOutBench#serializePre40

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 25, 2023

            // if the other node is pre-4.0, it will respond only with its maxMessagingVersion
            if (maxMessagingVersion < VERSION_40 || handshakeMessagingVersion < VERSION_40)
                return new Accept(useMessagingVersion, maxMessagingVersion);        

Should we return null for this case? This is the HandshakeProtocol class.

@michaelsembwever
Copy link
Member Author

This is the HandshakeProtocol class.

changing that breaks HandshakeTest 🤷

@adelapena
Copy link
Contributor

 // if the other node is pre-4.0, it will respond only with its maxMessagingVersion
if (maxMessagingVersion < VERSION_40 || handshakeMessagingVersion < VERSION_40)
   return new Accept(useMessagingVersion, maxMessagingVersion);        

Should we return null for this case? This is the HandshakeProtocol class.

changing that breaks HandshakeTest 🤷

Returning null there doesn't break HandshakeTest for me, at least locally. What failure are you finding?

@michaelsembwever
Copy link
Member Author

Configuration: EncryptionOptions.ServerEncryptionOptions#legacy_ssl_storage_port_enabled

this is related to something else than the messaging service. a separate ticket under the epic CASSANDRA-18306 is warranted.

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 26, 2023

The ForwardingInfo class:

@michaelsembwever
Copy link
Member Author

all comments addressed.

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 26, 2023

Sorry, the last one :-)

The RequestFailureReason class - the condition version < VERSION_40 can be simplified as well.

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 26, 2023

DropCompactStorage#validateCanDropCompactStorage

I think this can be removed as it is always false.

                if (MessagingService.instance().versions.knows(node) &&
                    MessagingService.instance().versions.getRaw(node) < MessagingService.VERSION_40)
                {
                    before4.add(node);
                    continue;
                }

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 26, 2023

ReadResponseTest#roundTripSerialization

Can remove the following:

            if (version < MessagingService.VERSION_40)
            {
                assertFalse(deser.mayIncludeRepairedDigest());
                // even though that means they should never be used, verify that the default values are present
                assertEquals(ByteBufferUtil.EMPTY_BYTE_BUFFER, deser.repairedDataDigest());
                assertTrue(deser.isRepairedDigestConclusive());
            }

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 26, 2023

For the Verifier class we can simplify the methods:

  • willProcessOnEventLoop
  • expiresAtNanos

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 26, 2023

The MessageGenerator class the methods can be simplified as well:

  • writeLength
  • readHeader

@michaelsembwever
Copy link
Member Author

DropCompactStorage#validateCanDropCompactStorage

this is its own kettle of fish, separate ticket please.

@michaelsembwever
Copy link
Member Author

comments addressed.

@Mmuzaf
Copy link
Contributor

Mmuzaf commented Jul 26, 2023

@michaelsembwever Thank you, re-checked the comments and sources - OK
The build with all checks passes locally.

Comment on lines 40 to 43
testAddress(ipv4, MessagingService.VERSION_40);
testAddress(ipv6, MessagingService.VERSION_40);
testAddress(ipv4, MessagingService.minimum_version);
testAddress(ipv6, MessagingService.minimum_version);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will test VERSION_40 three times, since it's the value of MessagingService.minimum_version and MessagingService.current_version. However, VERSION_50 won't be tested. I think we could modify the test to simply use VERSION_40 and VERSION_50, and maybe make sure that minimum_version and current_version are among them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can see value in testing both explicit values and the minimum and current defined.

cost is irrelevant here.

so… i'd rather add VERSION_50 and not remove any. wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually… i should loop through supportedVersions()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, supportedVersions() is perfect for this.

@@ -41,12 +41,6 @@ public void testCurrent() throws Exception
testVersion(MessagingService.current_version);
}

@Test
public void test30() throws Exception
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now ForwardingInfoTest#testVersion(int) is always called with the same value. I think it can be either inlined into ForwardingInfoTest#testCurrent() or annotated with @SuppressWarnings("SameParameterValue").

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to loop through supportedVersions()

// ReadResponses from pre-4.0 nodes will never contain repaired data digest
// or pending session info, but we run all messages through both pre/post 4.0
// serde to check that the defaults are correctly applied
// check that roundtripping through ReadResponse.serializer behaves as expected
roundTripSerialization(response, MessagingService.current_version);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roundTripSerialization now always takes the same version argument. I'd either inline it or annotate the method with @SuppressWarnings("SameParameterValue").

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to loop through supportedVersions()

@michaelsembwever
Copy link
Member Author

@adelapena comments addressed

Copy link
Contributor

@adelapena adelapena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last changes look good to me, +1. Do we have a CI run for them?

@michaelsembwever
Copy link
Member Author

michaelsembwever commented Jul 27, 2023

CI

SSL broken tests are from jdk17.
upgrade timestamp tests are from the deletion serialisation merge.
SSTablesSystemViewTest is from the SAI merge.

@michaelsembwever
Copy link
Member Author

latest CI

all failures are not related.

@adelapena
Copy link
Contributor

CI results look good to me. There are failures for SSTablesSystemViewTest#testVirtualTableThroughIndexLifeCycle with tries that aren't reported, but they can be reproduced on trunk:

I have created CASSANDRA-18703 for that test failure.

As for the j17 workflow, I've started a few tests here: https://app.circleci.com/pipelines/github/adelapena/cassandra/3069/workflows/613644ed-b9d6-4d81-9ef3-ee9d13625fd5

jacek-lewandowski and others added 3 commits July 28, 2023 16:03
Patch by Jacek Lewandowski; reviewed by Stefan Miklosovic for CASSANDRA-18698
 patch by Mick Semb Wever; reviewed by Andrés de la Peña García, Maxim Muzafarov for CASSANDRA-18314
@michaelsembwever
Copy link
Member Author

Committed 4bbfd64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants