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

From Movead
Subject Re: Can we change pg_rewind used without wal_log_hints and data_checksums
Date
Msg-id 2026011608042232790861@sina.cn
Whole thread Raw
In response to Can we change pg_rewind used without wal_log_hints and data_checksums  (lchch1990@sina.cn)
List pgsql-hackers
On Thu, 2026-01-16 at 03:08 +0800, laurenz.albe@cybertec.at wrote:
>I had a brief look at the patch, and the gratuitous use of static variables didn't
>appeal to me. 
Sorry about that, and I can find a nice way if the design is good.

>Can you briefly describe the algorithm?
I think the algorithm is introduced in the patch mail, let me do a summary

During a forward WAL walk, the system collects the minimal commit transaction
ID. If it find when this transaction ID assigned, a safety rewind can be performed.


>You look at all commit records *after* the fork, right? 
It's all record after for fork, not only commited. I do not change the code logic.
Maybe commit record is enougn.

On the other hand, my patch collect all record *before* the fork, maybe
it will cause many meaningless copy and I can fix that.

>Then how can you identify how far back you have rewind? 
It's the point that we can known the stop point only by walk wal. So it maybe
take long time, and it's the reason I add a '-d, --deep-dig' option.

>How can you identify when a transaction started?
We find it by XLOG_RUNNING_XACTS wal record, this wal record  have a *nextXid*
which mean a unassigned transaction id when produce the wal record.

 



----
Best Regards,
Movead Li




 



pgsql-hackers by date:

Previous
From: Henson Choi
Date:
Subject: Re: Row pattern recognition
Next
From: Chao Li
Date:
Subject: Re: [PATCH] Fix incorrect parser comment