Fix incorrect error code in StartupReplicationOrigin().
authorAmit Kapila <[email protected]>
Mon, 30 Aug 2021 04:30:03 +0000 (10:00 +0530)
committerAmit Kapila <[email protected]>
Mon, 30 Aug 2021 04:30:03 +0000 (10:00 +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 ffe14886cd89904c3bf1d21e65f32b8b6525d625..725ad9126a8108051194300989f62f6f4048b335 100644 (file)
@@ -787,7 +787,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)));