forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit06c418e
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 before starting the transaction.This option is useful when the user makes some data changes on primary andneeds a guarantee to see these changes on standby.The queue of waiters is stored in the shared memory array sorted by LSN.During replay of WAL waiters whose LSNs are already replayed are deleted fromthe shared memory array and woken up by setting of 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 in a non-atomic context,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 Taveira1 parent6faca9a commit06c418e
File tree
16 files changed
+648
-2
lines changed- doc/src/sgml
- src
- backend
- access/transam
- catalog
- commands
- storage
- ipc
- lmgr
- utils/activity
- include
- catalog
- commands
- test/recovery
- t
- tools/pgindent
16 files changed
+648
-2
lines changedLines changed: 113 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28284 | 28284 |
| |
28285 | 28285 |
| |
28286 | 28286 |
| |
| 28287 | + | |
| 28288 | + | |
| 28289 | + | |
| 28290 | + | |
| 28291 | + | |
| 28292 | + | |
| 28293 | + | |
| 28294 | + | |
| 28295 | + | |
| 28296 | + | |
| 28297 | + | |
| 28298 | + | |
| 28299 | + | |
| 28300 | + | |
| 28301 | + | |
| 28302 | + | |
| 28303 | + | |
| 28304 | + | |
| 28305 | + | |
| 28306 | + | |
| 28307 | + | |
| 28308 | + | |
| 28309 | + | |
| 28310 | + | |
| 28311 | + | |
| 28312 | + | |
| 28313 | + | |
| 28314 | + | |
| 28315 | + | |
| 28316 | + | |
| 28317 | + | |
| 28318 | + | |
| 28319 | + | |
| 28320 | + | |
| 28321 | + | |
| 28322 | + | |
| 28323 | + | |
| 28324 | + | |
| 28325 | + | |
| 28326 | + | |
| 28327 | + | |
| 28328 | + | |
| 28329 | + | |
| 28330 | + | |
| 28331 | + | |
| 28332 | + | |
| 28333 | + | |
| 28334 | + | |
| 28335 | + | |
| 28336 | + | |
| 28337 | + | |
| 28338 | + | |
| 28339 | + | |
| 28340 | + | |
| 28341 | + | |
| 28342 | + | |
| 28343 | + | |
| 28344 | + | |
| 28345 | + | |
| 28346 | + | |
| 28347 | + | |
| 28348 | + | |
| 28349 | + | |
| 28350 | + | |
| 28351 | + | |
| 28352 | + | |
| 28353 | + | |
| 28354 | + | |
| 28355 | + | |
| 28356 | + | |
| 28357 | + | |
| 28358 | + | |
| 28359 | + | |
| 28360 | + | |
| 28361 | + | |
| 28362 | + | |
| 28363 | + | |
| 28364 | + | |
| 28365 | + | |
| 28366 | + | |
| 28367 | + | |
| 28368 | + | |
| 28369 | + | |
| 28370 | + | |
| 28371 | + | |
| 28372 | + | |
| 28373 | + | |
| 28374 | + | |
| 28375 | + | |
| 28376 | + | |
| 28377 | + | |
| 28378 | + | |
| 28379 | + | |
| 28380 | + | |
| 28381 | + | |
| 28382 | + | |
| 28383 | + | |
| 28384 | + | |
| 28385 | + | |
| 28386 | + | |
| 28387 | + | |
| 28388 | + | |
| 28389 | + | |
| 28390 | + | |
| 28391 | + | |
| 28392 | + | |
| 28393 | + | |
| 28394 | + | |
| 28395 | + | |
| 28396 | + | |
| 28397 | + | |
| 28398 | + | |
| 28399 | + | |
28287 | 28400 |
| |
28288 | 28401 |
| |
28289 | 28402 |
| |
|
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 |
| |
| |||
6040 | 6041 |
| |
6041 | 6042 |
| |
6042 | 6043 |
| |
| 6044 | + | |
| 6045 | + | |
| 6046 | + | |
| 6047 | + | |
| 6048 | + | |
| 6049 | + | |
6043 | 6050 |
| |
6044 | 6051 |
| |
6045 | 6052 |
| |
|
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)