On Fri, Apr 3, 2020 at 3:53 PM Andres Freund <and...@anarazel.de> wrote: > GetOldestXmin() applies vacuum_defer_cleanup_age only when > !RecoveryInProgress(). In contrast to that GetSnapshotData() applies it > unconditionally. > > I'm not actually clear whether including vacuum_defer_cleanup_age on a > replica is meaningful. But it strikes me as odd to have that behavioural > difference between GetOldestXmin() and GetSnapshotData() - without any > need, as far as I can tell?
Did you notice the comments added by Tom in b4a0223d008, which repeat the claim that it isn't used on standbys? I think that this is probably just an oversight in bca8b7f1, as you suggested. It's not that hard to imagine how this oversight might have happened: Hot standby feedback was introduced, and nobody cared about vacuum_defer_cleanup_age anymore. It was always very difficult to tune. OTOH, I wonder if it's possible that vacuum_defer_cleanup_age was deliberately intended to affect the behavior of XLogWalRcvSendHSFeedback(), which is probably one of the most common reasons why GetOldestXmin() is called on standbys. -- Peter Geoghegan