Re: prevent immature WAL streaming - Mailing list pgsql-hackers

From alvherre@alvh.no-ip.org
Subject Re: prevent immature WAL streaming
Date
Msg-id 202108251232.aaxpgvj3rcvw@alvherre.pgsql
Whole thread Raw
In response to Re: prevent immature WAL streaming  ("Bossart, Nathan" <bossartn@amazon.com>)
List pgsql-hackers
On 2021-Aug-24, Bossart, Nathan wrote:

> If moving RegisterSegmentBoundary() is sufficient to prevent the flush
> pointer from advancing before we register the boundary, I bet we could
> also remove the WAL writer nudge.

Can you elaborate on this?  I'm not sure I see the connection.

> Another interesting thing I see is that the boundary stored in
> earliestSegBoundary is not necessarily the earliest one.  It's just
> the first one that has been registered.  I did this for simplicity for
> the .ready file fix, but I can see it causing problems here.

Hmm, is there really a problem here?  Surely the flush point cannot go
past whatever has been written.  If somebody is writing an earlier
section of WAL, then we cannot move the flush pointer to a later
position.  So it doesn't matter if the earliest point we have registered
is the true earliest -- we only care for it to be the earliest that is
past the flush point.

-- 
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Ajin Cherian
Date:
Subject: Re: Failure of subscription tests with topminnow
Next
From: Masahiko Sawada
Date:
Subject: Re: Failure of subscription tests with topminnow