forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6fd5071
committed
Set query ID in parallel workers for vacuum, BRIN and btree
All these code paths use their own entry point when starting parallelworkers, but failed to set a query ID, even if they set a text query.Hence, this data would be missed in pg_stat_activity for the workerprocesses. The main entry point for parallel query processing,ParallelQueryMain(), is already doing that by saving its query ID in adummy PlannedStmt, but not the others. The code is changed so as thequery ID of these queries is set in their shared state, and reportedback once the parallel workers start.Some tests are added to show how the failures can happen for btree andBRIN with a parallel build enforced, which are able to trigger a failurein an assertion added by24f5205 in the recovery TAP test027_stream_regress.pl where pg_stat_statements is always loaded. Inthis case, the executor path was taken because the index expressionneeds to be flattened when building its IndexInfo.Alexander Lakhin has noticed the problem in btree, and I have noticedthat the issue was more spread. This is arguably a bug, but nobody hascomplained about that until now, so no backpatch is done out of caution.If folks would like to see a backpatch, well, let me know.Reported-by: Alexander LakhinReviewed-by: Sami ImseihDiscussion:https://postgr.es/m/cf3547c1-498a-6a61-7b01-819f902a251f@gmail.com1 parent0d5a3d7 commit6fd5071
File tree
7 files changed
+64
-3
lines changed- src
- backend
- access
- brin
- nbtree
- commands
- test/regress
- expected
- sql
7 files changed
+64
-3
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 |
| |
71 | 74 |
| |
72 | 75 |
| |
| |||
2448 | 2451 |
| |
2449 | 2452 |
| |
2450 | 2453 |
| |
| 2454 | + | |
2451 | 2455 |
| |
2452 | 2456 |
| |
2453 | 2457 |
| |
| |||
2891 | 2895 |
| |
2892 | 2896 |
| |
2893 | 2897 |
| |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
2894 | 2901 |
| |
2895 | 2902 |
| |
2896 | 2903 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 |
| |
109 | 112 |
| |
110 | 113 |
| |
| |||
1505 | 1508 |
| |
1506 | 1509 |
| |
1507 | 1510 |
| |
| 1511 | + | |
1508 | 1512 |
| |
1509 | 1513 |
| |
1510 | 1514 |
| |
| |||
1787 | 1791 |
| |
1788 | 1792 |
| |
1789 | 1793 |
| |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
1790 | 1797 |
| |
1791 | 1798 |
| |
1792 | 1799 |
| |
|
Lines changed: 8 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
61 |
| - | |
62 |
| - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
| |||
369 | 370 |
| |
370 | 371 |
| |
371 | 372 |
| |
| 373 | + | |
372 | 374 |
| |
373 | 375 |
| |
374 | 376 |
| |
| |||
1014 | 1016 |
| |
1015 | 1017 |
| |
1016 | 1018 |
| |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1017 | 1022 |
| |
1018 | 1023 |
| |
1019 | 1024 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
567 | 567 |
| |
568 | 568 |
| |
569 | 569 |
| |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
570 | 580 |
| |
571 | 581 |
| |
572 | 582 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
476 | 476 |
| |
477 | 477 |
| |
478 | 478 |
| |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
479 | 489 |
| |
480 | 490 |
| |
481 | 491 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
510 | 510 |
| |
511 | 511 |
| |
512 | 512 |
| |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
513 | 524 |
| |
514 | 525 |
| |
515 | 526 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
272 | 272 |
| |
273 | 273 |
| |
274 | 274 |
| |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
275 | 286 |
| |
276 | 287 |
| |
277 | 288 |
| |
|
0 commit comments
Comments
(0)