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

Per-query versioning #4489

Closed
greenape opened this issue Nov 5, 2021 · 3 comments · Fixed by #6841
Closed

Per-query versioning #4489

greenape opened this issue Nov 5, 2021 · 3 comments · Fixed by #6841
Labels
enhancement New feature or request FlowMachine Issues related to FlowMachine

Comments

@greenape
Copy link
Member

greenape commented Nov 5, 2021

At present, if you cache a query, then the SQL only for that query changes in a subsequent release, you may get an incorrect result unless you clear the cache first, because generated SQL is not included in the id hash. An obvious solution would be to add a version field per query, although this relies on people remembering to bump the version!

@greenape
Copy link
Member Author

greenape commented Oct 8, 2024

Reflecting on this after getting bitten by a cache version mismatch, I think maybe better to just include the version of fm in the hash. Less error prone at the expense of being more wasteful, but I think that's an acceptable tradeoff.

@greenape
Copy link
Member Author

greenape commented Oct 8, 2024

Will make some of our tests a pain in the ass though, where we're checking for hash consistency or rely on it.

@greenape
Copy link
Member Author

Maybe one option here would be to append the version to the hash unhashed? That way one could split it out in tests.. You'd need to change the separator to make it a valid table name, or change the table name to not be strictly the same as x<query_id> I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request FlowMachine Issues related to FlowMachine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant