SSL enablement for Cassandra Connector#23507
Conversation
| session.execute("CREATE TABLE keyspace_4.\"TaBlE_4\" (column_4 bigint PRIMARY KEY)"); | ||
| session.execute("CREATE TABLE keyspace_4.\"tAbLe_4\" (column_4 bigint PRIMARY KEY)"); | ||
|
|
||
| Thread.sleep(5000); |
There was a problem hiding this comment.
Why do we need the sleep?
There was a problem hiding this comment.
The sleep is needed for cassandra to refresh its metadata . i have reduced it to 1000ms in the recent commit
There was a problem hiding this comment.
What metadata is being refreshed asynchronously? Can you help me explain why the changes in this PR require this new sleep?
There was a problem hiding this comment.
Without this delay, the test might run into race conditions where it tries to access or query the newly created schema elements before they are fully registered in the system, leading to test failures.The driver now performs more rigorous checks to ensure schema agreement across nodes before refreshing the metadata. This could introduce a delay, especially if schema changes are not immediately visible across the cluster, potentially causing issues like the one we are facing where the test fails if you don't include a Thread.sleep. The driver waits for all nodes to agree on the schema before completing the operation, which wasn't as strictly enforced in earlier versions.
There was a problem hiding this comment.
Doesn't the assertContainsEventually call immediately after this sleep handle this race condition?
There was a problem hiding this comment.
No , without the Thread.sleep its failing and after adding the sleep it passes . The sleep was added for the testcase to pass and I checked by printing the values and after adding sleep I was able to retrieve values before which it was empty.
There was a problem hiding this comment.
OK. Please add a comment explaining why we need the sleep.
There was a problem hiding this comment.
@tdcmeehan I have added the comment . Thanks
|
|
||
| @Test | ||
| public void testTableNameAmbiguity() | ||
| throws InterruptedException |
There was a problem hiding this comment.
| throws InterruptedException | |
| throws Exception |
| .row("table_4") | ||
| .row("table_4") | ||
| .build(), new Duration(1, MINUTES)); | ||
| .build(), new Duration(2, MINUTES)); |
There was a problem hiding this comment.
Why is this being bumped up?
There was a problem hiding this comment.
okay this is not required , I shall revert back as 1000ms would do the refreshing
| <dependency> | ||
| <groupId>com.facebook.presto.cassandra</groupId> | ||
| <artifactId>cassandra-driver</artifactId> | ||
| <groupId>com.datastax.cassandra</groupId> |
There was a problem hiding this comment.
Can you put this in the dependency management section of the parent pom?
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <dependencyManagement> |
There was a problem hiding this comment.
Can you add a comment explaining why this is needed?
There was a problem hiding this comment.
This is to fix the upper bound issues arising out of different components
There was a problem hiding this comment.
Can you leave a comment in the code to that effect?
There was a problem hiding this comment.
added the comment
|
Nit formatting suggestion for the release note entry |
done |
|
Please squash commits |
done |
Description
Cassandra Version Upgrade for enabling SSL
Motivation and Context
Presto uses presto cassandra driver (shaded version of datastax driver ) for connections . While non ssl operations work fine , the same does not hold good for SSL functionalities.
While we try to connect to an SSL instance , we get the below error
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /52.116.130.195:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [/52.116.130.195:9042] Operation timed out))
Presto uses 3.6.0 version of DataStax driver which does not support SSL. Version 3.11.2 or higher version of DataStax driver supports SSL.
#23506
Impact
SSL will be enabled and connections can be secured.
Test Plan
Tested Locally end to end
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
== RELEASE NOTES ==
Cassandra Connector Changes
23493