Re: Offline data checksum changes can cause incorrect checksum state on standbys

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Offline data checksum changes can cause incorrect checksum state on standbys
Date: 2026-09-08 08:17:19
Message-ID: 2BB46FE3-96CD-417A-8913-1856456D0B09@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 7 Sep 2026, at 17:57, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:

>>> I'm still trying to understand all the different states and interactions between online and offline changes. It's really complicated :-(. I know it's a tall order, but is there something we could do to make it simpler?
>> If there was I'd love to try it, but across the many alteratives tried during
>> this open item there hasn't been anyhing less complicated which also solves the
>> problem. Combining a WAL logged procedure with one that can rewrite the data
>> directory without any WAL entries at all is inherently complicated.
>
> So, if you can have different state in primary and a replica, there are four combinations:
>
> 1: Primary on, replica on
> 2: Primary off, replica off
>
> These are straightforward
>
> 3: Primary on, replica off
>
> You end up in this situation, if you turn on run pg_checksums to turn on checksums in primary. You stay that you really really shouldn't stay for long in this state, but why? What's the harm?
>
> One harm is that it's confusing, but if we have to deal with it anyway, why is it so bad?

Tools like pg_rewind etc rely on the fact that nodes are equal in checksum
state. What if the replica is promoted? I'm personally unconvinced that there
is a good usecase for per-node settings, but I've spent X years thinking about
checksums being replicated so I am clearly biased.

Considering how complicated it was to get replicated states right, if we want
to make it per-node I think we need to go back to the drawing board and
re-think properly rather than settle for that it seems to work. (Not that I
think that's what you're advocating, I just expect getting it work will be
complicated.)

> 4: Primary off, replica on
>
> Is this possible? Does it make sense?

This is possible using pg_checksums, but like the inverse case I don't think it
makes sense to use different settings across replication.

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jinqing Kuang 2026-09-08 08:17:25 Re: [Patch] Implement TODOs for index operator strategy number validation
Previous Message Amit Langote 2026-09-08 08:01:29 Re: Revert RI fast-path batching from REL_19_STABLE