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

Upgrade cassandra version #102

Merged
merged 3 commits into from
Jun 22, 2023
Merged

Conversation

Gor027
Copy link
Contributor

@Gor027 Gor027 commented Jan 25, 2023

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have enabled appropriate tests in .github/workflows/build.yml in gtest_filter.
  • I have enabled appropriate tests in .github/workflows/cassandra.yml in gtest_filter.

@Gor027 Gor027 requested review from piodul, Lorak-mmk and avelanarius and removed request for piodul and Lorak-mmk January 26, 2023 10:29
Comment on lines +242 to +247
for byte in paging_state_bytes {
b.put_i8(*byte);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would b.put(&paging_state_bytes) work here? Documentation for BytesMut suggests that it is possible:

https://docs.rs/bytes/latest/bytes/struct.BytesMut.html#method.with_capacity

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it should work, will fix it. Indeed, it will be better to put it without specifying whether it is i8 or u8, as c_char is considered to be u8 on some processors (e.g. ARM) and it may cause a compilation error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, b.put(&paging_state_bytes) is not implemented for &[u8] or &[i8], so I think either we should add an explicit cast to i8 and ignore the warnings or use the cfg! macro with some configuration flags to put c_char as i8 or u8 depending on the processor type.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@piodul WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's keep the current version for simplicity and hope that the compiler optimizes it.

@Gor027 Gor027 force-pushed the upgrade_cassandra_version branch from 7ed8d61 to 3497df1 Compare February 20, 2023 11:23
@@ -34,6 +34,7 @@ CASSANDRA_INTEGRATION_TEST_F(TracingTests, Simple) {
{ // Validate tracing ID by attempting to get the associated tracing data.
Statement statement("SELECT * FROM system_traces.sessions WHERE session_id = ?", 1);
statement.bind(0, tracing_id);
msleep(10000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like this 10s sleep, and in general we should avoid timing-dependent tests.
If there is no way to solve this in a different way (how does Cassandra 4x solve it? Did they remove this test? Modify it somehow?), we should execute this block in a loop (and this 10s would be a time limit instead of unconditional sleep) until it succeeds or time limit is reached.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the unconditional sleep to a loop with a 10s limit after which it can fail. The mentioned issue in the commit message https://issues.apache.org/jira/browse/CASSANDRA-11465 is a fix for versions up to version 3.8. I think the original cpp-driver is not being tested on newer Cassandra versions 4.0 or 4.1, so perhaps we should wait for a fix to be added for those versions too.

@Gor027 Gor027 force-pushed the upgrade_cassandra_version branch from 3497df1 to 8c71923 Compare February 20, 2023 15:14
@mykaul
Copy link

mykaul commented Jun 4, 2023

By now 4.1.2 is already available. What's the plan to get this in?

@Gor027
Copy link
Contributor Author

Gor027 commented Jun 6, 2023

By now 4.1.2 is already available. What's the plan to get this in?

Upgrading to 4.1.2 will require more changes related to the recent renaming of the parameters in cassandra.yaml:
https://cassandra.apache.org/doc/latest/cassandra/configuration/configuration.html
I think it is better to do that in a separate PR.

@Gor027
Copy link
Contributor Author

Gor027 commented Jun 6, 2023

This will also require some changes in scylla-ccm also, to generate proper configuration before starting a cluster.

Gor027 added 3 commits June 22, 2023 13:56
Paging state bytes are set without being cast to u8.
Previously the setter added a null-terminator which is not its original
and intended behavior.
The setter is moved to statement.rs as it is a statement-related
function.
The `TracingTests.Simple` is a flaky test on some Cassandra versions.
The issue https://issues.apache.org/jira/browse/CASSANDRA-11465
introduces a fix only for versions 3.0.9 or below.
To avoid the inconsistency, this commit adds a sleep before querying
`system_traces.sessions` table.
The version is upgraded to 4.0.7 as the Rust driver CI on Cassandra
also uses the same version.

Added `enable_materialized_views` flag to ccm default configuration to
enable metadata related tests. UDT tests are also enabled.

The following tests are disabled:

* The `PreparedTests.FailFastWhenPreparedIDChangesDuringReprepare` test
  does not pass with newer version of Cassandra as the server does not
  return any error message about prepared statement id being changed.
* CassandraTypes tests for Duration type, as binding duration to
  statement is not yet supported. Iterator based deserialization in the
  Rust driver will allow to add this feature.
@Gor027 Gor027 force-pushed the upgrade_cassandra_version branch from 8c71923 to d89cdf4 Compare June 22, 2023 11:57
@Gor027 Gor027 requested review from Lorak-mmk and wprzytula June 22, 2023 13:27
Comment on lines +242 to +247
for byte in paging_state_bytes {
b.put_i8(*byte);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@piodul WDYT?

.github/workflows/cassandra.yml Show resolved Hide resolved
@Gor027 Gor027 merged commit e515591 into scylladb:master Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants