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

examples/execution_profile: fix usage of illegal consistency #840

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

cvybhu
Copy link
Contributor

@cvybhu cvybhu commented Oct 16, 2023

The example in execution_profile.rs tried to send a read request using consistency EACH_QUORUM.
This doesn't work, the query failed with the following message:

Error: Database returned an error: The query is syntactically correct but invalid, Error message: EACH_QUORUM ConsistencyLevel is only supported for writes

Examples shouldn't fail. Let's fix it by changing EachQuorum to LocalQuorum which can be used in SELECTs.
After this change the example doesn't fail.

It still demonstrates how to create an execution profile with a custom consistency level, it doesn't matter what consistency level is used.

Fixes: #835

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

The example in `execution_profile.rs` tried to send a read request
using consistency `EACH_QUORUM`.
This doesn't work, the query failed with the following message:
```
Error: Database returned an error: The query is syntactically correct but invalid, Error message: EACH_QUORUM ConsistencyLevel is only supported for writes
```
Examples shouldn't fail. Let's fix it by changing `EachQuorum`
to `LocalQuorum` which can be used in SELECTs.
After this change the example doesn't fail.

It still demonstrates how to create an execution profile
with a custom consistency level, it doesn't matter what consistency level is used.

Fixes: scylladb#835

Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>
@Lorak-mmk Lorak-mmk merged commit d931716 into scylladb:main Oct 17, 2023
8 checks passed
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.

Error when running examples/execution_profile.rs - EACH_QUORUM ConsistencyLevel is only supported for writes
2 participants