Re: pgsql: Add contrib/pg_walinspect. - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: pgsql: Add contrib/pg_walinspect.
Date
Msg-id c094bde0d6a984e21535fc66d31dc0f0b4ff4d6a.camel@j-davis.com
Whole thread Raw
In response to Re: pgsql: Add contrib/pg_walinspect.  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Fri, 2022-04-29 at 10:46 +0530, Bharath Rupireddy wrote:
> It's not just the flush ptr, without no wait mode, the functions
> would
> wait if start/input lsn is, say current flush lsn - 1 or 2 or more
> (before the previous record) bytes. If the functions were to wait, by
> how much time should they wait? a timeout? forever?

I see, you're talking about the case of XLogFindNextRecord(), not
XLogReadRecord().

XLogFindNextRecord() is the only way to align the user-provided start
LSN on a valid record, but that calls XLogReadRecord(), which may wait
indefinitely. If there were a different entry point that just did the
alignment and skipped past continuation records, we could prevent it
from trying to read the next record if we are already at the flush
pointer. But without some tweak to that API, nowait is still needed.

Committed your v3 patch with minor modifications.

Regards,
    Jeff Davis





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Missing can't-assign-to-constant checks in plpgsql
Next
From: Alvaro Herrera
Date:
Subject: Re: bogus: logical replication rows/cols combinations