Re: Phantom segment upon promotion causing troubles.
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@postgresql.org, Heikki Linnakangas <hlinnaka@iki.fi>, gregburek@heroku.com
Date: 2017-06-19T07:41:23Z
Lists: pgsql-hackers
Hi, On 2017-06-19 00:30:26 -0700, Andres Freund wrote: > There seems to be a larger question ehre though: Why does > XLogFileReadAnyTLI() probe all timelines even if they weren't a parent > at that period? That seems like a bad idea, especially in more > complicated scenarios where some precursor timeline might live for > longer than it was a parent? ISTM XLogFileReadAnyTLI() should check > which timeline a segment ought to come from, based on the historY? One thing that I blamed first, before debunking it, is that after promotion we do: /* * Preallocate additional log files, if wanted. */ PreallocXlogFiles(EndOfLog); where EndOfLog points to the last replayed record, rather than last record(s). I think that's currently harmless, but it's certainly fragile. Given the uselessness of PreallocXlogFiles() calls, I'm inclined to just remove it here... - Andres
Commits
-
Fix possibility of creating a "phantom" segment after promotion.
- fb886c153bc1 10.0 landed
- 39e30cbc16cf 9.6.4 landed
- 7775ebaf0167 9.5.8 landed
- 823a51ed30c0 9.4.13 landed
- 511d803ca41a 9.3.18 landed
- 81bf7b5b1e4b 9.2.22 landed