Commit 7f174af
committed
distsql: harden infrastructure in some edge cases
As part of looking into a nil pointer crash when rows produced by the
EXPORT were used as an input to the mutation (which is fixed in the
following commit), I noticed some problems with the distsql
infrastructure. In particular, in
f397730 we didn't properly implement
`Close` method for some processors (two EXPORT ones and the column
backfiller) which would mean possibly incomplete cleanup when the
processor never runs.
Additionally, the root cause of the panic was `nil` txn that previously
silently could've been set at the very end of the flow setup if
only at that point we decided that we need to create a leaf txn, yet
LeafTxnInputState was nil. That condition is expected in some cases
(when the flow is not running under a txn, like some bulk flows), yet
for EXPORT which runs under a txn, this was unexpected. This commit adds
an assertion for this.
Furthermore, if we hit an error at this point, we need to perform
cleanup differently from earlier error paths since we've already fully
set up the flow. This commit also adds that.
Release note: None1 parent 1345a57 commit 7f174af
File tree
5 files changed
+41
-20
lines changed- pkg/sql
- backfill
- distsql
- export
- rowexec
5 files changed
+41
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
284 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
223 | 226 | | |
224 | 227 | | |
225 | 228 | | |
| |||
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
270 | 276 | | |
271 | 277 | | |
272 | 278 | | |
| |||
447 | 453 | | |
448 | 454 | | |
449 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
450 | 462 | | |
451 | 463 | | |
452 | 464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
0 commit comments