-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, the migration task relied upon the query IDs generated by ReadySet to determine what caches it needed to create or drop. This was error prone because when caches are created via the gem, they are created via the ID generated from the query string generated by Rails when it invoked the queries. When the caches are created via the *migration file*, they are created via the query string that was obtained from calling `SHOW CACHES`, which has a number of rewrites, including star expansion and fully-qualified table and column names. Creating a cache from this query string would create a cache with a different ID than creating the same cache from the Rails-generated query string. In addition, the migration task was always attempting to create caches via the query ID from the migration file, which relies upon there being an entry in SHOW PROXIED QUERIES for that query ID. This may not always be the case, since it's possible a user may run the cache migrations before routing queries for those caches. This commit fixes these two issues by removing the dependence on query IDs entirely and instead compares the query strings in the migration file to the query strings in SHOW CACHES to determine which caches should be created and dropped. Finally, this commit also rewrites the rake task tests to run directly against the Postgres and ReadySet instances running in CI to ensure that the logic is sound.
- Loading branch information
1 parent
ae5bf0a
commit e98df01
Showing
5 changed files
with
53 additions
and
60 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