-
Notifications
You must be signed in to change notification settings - Fork 12
Implement cass_retry_policy_logging_new
and enable some exec profile integration tests
#287
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
Conversation
84abc8b
to
07263b3
Compare
In the next commits, I'll want to import RetryPolicy from rust-driver. 1. We don't want to have a name clashes 2. We already have a convention of prefixing public types with Cass. Bonus: I also removed the global variant imports.
07263b3
to
4fed103
Compare
Rebased on master. |
The prefix is redundant and makes it harder to read the code.
It's used in some tests, that's why we need to implement it. The semantics of this retry policies is a bit different in C++ driver and in Rust driver. Therefore, the logs are not exactly the same. So in order to enable the tests using this retry policy, we will need to adjust the tests to expect the new format of the logs.
It was commented out, because `cass_retry_policy_logging_new` was not implemented.
IgnoringRetryPolicy is a retry policy that always ignores all errors. It's implemented as another variant of CassRetryPolicy, and it is going to be used in integration tests. There is one test in particular, `ExecutionProfileTest.Integration_Cassandra_RetryPolicy`, which requires this retry policy to be able to run. In order to enable that test and not change the retry policy it uses, we need to implement it. The next commits will implement the bridge between Rust and C++ integration testing module, so that the test can use this retry policy.
IgnoreRetryPolicy is now exposed to C++ integration tests. It can be used in tests just as the tests expect it to be used.
In 78245ba 3 years ago, the test was made use DefaultRetryPolicy, instead of IgnoreRetryPolicy, in order the code to compile. Now that IgnoreRetryPolicy is supported, we make the test use it again. This allows us to enable the test.
4fed103
to
f5bb355
Compare
Addressed comments. The test now uses |
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.
Thanks for implementing the ignore policy!
scylla-rust-wrapper/src/batch.rs
Outdated
ArcFFI::as_ref(retry_policy).map(|policy| match policy { | ||
CassRetryPolicy::DefaultRetryPolicy(default) => { | ||
CassRetryPolicy::Default(default) => { | ||
default.clone() as Arc<dyn scylla::policies::retry::RetryPolicy> | ||
} | ||
CassRetryPolicy::FallthroughRetryPolicy(fallthrough) => fallthrough.clone(), | ||
CassRetryPolicy::DowngradingConsistencyRetryPolicy(downgrading) => downgrading.clone(), | ||
CassRetryPolicy::Fallthrough(fallthrough) => fallthrough.clone(), | ||
CassRetryPolicy::DowngradingConsistency(downgrading) => downgrading.clone(), | ||
}); |
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.
Commit: "CassRetryPolicy: cut RetryPolicy- off enum variants "
We have the same problem as in Rust Driver: clippy by default does not trigger some lints for public items. Please apply the same solution as in the Rust Driver (it was some config option).
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 did notice it and I'm going to fix it in a follow-up PR.
The logging retry policy is used in tests in order to observe and verify retry decisions.
Therefore, implementing it allows us enable more integration tests.
As the semantics of retry policy differ between C++ driver and Rust driver, the logs are a bit different, so the tests need to be adjusted.
Fixes: #260
Ref: #132
Pre-review checklist
Makefile
ingtest_filter
.