Re: Physical replication from x86_64 to ARM64

From: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, Jan Mußler <jan(dot)mussler(at)zalando(dot)de>
Subject: Re: Physical replication from x86_64 to ARM64
Date: 2021-09-15 09:40:32
Message-ID: 20210915094032.usnhf5qzvsd5oni7@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Tue, Sep 14, 2021 at 08:07:19AM -0700, Andres Freund wrote:
>
> >Yeah. As far as the hardware goes, if you have the same endianness,
> >struct alignment rules, and floating-point format [1], then physical
> >replication ought to work. Where things get far stickier is if the
> >operating systems aren't identical, because then you have very great
> >risk of text sorting rules not being the same, leading to index
> >corruption [2]. In modern practice that tends to be a bigger issue
> >than the hardware, and we don't have any goo d way to check for it.
>
> I'd also be worried about subtle changes in floating point math results, and that subsequently leading to index mismatches. Be that because the hardware gives differing results, or because libc differences.

The question about hardware side I find interesting, as at least in
Armv-8 case there are claims to be fully IEEE 754 compliant [1]. From
what I see some parts, which are not specified in this standard, are
also implemented similarly on Arm and x86 ([2], [3]). On top of that
many compilers implement at least partial level of IEEE 754 compliance
(e.g. for gcc [4]) by default. The only strange difference I found is
x87 FPU unit (without no SEE2, see [5]), but I'm not sure what could be
consequences of extra precision here. All in all sounds like at least
from the hardware perspective in case of Arm chances for having subtle
differences in floating point math are small -- do I miss anything?

[1]: https://developer.arm.com/architectures/instruction-sets/floating-point
[2]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format#Single-precision_examples
[3]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
[4]: https://gcc.gnu.org/wiki/FloatingPointMath
[5]: https://gcc.gnu.org/wiki/x87note

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-09-15 09:53:50 Re: Remove double check when field_name is not NULL in be-secure-openssl.c
Previous Message Fujii Masao 2021-09-15 09:05:59 Re: Allow escape in application_name