- Notifications
You must be signed in to change notification settings - Fork5
Commit10c0558
committed
Fix several mistakes around parallel workers and client_encoding.
Previously, workers sent data to the leader using the client encoding.That mostly worked, but the leader the converted the data back to theserver encoding. Since not all encoding conversions are reversible,that could provoke failures. Fix by using the database encoding forall communication between worker and leader.Also, while temporary changes to GUC settings, as from the SET clauseof a function, are in general OK for parallel query, changingclient_encoding this way inside of a parallel worker is not OK.Previously, that would have confused the leader; with these changes,it would not confuse the leader, but it wouldn't do anything either.So refuse such changes in parallel workers.Also, the previous code naively assumed that when it received aNotifyResonse from the worker, it could pass that directly back to theuser. But now that worker-to-leader communication always uses thedatabase encoding, that's clearly no longer correct - though,actually, the old way was always broken for V2 clients. Sodisassemble and reconstitute the message instead.Issues reported by Peter Eisentraut. Patch by me, reviewed byPeter Eisentraut.1 parentf8c5855 commit10c0558
File tree
7 files changed
+78
-6
lines changed- src
- backend
- access/transam
- commands
- libpq
- include
- commands
- libpq
7 files changed
+78
-6
lines changedLines changed: 17 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
810 | 810 |
| |
811 | 811 |
| |
812 | 812 |
| |
813 |
| - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
814 | 824 |
| |
815 | 825 |
| |
816 | 826 |
| |
| |||
988 | 998 |
| |
989 | 999 |
| |
990 | 1000 |
| |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
991 | 1007 |
| |
992 | 1008 |
| |
993 | 1009 |
| |
|
Lines changed: 1 addition & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
390 | 390 |
| |
391 | 391 |
| |
392 | 392 |
| |
393 |
| - | |
394 |
| - | |
395 |
| - | |
396 | 393 |
| |
397 | 394 |
| |
398 | 395 |
| |
| |||
2076 | 2073 |
| |
2077 | 2074 |
| |
2078 | 2075 |
| |
2079 |
| - | |
| 2076 | + | |
2080 | 2077 |
| |
2081 | 2078 |
| |
2082 | 2079 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
755 | 755 |
| |
756 | 756 |
| |
757 | 757 |
| |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
758 | 782 |
| |
759 | 783 |
| |
760 | 784 |
| |
|
Lines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
| 68 | + | |
68 | 69 |
| |
69 | 70 |
| |
70 | 71 |
| |
| |||
639 | 640 |
| |
640 | 641 |
| |
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 | + | |
642 | 672 |
| |
643 | 673 |
| |
644 | 674 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
232 | 232 |
| |
233 | 233 |
| |
234 | 234 |
| |
235 |
| - | |
| 235 | + | |
236 | 236 |
| |
237 | 237 |
| |
238 | 238 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 |
| |
32 | 36 |
| |
33 | 37 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
| 47 | + | |
47 | 48 |
| |
48 | 49 |
| |
49 | 50 |
|
0 commit comments
Comments
(0)