On Tue, Feb 11, 2025 at 03:22:49PM +0100, Álvaro Herrera wrote: > I find this proposed patch a bit strange and I feel it needs more > explanation. > > When this thread started, Bharath justified his patches saying that a > slot that's inactive for a very long time could be problematic because > of XID wraparound. Fine, that sounds a reasonable feature. If you > wanted to invalidate slots whose xmins were too old, I would support > that. He submitted that as his 0004 patch then. > > However, he also chose to submit 0003 with invalidation based on a > timeout. This is far less convincing a feature to me. The > justification for the time out seems to be that ... it's difficult to > have a one-size-fits-all value because size of disks vary. (???) > Or something like that. Really? I mean -- yes, this will prevent > problems in toy databases when run in developer's laptops. It will not > prevent any problems in production databases. Do we really want a > setting that is only useful for toy situations rather than production? > > > Anyway, the thread is way too long, but after some initial pieces were > committed, Nisha took over and submitting patches derived from Bharath's > 0003, and at some point the initial 0004 was dropped. But 0004 was the > more useful one, I thought, so what's going on? > > I'm baffled.
I agree, and I am also baffled because I think this discussion has happened at least once already on this thread. I still feel like the XID-based parameter makes more sense. For replication slots, two primary concerns are 1) storage, for which we have max_slot_wal_keep_size and 2) XID wraparound, for which we don't really have anything today. A timeout might be useful in some contexts, but if the goal is to prevent wraparound, why not target that directly? -- nathan