forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit41b0dd9
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 parent6c2c5be commit41b0dd9
File tree
24 files changed
+328
-133
lines changed- doc/src/sgml
- src
- backend
- access/heap
- executor
- include
- access
- executor
- foreign
- nodes
24 files changed
+328
-133
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: 13 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1531 | 1531 |
| |
1532 | 1532 |
| |
1533 | 1533 |
| |
1534 |
| - | |
1535 |
| - | |
1536 |
| - | |
1537 |
| - | |
1538 |
| - | |
1539 |
| - | |
1540 |
| - | |
1541 |
| - | |
1542 |
| - | |
1543 |
| - | |
1544 |
| - | |
1545 |
| - | |
1546 |
| - | |
1547 |
| - | |
1548 |
| - | |
1549 | 1534 |
| |
1550 | 1535 |
| |
1551 | 1536 |
| |
| |||
1642 | 1627 |
| |
1643 | 1628 |
| |
1644 | 1629 |
| |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1645 | 1643 |
| |
1646 | 1644 |
| |
1647 | 1645 |
| |
|
Lines changed: 86 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
119 | 119 |
| |
120 | 120 |
| |
121 | 121 |
| |
| 122 | + | |
| 123 | + | |
122 | 124 |
| |
123 | 125 |
| |
124 | 126 |
| |
| |||
255 | 257 |
| |
256 | 258 |
| |
257 | 259 |
| |
| 260 | + | |
| 261 | + | |
258 | 262 |
| |
259 | 263 |
| |
260 | 264 |
| |
| |||
325 | 329 |
| |
326 | 330 |
| |
327 | 331 |
| |
| 332 | + | |
| 333 | + | |
328 | 334 |
| |
329 | 335 |
| |
330 | 336 |
| |
| |||
384 | 390 |
| |
385 | 391 |
| |
386 | 392 |
| |
387 |
| - | |
388 |
| - | |
389 |
| - | |
390 |
| - | |
391 |
| - | |
392 |
| - | |
393 |
| - | |
394 |
| - | |
395 |
| - | |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 | 393 |
| |
400 | 394 |
| |
401 | 395 |
| |
| |||
599 | 593 |
| |
600 | 594 |
| |
601 | 595 |
| |
602 |
| - | |
| 596 | + | |
603 | 597 |
| |
604 | 598 |
| |
605 | 599 |
| |
| |||
609 | 603 |
| |
610 | 604 |
| |
611 | 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 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
612 | 682 |
| |
613 | 683 |
| |
614 | 684 |
| |
| |||
845 | 915 |
| |
846 | 916 |
| |
847 | 917 |
| |
848 |
| - | |
849 |
| - | |
| 918 | + | |
850 | 919 |
| |
851 | 920 |
| |
852 | 921 |
| |
853 | 922 |
| |
| 923 | + | |
| 924 | + | |
854 | 925 |
| |
855 | 926 |
| |
856 | 927 |
| |
|
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 |
| |
|
0 commit comments
Comments
(0)