-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
for byte in paging_state_bytes { | ||
b.put_i8(*byte); | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piodul WDYT?
There was a problem hiding this comment.
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.
7ed8d61
to
3497df1
Compare
@@ -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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
3497df1
to
8c71923
Compare
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 |
This will also require some changes in |
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.
8c71923
to
d89cdf4
Compare
for byte in paging_state_bytes { | ||
b.put_i8(*byte); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piodul WDYT?
Pre-review checklist
.github/workflows/build.yml
ingtest_filter
..github/workflows/cassandra.yml
ingtest_filter
.