Re: BUG #17143: when the CPU is different, the index on the primary is ok but the index on the standby is damaged - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #17143: when the CPU is different, the index on the primary is ok but the index on the standby is damaged
Date
Msg-id CAKFQuwZAVi6Q2McXC0OHk4-cVhRsCHXsUh0t+3_3U-HfrO3jSQ@mail.gmail.com
Whole thread Raw
In response to BUG #17143: when the CPU is different, the index on the primary is ok but the index on the standby is damaged  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Fri, Aug 13, 2021 at 7:56 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      17143
Logged by:          lcj
Email address:      lcj122@163.com
PostgreSQL version: 11.5
Operating system:   liunx
Description:       

Hello, I have encountered a problem in building a primary and standby
cluster using physical streaming replication on different CPU machines.
We created the primary on the x86 machine, and created the standby on the
arm machine. Now using amcheck to check the index, we find that the same
index is no problem on the primary, but the standby is indeed damaged.
The error reported on the standby machine is as follows:
ERROR:  item order invariant violated for index "xxxx"
DETAIL:  Lower index tid=(965,50) (points to heap tid=(13502,8)) higher
index tid=(965,51) (points to heap tid=(40017,19)) page lsn=392/59A2C8.

Does anyone know the reason? thanks.


I cannot explain the technical reason for this well but physical replication is not supported, and not generally expected to work, when the primary and secondary are not essentially the same.  A different cpu architecture is decidedly a material difference.  In particular, this property falls into "hardware architecture" (it is in fact the property around which "architecture" is defined) which is specifically called out in the docs:


"""
Hardware need not be exactly the same, but experience shows that maintaining two identical systems is easier than maintaining two dissimilar ones over the lifetime of the application and system. In any case the hardware architecture must be the same — shipping from, say, a 32-bit to a 64-bit system will not work.
"""

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17143: when the CPU is different, the index on the primary is ok but the index on the standby is damaged
Next
From: Tom Lane
Date:
Subject: Re: BUG #17143: when the CPU is different, the index on the primary is ok but the index on the standby is damaged