]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix incorrect error code in StartupReplicationOrigin().
authorAmit Kapila <akapila@postgresql.org>
Mon, 30 Aug 2021 04:18:56 +0000 (09:48 +0530)
committerAmit Kapila <akapila@postgresql.org>
Mon, 30 Aug 2021 04:18:56 +0000 (09:48 +0530)
ERRCODE_CONFIGURATION_LIMIT_EXCEEDED was used for checksum failure, use
ERRCODE_DATA_CORRUPTED instead.

Reported-by: Tatsuhito Kasahara
Author: Tatsuhito Kasahara
Backpatch-through: 9.6, where it was introduced
Discussion: https://postgr.es/m/CAP0=ZVLHtYffs8SOWcFJWrBGoRzT9QQbk+_aP+E5AHLNXiOorA@mail.gmail.com

src/backend/replication/logical/origin.c

index a5fc30764cc3bb250fdfc411b48c22d400118b7e..2e4676d6e1eaeebcf9655bd4dbacfb9b2bb383a1 100644 (file)
@@ -786,7 +786,7 @@ StartupReplicationOrigin(void)
        FIN_CRC32C(crc);
        if (file_crc != crc)
                ereport(PANIC,
-                               (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+                               (errcode(ERRCODE_DATA_CORRUPTED),
                                 errmsg("replication slot checkpoint has wrong checksum %u, expected %u",
                                                crc, file_crc)));