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

Prefer routing to primary in a transaction. #65

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

nihohit
Copy link

@nihohit nihohit commented Nov 12, 2023

This change will cause transactions with commands that are routed to replicas and primaries to prefer the primary routing over the replica.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

There are 2 `route_pipeline` functions in the file, so we change one to
avoid confusion.
(None, _) => next_cmd_route,
(Some(route), None) => Some(route),
(Some(chosen_route), Some(next_cmd_route)) => {
if chosen_route.slot() == next_cmd_route.slot()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're iterating through all commands to check their routing, I think we should raise cross slot exception when we can catch it in the client side

@shachlanAmazon shachlanAmazon merged commit 5c7e586 into amazon-contributing:main Nov 14, 2023
9 of 10 checks passed
@nihohit nihohit deleted the pipeline-routing branch November 15, 2023 08:19
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