Commit e0c247e
committed
sql: unconditionally check DistSQL supportability
This commit hardens c17591e. In
particular, in that change we disabled the usage of the Streamer
whenever some part of the plan isn't distributable. However, population
of `distSQLProhibitedErr` was left on a best-effort basis. In
particular, if we have `distsql=off` (as well as a couple of other
conditions), we'd skip the supportability check. This meant that we
could still end up using the Streamer in some illegal cases - one
example that I came up with is if we have a routine (which currently
prohibits distsql), it might access the RootTxn concurrently with the
LeafTxn access by the Streamer, which is no bueno. This commit makes it
so that we do DistSQL supportability check unconditionally. Note that
this shouldn't really have a performance impact - after all, we do
expect this check to be done pretty much all the time (unless someone
runs with `distsql=off`).
Additionally, this change happens to fix a nil pointer error around the
recent fix to top-level query stats in presence of routines. Namely,
that patch only set the metadata forwarder for local plans if we end up
using the RootTxn, but in a query where we happened to use the streamer
with routines, (before this patch) we'd end up with LeafTxn and unset
metadata forwarder. Now we'll have streamer disabled, so we'll have the
RootTxn and the forwarder will be set.
Release note: None1 parent 96ac92e commit e0c247e
File tree
6 files changed
+62
-39
lines changed- pkg/sql
- opt/exec/execbuilder/testdata
6 files changed
+62
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
993 | | - | |
| 993 | + | |
| 994 | + | |
994 | 995 | | |
995 | 996 | | |
996 | 997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
875 | 875 | | |
876 | 876 | | |
877 | 877 | | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
887 | 882 | | |
888 | 883 | | |
889 | 884 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
| 1224 | + | |
1224 | 1225 | | |
1225 | 1226 | | |
1226 | 1227 | | |
1227 | 1228 | | |
1228 | 1229 | | |
1229 | | - | |
| 1230 | + | |
1230 | 1231 | | |
1231 | 1232 | | |
1232 | 1233 | | |
| |||
1244 | 1245 | | |
1245 | 1246 | | |
1246 | 1247 | | |
1247 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
1248 | 1251 | | |
1249 | 1252 | | |
1250 | | - | |
1251 | | - | |
| 1253 | + | |
| 1254 | + | |
1252 | 1255 | | |
1253 | 1256 | | |
1254 | 1257 | | |
| |||
1259 | 1262 | | |
1260 | 1263 | | |
1261 | 1264 | | |
| 1265 | + | |
1262 | 1266 | | |
1263 | 1267 | | |
1264 | 1268 | | |
| |||
1268 | 1272 | | |
1269 | 1273 | | |
1270 | 1274 | | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1271 | 1285 | | |
1272 | 1286 | | |
1273 | 1287 | | |
| |||
1309 | 1323 | | |
1310 | 1324 | | |
1311 | 1325 | | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
1312 | 1336 | | |
1313 | 1337 | | |
1314 | 1338 | | |
1315 | 1339 | | |
1316 | 1340 | | |
1317 | 1341 | | |
1318 | | - | |
| 1342 | + | |
1319 | 1343 | | |
1320 | 1344 | | |
1321 | 1345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2225 | 2225 | | |
2226 | 2226 | | |
2227 | 2227 | | |
2228 | | - | |
2229 | | - | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
2230 | 2232 | | |
2231 | 2233 | | |
2232 | 2234 | | |
| |||
2245 | 2247 | | |
2246 | 2248 | | |
2247 | 2249 | | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
| 2250 | + | |
| 2251 | + | |
2255 | 2252 | | |
2256 | | - | |
2257 | | - | |
2258 | | - | |
2259 | | - | |
2260 | | - | |
2261 | | - | |
2262 | | - | |
2263 | | - | |
2264 | | - | |
2265 | 2253 | | |
2266 | 2254 | | |
2267 | 2255 | | |
| |||
2277 | 2265 | | |
2278 | 2266 | | |
2279 | 2267 | | |
2280 | | - | |
2281 | 2268 | | |
2282 | 2269 | | |
2283 | 2270 | | |
2284 | 2271 | | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
2285 | 2288 | | |
2286 | 2289 | | |
2287 | 2290 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
0 commit comments