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

Feature Request: SQL syntax for schema tracking #15921

Open
aparajon opened this issue May 12, 2024 · 2 comments
Open

Feature Request: SQL syntax for schema tracking #15921

aparajon opened this issue May 12, 2024 · 2 comments

Comments

@aparajon
Copy link
Contributor

aparajon commented May 12, 2024

Feature Description

Add SQL syntax that can detect the status of schema tracking and/or trigger it to catch up.

One possible way that this can look like:

>  show schema_tracking;
+--------------+
| Status       |
+--------------+
| IN_PROGRESS  |
+--------------+

> await schema_tracking;
+--------------+
| Status       |
+--------------+
| COMPLETE     |
+--------------+

Use Case(s)

A client app might want to run these commands against the vtgate before issuing further app specific SQL commands. Specifically, this would be useful for tests that run against vttestserver, as there can be a case where all .sql migrations appear to be applied but schema tracking has not yet caught up and the error VT09015: schema tracking required gets emitted.

The context / motivation for this feature request originates from this Slack thread. It seems like schema tracking is actually enabled based on schema_change_signal and queryserver-config-schema-change-signal having a default value of true in vtcombo. And FYI, it seems like I only hit this error in versions of Vitess >= 18, as I haven't yet hit this issue after downgrading tests to run against v17. I'm also open to exploring other ideas or suggestions on how to wait for schema tracking to complete.

@aparajon aparajon added Needs Triage This issue needs to be correctly labelled and triaged Type: Feature Request labels May 12, 2024
@harshit-gangal
Copy link
Member

It interests me that the issue does not exist on v17 and only happens for v18+.
Can you share the Vschema and the query on which you see the error?

@harshit-gangal harshit-gangal added Component: Query Serving and removed Needs Triage This issue needs to be correctly labelled and triaged labels May 13, 2024
@aparajon
Copy link
Contributor Author

Shared privately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants