Re: min_safe_lsn column in pg_replication_slots view
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgbf@twiska.com, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, masao.fujii@oss.nttdata.com, pgsql-hackers@lists.postgresql.org
Date: 2020-07-09T22:20:04Z
Lists: pgsql-hackers
On 2020-Jul-09, Tom Lane wrote: > and even the most cursory look at the code confirms that there's a > real bug here. KeepLogSeg expects *logSegNo to be defined on entry, > but GetWALAvailability hasn't bothered to initialize oldestSlotSeg. > It is not clear to me which one is in the wrong; the comment for > KeepLogSeg isn't particularly clear on this. Oh, so I introduced the bug when I removed the initialization in this fix. That one was using the wrong datatype, but evidently it achieved the right effect. And KeepLogSeg is using the wrong datatype Invalid macro also. I think we should define InvalidXLogSegNo to be ~((uint64)0) and add a macro to test for that. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix uninitialized value in segno calculation
- b5b4c0fef9fb 14.0 landed
- 794e8e32bb5a 13.0 landed
-
Morph pg_replication_slots.min_safe_lsn to safe_wal_size
- c54b5891f415 13.0 landed
- a8aaa0c786b3 14.0 landed