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

conn: copy a batch type in prepare_batch #1038

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

muzarski
Copy link
Contributor

Fix: #1035

Previously, there was a bug in prepare_batch function. We wouldn't inherit a BatchType from the initial_batch - in result, we would always send LOGGED batches (since LOGGED is a default batch type).

This would result in server errors when including a counter statements in a LOGGED batch. I added a test case which checks that it works correctly now, and the driver sends a COUNTER batch when user asks to.

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.

@muzarski muzarski self-assigned this Jul 10, 2024
@muzarski muzarski requested review from Lorak-mmk and wprzytula July 10, 2024 15:45
Copy link

github-actions bot commented Jul 10, 2024

cargo semver-checks found no API-breaking changes in this PR! 🎉🥳
Checked commit: 5a0d6e7

@wprzytula wprzytula added the bug Something isn't working label Jul 10, 2024
Previously, there was a bug in prepare_batch function.
We wouldn't inherit a BatchType from the `initial_batch` - in result,
we would always send LOGGED batches (since LOGGED is a default batch type).

This would result in server errors when including a counter statements
in a LOGGED batch. I added a test case which checks that it works
correctly now, and the driver sends a COUNTER batch when user asks to.
@muzarski muzarski force-pushed the counter_batch_fix branch from f4962c6 to 5a0d6e7 Compare July 10, 2024 16:26
@muzarski muzarski requested a review from Lorak-mmk July 10, 2024 16:26
@muzarski
Copy link
Contributor Author

v2: Added a Batch::new_from constructor which inherits a type and config values from existing batch.

@wprzytula wprzytula merged commit ea0a4d0 into scylladb:main Jul 10, 2024
11 checks passed
wprzytula added a commit to wprzytula/scylla-rust-driver that referenced this pull request Jul 11, 2024
conn: copy a batch type in prepare_batch
(cherry picked from commit ea0a4d0)
@wprzytula wprzytula mentioned this pull request Jul 11, 2024
wprzytula added a commit to wprzytula/scylla-rust-driver that referenced this pull request Jul 11, 2024
conn: copy a batch type in prepare_batch
(cherry picked from commit ea0a4d0)
wprzytula added a commit to wprzytula/scylla-rust-driver that referenced this pull request Jul 11, 2024
conn: copy a batch type in prepare_batch
(cherry picked from commit ea0a4d0)
wprzytula added a commit to wprzytula/scylla-rust-driver that referenced this pull request Jul 11, 2024
conn: copy a batch type in prepare_batch
(cherry picked from commit ea0a4d0)
@muzarski muzarski deleted the counter_batch_fix branch October 29, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

batch: counter batches are not working properly
3 participants