-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do persistent cache writebacks asynchronously (#7025)
Whenever a entry is added to the in memory cache, enqueue it in a queue that a per-db worker task consumes. The worker task manages all cache inserts and evictions, which should fully eliminate the serialization error dangers. This also lets us persistently cache queries that were first compiled from within a rolled back transaction. Also, reenable query-cache-notifications, but make them include the specific keys to query and implement a debouncing/batching algorithm to cut down on traffic. Unfortunately, even with query-cache-notifications off, the async caching starts triggering the bizarre failures to lookup transactions in postgres on arm64 linux. I'm going to put up a follow up that disables the cache there, so we can move ahead with testing and the release. FUTURE NOTE: The situation for function caching once we want to reintroduce that will be a little more complicated. We'll need to put both the SQL text and the function call code in the in-memory cache, and use the text until the function is visible everywhere (at which point we can drop the text.) We'll also need to do some thinking about how to test it properly, because the downside of the approach is that in the typically path, the first execution of a query can't use the function. We may need some sort of testing path to allow us to exercise the functions easily in the test code.
- Loading branch information
Showing
13 changed files
with
371 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.