- Notifications
You must be signed in to change notification settings - Fork5
Commitd851bef
committed
Dirty replication slots when using sql interface
When pg_logical_slot_get_changes(...) sets confirmed_flush_lsn to the point atwhich replay stopped, it doesn't dirty the replication slot. So if the replaydidn't cause restart_lsn or catalog_xmin to change as well, this change willnot get written out to disk. Even on a clean shutdown.If Pg crashes or restarts, a subsequent pg_logical_slot_get_changes(...) callwill see the same changes already replayed since it uses the slot'sconfirmed_flush_lsn as the start point for fetching changes. The caller can'tspecify a start LSN when using the SQL interface.Mark the slot as dirty after reading changes using the SQL interface so thatusers won't see repeated changes after a clean shutdown. Repeated changes stilloccur when using the walsender interface or after an unclean shutdown.Craig Ringer1 parentb618208 commitd851bef
File tree
3 files changed
+57
-0
lines changed- src
- backend/replication/logical
- test/recovery
- t
3 files changed
+57
-0
lines changedLines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
321 | 321 |
| |
322 | 322 |
| |
323 | 323 |
| |
| 324 | + | |
324 | 325 |
| |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
325 | 340 |
| |
326 | 341 |
| |
327 | 342 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
| 22 | + |
Lines changed: 40 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 | + |
0 commit comments
Comments
(0)