Commit fa61313
committed
In REASSIGN OWNED of a database, lock the tuple as mandated.
Commit aac2c9b mandated such locking
and attempted to fulfill that mandate, but it missed REASSIGN OWNED.
Hence, it remained possible to lose VACUUM's inplace update of
datfrozenxid if a REASSIGN OWNED processed that database at the same
time. This didn't affect the other inplace-updated catalog, pg_class.
For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of the
generic AlterObjectOwner_internal(), and ATExecChangeOwner() fulfills
the locking mandate.
Like in GRANT, implement this by following the locking protocol for any
catalog subject to the generic AlterObjectOwner_internal(). It would
suffice to do this for IsInplaceUpdateOid() catalogs only. Back-patch
to v13 (all supported versions).
Kirill Reshke. Reported by Alexander Kukushkin.
Discussion: https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com1 parent d8b0c64 commit fa61313
File tree
5 files changed
+51
-2
lines changed- src
- backend
- catalog
- commands
- include/catalog
- test/regress
- expected
- sql
5 files changed
+51
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2779 | 2779 | | |
2780 | 2780 | | |
2781 | 2781 | | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
2782 | 2798 | | |
2783 | 2799 | | |
2784 | 2800 | | |
2785 | 2801 | | |
2786 | 2802 | | |
2787 | 2803 | | |
2788 | 2804 | | |
2789 | | - | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
2790 | 2811 | | |
2791 | 2812 | | |
2792 | 2813 | | |
| |||
2811 | 2832 | | |
2812 | 2833 | | |
2813 | 2834 | | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
2814 | 2839 | | |
2815 | 2840 | | |
2816 | 2841 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
931 | 932 | | |
932 | 933 | | |
933 | 934 | | |
934 | | - | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
935 | 938 | | |
936 | 939 | | |
937 | 940 | | |
| |||
1031 | 1034 | | |
1032 | 1035 | | |
1033 | 1036 | | |
| 1037 | + | |
| 1038 | + | |
1034 | 1039 | | |
1035 | 1040 | | |
1036 | 1041 | | |
| |||
1039 | 1044 | | |
1040 | 1045 | | |
1041 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
1042 | 1049 | | |
1043 | 1050 | | |
1044 | 1051 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
| 23 | + | |
| 24 | + | |
0 commit comments