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

sql: boostrap a user-controlled o11y db for SQL obs #109125

Closed
knz opened this issue Aug 21, 2023 · 3 comments
Closed

sql: boostrap a user-controlled o11y db for SQL obs #109125

knz opened this issue Aug 21, 2023 · 3 comments
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@knz
Copy link
Contributor

knz commented Aug 21, 2023

See internal proposal.

Jira issue: CRDB-30793

Epic CRDB-31701

@knz knz added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Aug 21, 2023
@knz knz self-assigned this Aug 21, 2023
@knz
Copy link
Contributor Author

knz commented Aug 21, 2023

@fqazi i'd like to pick your brain on the topic of "automatically re-routing queries based on migration stage".

As you can see in #109143, I was able to side-step the idea of "a hack in name resolution" by making the queries refer to the database implicitely. This gets us 90% of the way there.

There's just one step remaining: there's a couple of SQL views in crdb_internal (e.g. crdb_internal.statement_statistics) that also refer to system. explicitly.

How can I make these refer to the system.XXX table with a variable database prefix?

I can see a couple of different approaches:

  • move the part of the view query that refers to system.XXX into a (new) virtual table which conditionally selects the database depending on context. I believe this is the easiest.
  • change the view query to not hardcode the system. prefix, then change virtualSchemaView and all the related machinery to add a new boolean flag that will reroute the "current db" parent in the query planner.

Maybe you have other ideas?

@fqazi
Copy link
Collaborator

fqazi commented Aug 21, 2023

Both options are reasonable, but the second option won't be needed once the mixed version state is gone/removed for good. I can't think of any other choices since we would need to influence name resolution, and the scope has to be narrow.

@maryliag
Copy link
Contributor

maryliag commented Nov 3, 2023

No longer a priority

@maryliag maryliag closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

No branches or pull requests

4 participants