forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3c5db1d
committed
Implement pg_wal_replay_wait() stored procedure
pg_wal_replay_wait() is to be used on standby and specifies waiting forthe specific WAL location to be replayed. This option is useful whenthe user makes some data changes on primary and needs a guarantee to seethese changes are on standby.The queue of waiters is stored in the shared memory as an LSN-ordered pairingheap, where the waiter with the nearest LSN stays on the top. Duringthe replay of WAL, waiters whose LSNs have already been replayed are deletedfrom the shared memory pairing heap and woken up by setting their latches.pg_wal_replay_wait() needs to wait without any snapshot held. Otherwise,the snapshot could prevent the replay of WAL records, implying a kind ofself-deadlock. This is why it is only possible to implementpg_wal_replay_wait() as a procedure working without an active snapshot,not a function.Catversion is bumped.Discussion:https://postgr.es/m/eb12f9b03851bb2583adab5df9579b4b%40postgrespro.ruAuthor: Kartyshov Ivan, Alexander KorotkovReviewed-by: Michael Paquier, Peter Eisentraut, Dilip Kumar, Amit KapilaReviewed-by: Alexander Lakhin, Bharath Rupireddy, Euler TaveiraReviewed-by: Heikki Linnakangas, Kyotaro Horiguchi1 parenta83f308 commit3c5db1d
File tree
21 files changed
+786
-8
lines changed- doc/src/sgml
- src
- backend
- access/transam
- catalog
- commands
- lib
- storage
- ipc
- lmgr
- tcop
- utils/activity
- include
- catalog
- commands
- lib
- storage
- test/recovery
- t
- tools/pgindent
21 files changed
+786
-8
lines changedLines changed: 117 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28911 | 28911 |
| |
28912 | 28912 |
| |
28913 | 28913 |
| |
| 28914 | + | |
| 28915 | + | |
| 28916 | + | |
| 28917 | + | |
| 28918 | + | |
| 28919 | + | |
| 28920 | + | |
| 28921 | + | |
| 28922 | + | |
| 28923 | + | |
| 28924 | + | |
| 28925 | + | |
| 28926 | + | |
| 28927 | + | |
| 28928 | + | |
| 28929 | + | |
| 28930 | + | |
| 28931 | + | |
| 28932 | + | |
| 28933 | + | |
| 28934 | + | |
| 28935 | + | |
| 28936 | + | |
| 28937 | + | |
| 28938 | + | |
| 28939 | + | |
| 28940 | + | |
| 28941 | + | |
| 28942 | + | |
| 28943 | + | |
| 28944 | + | |
| 28945 | + | |
| 28946 | + | |
| 28947 | + | |
| 28948 | + | |
| 28949 | + | |
| 28950 | + | |
| 28951 | + | |
| 28952 | + | |
| 28953 | + | |
| 28954 | + | |
| 28955 | + | |
| 28956 | + | |
| 28957 | + | |
| 28958 | + | |
| 28959 | + | |
| 28960 | + | |
| 28961 | + | |
| 28962 | + | |
| 28963 | + | |
| 28964 | + | |
| 28965 | + | |
| 28966 | + | |
| 28967 | + | |
| 28968 | + | |
| 28969 | + | |
| 28970 | + | |
| 28971 | + | |
| 28972 | + | |
| 28973 | + | |
| 28974 | + | |
| 28975 | + | |
| 28976 | + | |
| 28977 | + | |
| 28978 | + | |
| 28979 | + | |
| 28980 | + | |
| 28981 | + | |
| 28982 | + | |
| 28983 | + | |
| 28984 | + | |
| 28985 | + | |
| 28986 | + | |
| 28987 | + | |
| 28988 | + | |
| 28989 | + | |
| 28990 | + | |
| 28991 | + | |
| 28992 | + | |
| 28993 | + | |
| 28994 | + | |
| 28995 | + | |
| 28996 | + | |
| 28997 | + | |
| 28998 | + | |
| 28999 | + | |
| 29000 | + | |
| 29001 | + | |
| 29002 | + | |
| 29003 | + | |
| 29004 | + | |
| 29005 | + | |
| 29006 | + | |
| 29007 | + | |
| 29008 | + | |
| 29009 | + | |
| 29010 | + | |
| 29011 | + | |
| 29012 | + | |
| 29013 | + | |
| 29014 | + | |
| 29015 | + | |
| 29016 | + | |
| 29017 | + | |
| 29018 | + | |
| 29019 | + | |
| 29020 | + | |
| 29021 | + | |
| 29022 | + | |
| 29023 | + | |
| 29024 | + | |
| 29025 | + | |
| 29026 | + | |
| 29027 | + | |
| 29028 | + | |
| 29029 | + | |
| 29030 | + | |
28914 | 29031 |
| |
28915 | 29032 |
| |
28916 | 29033 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
| |||
2809 | 2810 |
| |
2810 | 2811 |
| |
2811 | 2812 |
| |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
2812 | 2818 |
| |
2813 | 2819 |
| |
2814 | 2820 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
| 69 | + | |
69 | 70 |
| |
70 | 71 |
| |
71 | 72 |
| |
| |||
6143 | 6144 |
| |
6144 | 6145 |
| |
6145 | 6146 |
| |
| 6147 | + | |
| 6148 | + | |
| 6149 | + | |
| 6150 | + | |
| 6151 | + | |
| 6152 | + | |
6146 | 6153 |
| |
6147 | 6154 |
| |
6148 | 6155 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| 46 | + | |
46 | 47 |
| |
47 | 48 |
| |
48 | 49 |
| |
| |||
1828 | 1829 |
| |
1829 | 1830 |
| |
1830 | 1831 |
| |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
1831 | 1842 |
| |
1832 | 1843 |
| |
1833 | 1844 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
414 | 414 |
| |
415 | 415 |
| |
416 | 416 |
| |
| 417 | + | |
| 418 | + | |
| 419 | + | |
417 | 420 |
| |
418 | 421 |
| |
419 | 422 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
64 |
| - | |
| 64 | + | |
| 65 | + | |
65 | 66 |
| |
66 | 67 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
| 53 | + | |
53 | 54 |
|
0 commit comments
Comments
(0)