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

On QueryRouterParserError queries will go to role "any" (primary or replica) instead of default_role or primary #884

Open
gcsabbagh opened this issue Dec 6, 2024 · 1 comment

Comments

@gcsabbagh
Copy link

Describe the bug
We have some queries that are failing parsing, and you would expect that they'd fall back to the primary, or at least the default_role set but instead they are being load balanced across primary and replica.

To Reproduce
Steps to reproduce the behavior:

  1. Create a pool with the following config:
[pools."your_pool"]
pool_mode = "transaction"
load_balancing_mode = "loc"
default_role = "primary"
query_parser_enabled = true
query_parser_read_write_splitting = true
primary_reads_enabled = true
  1. Execute a query that might fail parsing
  2. Observe where query is routed. You will notice it is load balanced across primary or replica

Expected behavior
The query should be routed to primary or default_role

@gcsabbagh
Copy link
Author

gcsabbagh commented Dec 6, 2024

I think we need to either set the active_role to primary or set to the configured default_role here:

Err(error) => {

I think primary would be safer.

@drdrsh thoughts?

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

No branches or pull requests

1 participant