On 2021-Aug-17, Bossart, Nathan wrote:
> I think we are in agreement. If we assume that the flush pointer
> jumps along record boundaries and segment boundaries, the solution
> would be to avoid using the flush pointer when it points to a segment
> boundary (given that the segment boundary is not also a record
> boundary). Instead, we'd only send up to the start position of the
> last record in the segment to standbys.
Agreed.
An implementation for that would be to test the flush pointer for it
being a segment boundary, and in that case we (acquire segment boundary
lock and) test for presence in the segment boundary map. If present,
then retreat the pointer to the record's start address.
This means that we acquire the segment boundary lock rarely. I was
concerned that we'd need to acquire it every time we read the flush
pointer, which would have been a disaster.
Thanks
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/