forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd6a149f
committed
Separate reinitialization of shared parallel-scan state from ExecReScan.
Previously, the parallel executor logic did reinitialization of sharedstate within the ExecReScan code for parallel-aware scan nodes. This isproblematic, because it means that the ExecReScan call has to occursynchronously (ie, during the parent Gather node's ReScan call). That isswimming very much against the tide so far as the ExecReScan machinery isconcerned; the fact that it works at all today depends on a lot of fragileassumptions, such as that no plan node between Gather and a parallel-awarescan node is parameterized. Another objection is that because ExecReScanmight be called in workers as well as the leader, hacky extra tests areneeded in some places to prevent unwanted shared-state resets.Hence, let's separate this code into two functions, a ReInitializeDSMcall and the ReScan call proper. ReInitializeDSM is called only inthe leader and is guaranteed to run before we start new workers.ReScan is returned to its traditional function of resetting only localstate, which means that ExecReScan's usual habits of delaying oreliminating child rescan calls are safe again.As with the preceding commit7df2c1f, it doesn't seem to be necessaryto make these changes in 9.6, which is a good thing because the FDW andCustomScan APIs are impacted.Discussion:https://postgr.es/m/CAA4eK1JkByysFJNh9M349u_nNjqETuEnY_y1VUc_kJiU0bxtaQ@mail.gmail.com1 parent5816ddc commitd6a149f
File tree
22 files changed
+302
-135
lines changed- doc/src/sgml
- src
- backend
- access/heap
- executor
- include
- access
- executor
- foreign
- nodes
22 files changed
+302
-135
lines changedLines changed: 23 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
320 | 320 |
| |
321 | 321 |
| |
322 | 322 |
| |
323 |
| - | |
324 |
| - | |
| 323 | + | |
| 324 | + | |
325 | 325 |
| |
326 | 326 |
| |
327 | 327 |
| |
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
331 | 348 |
| |
332 | 349 |
| |
333 | 350 |
| |
334 | 351 |
| |
335 |
| - | |
336 |
| - | |
337 |
| - | |
338 |
| - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
339 | 356 |
| |
340 | 357 |
| |
341 | 358 |
| |
|
Lines changed: 31 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1191 | 1191 |
| |
1192 | 1192 |
| |
1193 | 1193 |
| |
1194 |
| - | |
| 1194 | + | |
1195 | 1195 |
| |
1196 |
| - | |
1197 |
| - | |
1198 |
| - | |
1199 |
| - | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1200 | 1200 |
| |
1201 | 1201 |
| |
1202 | 1202 |
| |
| |||
1215 | 1215 |
| |
1216 | 1216 |
| |
1217 | 1217 |
| |
1218 |
| - | |
| 1218 | + | |
1219 | 1219 |
| |
1220 | 1220 |
| |
1221 | 1221 |
| |
| |||
1230 | 1230 |
| |
1231 | 1231 |
| |
1232 | 1232 |
| |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1233 | 1236 |
| |
1234 | 1237 |
| |
1235 | 1238 |
| |
| |||
1239 | 1242 |
| |
1240 | 1243 |
| |
1241 | 1244 |
| |
1242 |
| - | |
1243 |
| - | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
1244 | 1264 |
| |
1245 | 1265 |
| |
1246 | 1266 |
| |
| |||
1249 | 1269 |
| |
1250 | 1270 |
| |
1251 | 1271 |
| |
1252 |
| - | |
1253 |
| - | |
1254 |
| - | |
1255 |
| - | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
1256 | 1275 |
| |
1257 | 1276 |
| |
1258 | 1277 |
| |
|
Lines changed: 19 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1525 | 1525 |
| |
1526 | 1526 |
| |
1527 | 1527 |
| |
1528 |
| - | |
1529 |
| - | |
1530 |
| - | |
1531 |
| - | |
1532 |
| - | |
1533 |
| - | |
1534 |
| - | |
1535 |
| - | |
1536 |
| - | |
1537 |
| - | |
1538 |
| - | |
1539 |
| - | |
1540 |
| - | |
1541 |
| - | |
1542 |
| - | |
1543 |
| - | |
1544 |
| - | |
1545 |
| - | |
1546 |
| - | |
1547 | 1528 |
| |
1548 | 1529 |
| |
1549 | 1530 |
| |
| |||
1640 | 1621 |
| |
1641 | 1622 |
| |
1642 | 1623 |
| |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1643 | 1643 |
| |
1644 | 1644 |
| |
1645 | 1645 |
| |
|
Lines changed: 72 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
| 112 | + | |
| 113 | + | |
112 | 114 |
| |
113 | 115 |
| |
114 | 116 |
| |
| |||
364 | 366 |
| |
365 | 367 |
| |
366 | 368 |
| |
367 |
| - | |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 | 369 |
| |
380 | 370 |
| |
381 | 371 |
| |
| |||
567 | 557 |
| |
568 | 558 |
| |
569 | 559 |
| |
570 |
| - | |
| 560 | + | |
571 | 561 |
| |
572 | 562 |
| |
573 | 563 |
| |
| |||
577 | 567 |
| |
578 | 568 |
| |
579 | 569 |
| |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
580 | 639 |
| |
581 | 640 |
| |
582 | 641 |
| |
|
Lines changed: 25 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
705 | 705 |
| |
706 | 706 |
| |
707 | 707 |
| |
708 |
| - | |
709 |
| - | |
710 |
| - | |
711 |
| - | |
712 |
| - | |
713 |
| - | |
714 |
| - | |
715 |
| - | |
716 |
| - | |
717 |
| - | |
718 |
| - | |
719 |
| - | |
720 |
| - | |
721 |
| - | |
722 |
| - | |
723 |
| - | |
724 |
| - | |
725 | 708 |
| |
726 | 709 |
| |
727 | 710 |
| |
| |||
999 | 982 |
| |
1000 | 983 |
| |
1001 | 984 |
| |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
1002 | 1010 |
| |
1003 | 1011 |
| |
1004 | 1012 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
194 | 194 |
| |
195 | 195 |
| |
196 | 196 |
| |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
197 | 212 |
| |
198 | 213 |
| |
199 | 214 |
| |
|
Lines changed: 22 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
332 | 332 |
| |
333 | 333 |
| |
334 | 334 |
| |
335 |
| - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
336 | 357 |
| |
337 | 358 |
| |
338 | 359 |
| |
|
0 commit comments
Comments
(0)