- Notifications
You must be signed in to change notification settings - Fork5
Commita2e923a
committed
Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan
is in progress on the same hashtable. This seems the least invasive way tofix the recently-recognized problem that a split could cause the scan tovisit entries twice or (with much lower probability) miss them entirely.The only field-reported problem caused by this is the "failed to re-findshared lock object" PANIC in COMMIT PREPARED reported by Michel Dorochevsky,which was caused by multiply visited entries. However, it seems certainthat mdsync() is vulnerable to missing required fsync's due to missedentries, and I am fearful that RelationCacheInitializePhase2() might be atrisk as well. Because of that and the generalized hazard presented by thisbug, back-patch all the supported branches.Along the way, fix pg_prepared_statement() and pg_cursor() to not assumethat the hashtables they are examining will stay static between calls.This is risky regardless of the newly noted dynahash problem, becausehash_seq_search() has never promised to cope with deletion of table entriesother than the just-returned one. There may be no bug here because the onlysupported way to call these functions is via ExecMakeTableFunctionResult()which will cycle them to completion before doing anything very interesting,but it seems best to get rid of the assumption. This affects 8.2 and HEADonly, since those functions weren't there earlier.1 parent8e90c54 commita2e923a
File tree
8 files changed
+392
-156
lines changed- src
- backend
- access/transam
- commands
- executor
- nodes
- utils
- hash
- mmgr
- include
- nodes
- utils
8 files changed
+392
-156
lines changedLines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
1631 | 1631 |
| |
1632 | 1632 |
| |
1633 | 1633 |
| |
| 1634 | + | |
1634 | 1635 |
| |
1635 | 1636 |
| |
1636 | 1637 |
| |
| |||
1849 | 1850 |
| |
1850 | 1851 |
| |
1851 | 1852 |
| |
| 1853 | + | |
1852 | 1854 |
| |
1853 | 1855 |
| |
1854 | 1856 |
| |
| |||
2003 | 2005 |
| |
2004 | 2006 |
| |
2005 | 2007 |
| |
| 2008 | + | |
2006 | 2009 |
| |
2007 | 2010 |
| |
2008 | 2011 |
| |
| |||
3716 | 3719 |
| |
3717 | 3720 |
| |
3718 | 3721 |
| |
| 3722 | + | |
3719 | 3723 |
| |
3720 | 3724 |
| |
3721 | 3725 |
| |
| |||
3827 | 3831 |
| |
3828 | 3832 |
| |
3829 | 3833 |
| |
| 3834 | + | |
3830 | 3835 |
| |
3831 | 3836 |
| |
3832 | 3837 |
| |
|
Lines changed: 80 additions & 73 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| |||
743 | 743 |
| |
744 | 744 |
| |
745 | 745 |
| |
746 |
| - | |
747 |
| - | |
748 |
| - | |
749 |
| - | |
750 |
| - | |
751 |
| - | |
752 |
| - | |
753 |
| - | |
754 |
| - | |
755 |
| - | |
756 |
| - | |
757 |
| - | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
758 | 762 |
| |
759 |
| - | |
760 |
| - | |
761 |
| - | |
762 |
| - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
763 | 766 |
| |
764 |
| - | |
765 |
| - | |
766 |
| - | |
767 |
| - | |
768 |
| - | |
769 |
| - | |
770 |
| - | |
771 |
| - | |
772 |
| - | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
773 | 782 |
| |
774 |
| - | |
775 |
| - | |
776 |
| - | |
777 |
| - | |
778 |
| - | |
779 |
| - | |
780 |
| - | |
781 |
| - | |
782 |
| - | |
783 |
| - | |
784 |
| - | |
785 |
| - | |
786 |
| - | |
787 |
| - | |
788 |
| - | |
789 |
| - | |
790 |
| - | |
791 |
| - | |
792 |
| - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
793 | 788 |
| |
794 |
| - | |
795 |
| - | |
796 |
| - | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
797 | 794 |
| |
798 |
| - | |
799 |
| - | |
800 |
| - | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
801 | 801 |
| |
802 |
| - | |
803 |
| - | |
804 |
| - | |
805 |
| - | |
806 |
| - | |
807 |
| - | |
808 |
| - | |
| 802 | + | |
| 803 | + | |
809 | 804 |
| |
810 |
| - | |
| 805 | + | |
811 | 806 |
| |
812 |
| - | |
| 807 | + | |
813 | 808 |
| |
814 | 809 |
| |
815 |
| - | |
816 |
| - | |
817 |
| - | |
818 |
| - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
819 | 814 |
| |
820 | 815 |
| |
821 |
| - | |
822 |
| - | |
823 |
| - | |
824 |
| - | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
825 | 822 |
| |
826 |
| - | |
827 |
| - | |
828 |
| - | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
829 | 827 |
| |
830 | 828 |
| |
831 |
| - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
832 | 839 |
| |
833 | 840 |
| |
834 | 841 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
569 | 569 |
| |
570 | 570 |
| |
571 | 571 |
| |
572 |
| - | |
| 572 | + | |
573 | 573 |
| |
574 | 574 |
| |
575 | 575 |
| |
576 | 576 |
| |
577 | 577 |
| |
578 | 578 |
| |
579 | 579 |
| |
| 580 | + | |
| 581 | + | |
580 | 582 |
| |
| 583 | + | |
581 | 584 |
| |
| 585 | + | |
582 | 586 |
| |
583 | 587 |
| |
584 | 588 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| |||
907 | 907 |
| |
908 | 908 |
| |
909 | 909 |
| |
910 |
| - | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
911 | 915 |
| |
912 | 916 |
| |
913 | 917 |
| |
|
0 commit comments
Comments
(0)