hi hackers,
I am thinking about why pg_rewind need wal_log_hints or data_checksums which significantly
limits its usability. I research somewhere can can only find it's for against data
corruption in code comment.
And i come up a case which may need depend on the page consistence after do pg_rewind:
1. We have primary A and standby B.
2. We have a transaction xact1 currently and xact1 modify some pages.
3. Do a checkpoint on A
4. standby B promote
5. xact1 committed on and do a query on all data modified by xact1
6. do pg_rewind on A
If on no page consistence mode, and hack pg_rewind code to force a rewind, then we
may see xact1 on A and can not see xact1 on B. And it's cause unconsistence.
Now I tell myself ,pg_rewind may can not handle this case so we must set wal_log_hints
on to avoid the case. If so we can modify pg_rewind to met this case. If not so, I want
to known the reason or some mail thread discuss that? Thanks.
Here i want to introduce a way to solve the case above:
We need record all transaction ID commited after diverge record and research more wal
before diverge record, we need to find a start lsn(lsn_s) which older than all the
transactions. And we should read from lsn_s to diverge lsn to collect influenced pages
by the transactions. So we can copy them at the rewind phase.
Best Regards,
Movead Li