Error code for checksum failure in origin.c

From: Kasahara Tatsuhito <kasahara(dot)tatsuhito(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Error code for checksum failure in origin.c
Date: 2021-08-26 09:47:59
Message-ID: CAP0=ZVLHtYffs8SOWcFJWrBGoRzT9QQbk+_aP+E5AHLNXiOorA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-08-26 10:03:48 verify_heapam for sequences?
Previous Message Peter Smith 2021-08-26 09:38:02 Re: row filtering for logical replication