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

CassandraSinkCluster keyspace based routing - handle use statements #806

Merged
merged 4 commits into from
Sep 22, 2022

Conversation

rukai
Copy link
Member

@rukai rukai commented Sep 14, 2022

This PR handles use statements in every case except one:

  • operates on both batch operations and query operations.
  • messages are modified such that if a keyspace is not specified the use keyspace is used, this ensures a single source of truth for transforms.
  • messages are modified at the codec level ensuring all layers of shotover observe the same keyspace.

The one case we arent handling is prepared statements.
use statements also affect prepared statements, but currently shotover does not support parsing prepared statements so I have just left that functionality as a TODO.

There is a performance concern: calling metadata is currently more expensive than it needs to be due to internally copying the entire message body and then dropping it.
But that can be addressed later on in a follow up PR.

Making this change caused the .as_raw_bytes() hack to start blowing up due to the message already being parsed, so I also changed all instances of it to just use .metadata() instead.

@rukai rukai force-pushed the handle_use_statements_when_routing branch from 0b297cd to 0dd3abe Compare September 15, 2022 05:19
@rukai rukai marked this pull request as ready for review September 15, 2022 06:25
@rukai rukai force-pushed the handle_use_statements_when_routing branch from 37cee7b to 5180bd5 Compare September 19, 2022 00:38
@conorbros conorbros enabled auto-merge (squash) September 22, 2022 06:55
@conorbros conorbros merged commit 2985349 into shotover:main Sep 22, 2022
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.

3 participants