forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit78ea8b5
committed
Fix WAL recycling on standbys depending on archive_mode
A restart point or a checkpoint recycling WAL segments treats segmentsmarked with neither ".done" (archiving is done) or ".ready" (segment isready to be archived) in archive_status the same way for archive_modebeing "on" or "always". While for a primary this is fine, a standbyrunning a restart point with archive_mode = on would try to mark such asegment as ready for archiving, which is something that will neverhappen except after the standby is promoted.Note that this problem applies only to WAL segments coming from thelocal pg_wal the first time archive recovery is run. Segments part of aself-contained base backup are the most common case where this couldhappen, however even in this case normally the .done markers would bemost likely part of the backup. Segments recovered from an archive aremarked as .ready or .done by the startup process, and segments finishedstreaming are marked as such by the WAL receiver, so they are handledalready.Reported-by: Haruka TakatsukaAuthor: Michael PaquierDiscussion:https://postgr.es/m/15402-a453c90ed4cf88b2@postgresql.orgBackpatch-through: 9.5, where archive_mode = always has been added.1 parentaaf10f3 commit78ea8b5
1 file changed
+9
-2
lines changedLines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
620 | 620 |
| |
621 | 621 |
| |
622 | 622 |
| |
| 623 | + | |
623 | 624 |
| |
624 |
| - | |
625 |
| - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
626 | 633 |
| |
627 | 634 |
| |
628 | 635 |
| |
|
0 commit comments
Comments
(0)