forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitda9456d
committed
Add an isolation test to exercise parallel-worker deadlock resolution.
Commita1c1af2 added logic in the deadlock checker to handle lockgrouping, but it was very poorly tested, as evidenced by the bugfixed in3420851. Add a test case that exercises that a bit better(and catches the bug --- if you revert3420851, this will hang).Since it's pretty hard to get parallel workers to take exclusiveregular locks that their parents don't already have, this test operatesby creating a deadlock among advisory locks taken in parallel workers.To make that happen, we must override the parallel-safety labeling ofthe advisory-lock functions, which we do by putting them in mislabeled,non-inlinable wrapper functions.We also have to remove the redundant PreventAdvisoryLocksInParallelModechecks in lockfuncs.c. That seems fine though; if some user accidentallydoes what this test is intentionally doing, not much harm will ensue.(If there are any remaining bugs that are reachable that way, they'reprobably reachable in other ways too.)Discussion:https://postgr.es/m/3243.1564437314@sss.pgh.pa.us1 parent4886da8 commitda9456d
File tree
4 files changed
+137
-29
lines changed- src
- backend/utils/adt
- test/isolation
- expected
- specs
4 files changed
+137
-29
lines changedLines changed: 0 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
655 | 655 |
| |
656 | 656 |
| |
657 | 657 |
| |
658 |
| - | |
659 |
| - | |
660 |
| - | |
661 |
| - | |
662 |
| - | |
663 |
| - | |
664 |
| - | |
665 |
| - | |
666 |
| - | |
667 | 658 |
| |
668 | 659 |
| |
669 | 660 |
| |
| |||
673 | 664 |
| |
674 | 665 |
| |
675 | 666 |
| |
676 |
| - | |
677 | 667 |
| |
678 | 668 |
| |
679 | 669 |
| |
| |||
691 | 681 |
| |
692 | 682 |
| |
693 | 683 |
| |
694 |
| - | |
695 | 684 |
| |
696 | 685 |
| |
697 | 686 |
| |
| |||
708 | 697 |
| |
709 | 698 |
| |
710 | 699 |
| |
711 |
| - | |
712 | 700 |
| |
713 | 701 |
| |
714 | 702 |
| |
| |||
726 | 714 |
| |
727 | 715 |
| |
728 | 716 |
| |
729 |
| - | |
730 | 717 |
| |
731 | 718 |
| |
732 | 719 |
| |
| |||
746 | 733 |
| |
747 | 734 |
| |
748 | 735 |
| |
749 |
| - | |
750 | 736 |
| |
751 | 737 |
| |
752 | 738 |
| |
| |||
767 | 753 |
| |
768 | 754 |
| |
769 | 755 |
| |
770 |
| - | |
771 | 756 |
| |
772 | 757 |
| |
773 | 758 |
| |
| |||
787 | 772 |
| |
788 | 773 |
| |
789 | 774 |
| |
790 |
| - | |
791 | 775 |
| |
792 | 776 |
| |
793 | 777 |
| |
| |||
808 | 792 |
| |
809 | 793 |
| |
810 | 794 |
| |
811 |
| - | |
812 | 795 |
| |
813 | 796 |
| |
814 | 797 |
| |
| |||
828 | 811 |
| |
829 | 812 |
| |
830 | 813 |
| |
831 |
| - | |
832 | 814 |
| |
833 | 815 |
| |
834 | 816 |
| |
| |||
848 | 830 |
| |
849 | 831 |
| |
850 | 832 |
| |
851 |
| - | |
852 | 833 |
| |
853 | 834 |
| |
854 | 835 |
| |
| |||
866 | 847 |
| |
867 | 848 |
| |
868 | 849 |
| |
869 |
| - | |
870 | 850 |
| |
871 | 851 |
| |
872 | 852 |
| |
| |||
885 | 865 |
| |
886 | 866 |
| |
887 | 867 |
| |
888 |
| - | |
889 | 868 |
| |
890 | 869 |
| |
891 | 870 |
| |
| |||
903 | 882 |
| |
904 | 883 |
| |
905 | 884 |
| |
906 |
| - | |
907 | 885 |
| |
908 | 886 |
| |
909 | 887 |
| |
| |||
922 | 900 |
| |
923 | 901 |
| |
924 | 902 |
| |
925 |
| - | |
926 | 903 |
| |
927 | 904 |
| |
928 | 905 |
| |
| |||
943 | 920 |
| |
944 | 921 |
| |
945 | 922 |
| |
946 |
| - | |
947 | 923 |
| |
948 | 924 |
| |
949 | 925 |
| |
| |||
965 | 941 |
| |
966 | 942 |
| |
967 | 943 |
| |
968 |
| - | |
969 | 944 |
| |
970 | 945 |
| |
971 | 946 |
| |
| |||
986 | 961 |
| |
987 | 962 |
| |
988 | 963 |
| |
989 |
| - | |
990 | 964 |
| |
991 | 965 |
| |
992 | 966 |
| |
| |||
1008 | 982 |
| |
1009 | 983 |
| |
1010 | 984 |
| |
1011 |
| - | |
1012 | 985 |
| |
1013 | 986 |
| |
1014 | 987 |
| |
| |||
1029 | 1002 |
| |
1030 | 1003 |
| |
1031 | 1004 |
| |
1032 |
| - | |
1033 | 1005 |
| |
1034 | 1006 |
| |
1035 | 1007 |
| |
| |||
1050 | 1022 |
| |
1051 | 1023 |
| |
1052 | 1024 |
| |
1053 |
| - | |
1054 | 1025 |
| |
1055 | 1026 |
| |
1056 | 1027 |
| |
|
Lines changed: 47 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
|
Lines changed: 89 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + |
0 commit comments
Comments
(0)