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

Fix query cache dbver issue with concurrent DDL #6819

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Conversation

fantix
Copy link
Member

@fantix fantix commented Feb 12, 2024

During a query compilation, if the schema is changed, the server was caching the compiled query under a wrong dbver, causing future queries to fail. See the test for issue reproduction.

@msullivan, I think you mentioned adding a similar compiler sleep hook for testing, but I can't find it. Please let me know if there's a better way than the sleep sentinel I added here in the query string.

@fantix fantix requested review from msullivan and elprans February 12, 2024 19:50
@msullivan
Copy link
Member

@msullivan, I think you mentioned adding a similar compiler sleep hook for testing, but I can't find it. Please let me know if there's a better way than the sleep sentinel I added here in the query string.

I don't know if there is really any good way to do such things. (I did a different bad way, and then didn't merge it.)

@msullivan
Copy link
Member

Maybe a better (I guess?) way would be to add some testmode function, and then have a compiler function hook using simple_special_case that sleeps. Downside there though is that it is tough to pass in the sleep amount, since constants will be extracted. (You could have it wait for the the length of an array, or something silly like that)

During a query compilation, if the schema is changed, the server was
caching the compiled query under a wrong dbver, causing future queries
to fail. See the test for issue reproduction.
@fantix fantix force-pushed the concurrent-ddl-dbver branch from a86caf5 to 2d1f4c1 Compare February 12, 2024 20:09
@fantix fantix marked this pull request as ready for review February 12, 2024 20:09
@fantix fantix changed the title Fix query cache dbver issue with concurrent ddl Fix query cache dbver issue with concurrent DDL Feb 12, 2024
Copy link
Member

@msullivan msullivan left a comment

Choose a reason for hiding this comment

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

This makes sense to me.

It's probably worth thinking more about the race conditions against DDL, though, that can cause transient ISEs like this. That's longstanding, though, I think, so probably doesn't need to be fixed right now

@fantix fantix mentioned this pull request Feb 12, 2024
@fantix fantix merged commit b174d8d into master Feb 12, 2024
23 checks passed
@fantix fantix deleted the concurrent-ddl-dbver branch February 12, 2024 21:41
@aljazerzen aljazerzen mentioned this pull request Mar 12, 2024
aljazerzen pushed a commit that referenced this pull request Mar 13, 2024
During a query compilation, if the schema is changed, the server was
caching the compiled query under a wrong dbver, causing future queries
to fail. See the test for issue reproduction.
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