Error code for checksum failure in origin.c - Mailing list pgsql-hackers

From Kasahara Tatsuhito
Subject Error code for checksum failure in origin.c
Date
Msg-id CAP0=ZVLHtYffs8SOWcFJWrBGoRzT9QQbk+_aP+E5AHLNXiOorA@mail.gmail.com
Whole thread Raw
Responses Re: Error code for checksum failure in origin.c
List pgsql-hackers
Hi.

In the code in src/backend/replication/logical/origin.c,
the error code "ERRCODE_CONFIGURATION_LIMIT_EXCEEDED" is given
when a checksum check results in an error,
but "ERRCODE_ DATA_CORRUPTED" seems to be more appropriate.

====================
diff --git a/src/backend/replication/logical/origin.c
b/src/backend/replication/logical/origin.c
index 2c191de..65dcd03 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -796,7 +796,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)));
====================
Thought?

Best regards,

-- 
Tatsuhito Kasahara
kasahara.tatsuhito _at_ gmail.com



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: row filtering for logical replication
Next
From: Peter Eisentraut
Date:
Subject: verify_heapam for sequences?