Commit f2dce14
committed
readyset-adapter: Improve duplicate cache creation handling
Previously, before creating a named cache, we would first drop any
existing cache with that same name before creation. In Iad22f58, we
added a similar check for unnamed caches, comparing query_id to first
drop a duplicate before creation.
It's important to first drop a duplicate cache to prevent the graph
metadata in SqlToMirConverter from erroneously being updated with node
index values that are then never persisted to the graph itself, which
can happen if we decide to abandon the in-progress graph creation to
instead reuse the previous cache.
Unfortunately, we could still run into this inconsistency between
SqlToMirConverter and the graph when creating duplicate caches with
different names.
Now, instead of these targeted checks that made decisions based on what
was in the adapter's view name cache, we instead query the controller
for any existing caches that match either the same query_id or requested
name. If any such cache exists, drop it before creation.
Fixes: REA-5765
Release-Note-Core: Fix a bug that led to errors when attempting to
create duplicate caches.
Change-Id: I4e5aa25d19e1ea4488c986ee65f4a85ec8a801a5
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/9655
Tested-by: Buildkite CI
Reviewed-by: Jason Brown <jason.b@readyset.io>1 parent cd13971 commit f2dce14
File tree
2 files changed
+78
-7
lines changed- readyset-adapter/src
- readyset-mysql/tests
2 files changed
+78
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
1922 | 1923 | | |
1923 | 1924 | | |
1924 | 1925 | | |
| 1926 | + | |
| 1927 | + | |
1925 | 1928 | | |
1926 | 1929 | | |
1927 | 1930 | | |
1928 | | - | |
| 1931 | + | |
1929 | 1932 | | |
1930 | 1933 | | |
1931 | 1934 | | |
1932 | | - | |
1933 | | - | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
1934 | 1947 | | |
1935 | | - | |
1936 | | - | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
1937 | 1951 | | |
1938 | 1952 | | |
1939 | | - | |
| 1953 | + | |
1940 | 1954 | | |
| 1955 | + | |
1941 | 1956 | | |
1942 | 1957 | | |
1943 | 1958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3005 | 3005 | | |
3006 | 3006 | | |
3007 | 3007 | | |
3008 | | - | |
| 3008 | + | |
| 3009 | + | |
3009 | 3010 | | |
3010 | 3011 | | |
3011 | 3012 | | |
| |||
3030 | 3031 | | |
3031 | 3032 | | |
3032 | 3033 | | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
3033 | 3089 | | |
3034 | 3090 | | |
3035 | 3091 | | |
| |||
0 commit comments