- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitb0afdca
committed
Fix slot data persistency when advancing physical replication slots
Advancing a physical replication slot with pg_replication_slot_advance()did not mark the slot as dirty if any advancing was done, preventing thefollow-up checkpoint to flush the slot data to disk. This caused theadvancing to be lost even on clean restarts. This does not happen forlogical slots as any advancing marked the slot as dirty. Perdiscussion, the original feature has been implemented so as in the eventof a crash the slot may move backwards to a past LSN. This property iskept and more documentation is added about that.This commit adds some new TAP tests to check the persistency of physicaland logical slots after advancing across clean restarts.Author: Alexey Kondratov, Michael PaquierReviewed-by: Andres Freund, Kyotaro Horiguchi, Craig RingerDiscussion:https://postgr.es/m/059cc53a-8b14-653a-a24d-5f867503b0ee@postgrespro.ruBackpatch-through: 111 parent26a81bb commitb0afdca
File tree
4 files changed
+67
-16
lines changed- doc/src/sgml
- src
- backend/replication
- test/recovery/t
4 files changed
+67
-16
lines changedLines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20470 | 20470 |
| |
20471 | 20471 |
| |
20472 | 20472 |
| |
20473 |
| - | |
20474 |
| - | |
| 20473 | + | |
| 20474 | + | |
| 20475 | + | |
| 20476 | + | |
| 20477 | + | |
20475 | 20478 |
| |
20476 | 20479 |
| |
20477 | 20480 |
| |
|
Lines changed: 11 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
370 | 370 |
| |
371 | 371 |
| |
372 | 372 |
| |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
373 | 381 |
| |
374 | 382 |
| |
375 | 383 |
| |
| |||
467 | 475 |
| |
468 | 476 |
| |
469 | 477 |
| |
470 |
| - | |
471 |
| - | |
472 |
| - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
473 | 481 |
| |
474 | 482 |
| |
475 | 483 |
| |
| |||
566 | 574 |
| |
567 | 575 |
| |
568 | 576 |
| |
569 |
| - | |
570 |
| - | |
571 |
| - | |
572 |
| - | |
573 |
| - | |
574 |
| - | |
575 |
| - | |
576 |
| - | |
577 |
| - | |
578 | 577 |
| |
579 | 578 |
| |
580 | 579 |
| |
|
Lines changed: 26 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
344 | 344 |
| |
345 | 345 |
| |
346 | 346 |
| |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + |
Lines changed: 25 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
138 | 162 |
| |
139 | 163 |
|
0 commit comments
Comments
(0)