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

document global keyspace flag #1271

Draft
wants to merge 1 commit into
base: prod
Choose a base branch
from
Draft

document global keyspace flag #1271

wants to merge 1 commit into from

Conversation

maxenglander
Copy link
Collaborator

@maxenglander maxenglander commented Dec 5, 2022

Accompanies vitessio/vitess#11876.

Description

Vitess supports globally routing queries to unique tables when the connection does not have a default keyspace and the tables in the FROM list are not keyspace-qualified.

This adds support for explicitly requesting global routing:

  • Adds a VTGate flag --global-keyspace that can be specified multiple times.
  • When a connection uses a --global-keyspace, it behaves the same was as if no default keyspace is set on the connection.
  • When a query for a table is qualified with a --global-keyspace, it is routed to a globally unique table, even if it is in a different keyspace than the current database.

Use cases

This feature is useful for frameworks like Hibernate which are required by to set a database name on the connection. Those frameworks are unable to take advantage of global routing.

Signed-off-by: Max Englander <[email protected]>
Copy link
Collaborator

@rsajwani rsajwani left a comment

Choose a reason for hiding this comment

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

Rest looks good to me.


#### With a default keyspace

With the default keyspace set to `customer` we can only query keyspace-unqualified tables in `commerce` i.e `customer` and `corder`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't it be
"keyspace-unqualified tables in customer"
instead of
"keyspace-unqualified tables in commerce"

Base automatically changed from maxeng-ref-source to prod December 14, 2022 11:34
@maxenglander
Copy link
Collaborator Author

Returning this to draft status until there's more clarity around next steps for vitessio/vitess#11938

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.

2 participants