Re: Can we change pg_rewind used without wal_log_hints and data_checksums - Mailing list pgsql-hackers

From Neil Chen
Subject Re: Can we change pg_rewind used without wal_log_hints and data_checksums
Date
Msg-id CAA3qoJmvMRPRrdjyKi5sEjb4uX6ONjvDLvRLhKRye8rogacAZw@mail.gmail.com
Whole thread Raw
In response to Re: Can we change pg_rewind used without wal_log_hints and data_checksums  (Movead <lchch1990@sina.cn>)
List pgsql-hackers
Hi Movead,

It's an interesting idea. 

While it’s impossible to predict exactly how much WAL we’ll need to backtrack through --
I assume it mainly depends on the duration of long-running transactions -- this approach 
seems to offer an opportunity using pg_rewind without enabling wal_log_hints.

On Fri, Jan 16, 2026 at 9:28 PM Movead <lchch1990@sina.cn> wrote:

In fact the min_commited_xid and max_commited_xid is the edge transaction commited after
diverge record, so it's enough.

 
Given the potential large gap between transaction IDs (especially when long-running transactions are involved), 
maintaining  a list/bitmap struct would be worthwhile.

A minor suggestion, for an operation that may fail, I suggest retrieving the first XLOG_RUNNING_XACTS record to obtain its base_xid 
before doing the deep-dig process. If the task cannot be completed (i.e., the base_xid <= min_commited_xid condition isn’t met), 
we can throw an error immediately instead of waiting for all WAL records to be parsed.

pgsql-hackers by date:

Previous
From: Movead
Date:
Subject: Re: Can we change pg_rewind used without wal_log_hints and data_checksums
Next
From: David Geier
Date:
Subject: Re: Hackorum - a new mailing list frontend