pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Add more error context to RestoreBlockImage() and consume it 2+ messages / 1 participants [nested] [flat]
* pgsql: Add more error context to RestoreBlockImage() and consume it @ 2022-09-09 01:02 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2022-09-09 01:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Add more error context to RestoreBlockImage() and consume it On failure in restoring a block image, no details were provided, while it is possible to see failure with an inconsistent record state, a failure in processing decompression or a failure in decompression because a build does not support this option. RestoreBlockImage() is used in two code paths in the backend code, during recovery and when checking a page consistency after applying masking, and both places are changed to consume the error message produced by the internal routine when it returns a false status. All the error messages are reported under ERRCODE_INTERNAL_ERROR, that gets used also when attempting to access a page compressed by a method not supported by the build attempting the decompression. This is something that can happen in core when doing physical replication with primary and standby using inconsistent build options, for example. This routine is available since 2c03216d and it has never provided any context about the error happening when it failed. This change is justified even more after 57aa5b2, that introduced compression of FPWs in WAL. Reported-by: Justin Prysby Author: Michael Paquier Discussion: https://postgr.es/m/20220905002320.GD31833@telsasoft.com Backpatch-through: 15 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0a7c9ee50062e0f48cdd89b9c0e166ff59caabc8 Modified Files -------------- src/backend/access/transam/xlogreader.c | 22 +++++++++++++++++----- src/backend/access/transam/xlogrecovery.c | 4 +++- src/backend/access/transam/xlogutils.c | 4 +++- 3 files changed, 23 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Add more error context to RestoreBlockImage() and consume it @ 2022-09-09 01:02 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2022-09-09 01:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Add more error context to RestoreBlockImage() and consume it On failure in restoring a block image, no details were provided, while it is possible to see failure with an inconsistent record state, a failure in processing decompression or a failure in decompression because a build does not support this option. RestoreBlockImage() is used in two code paths in the backend code, during recovery and when checking a page consistency after applying masking, and both places are changed to consume the error message produced by the internal routine when it returns a false status. All the error messages are reported under ERRCODE_INTERNAL_ERROR, that gets used also when attempting to access a page compressed by a method not supported by the build attempting the decompression. This is something that can happen in core when doing physical replication with primary and standby using inconsistent build options, for example. This routine is available since 2c03216d and it has never provided any context about the error happening when it failed. This change is justified even more after 57aa5b2, that introduced compression of FPWs in WAL. Reported-by: Justin Prysby Author: Michael Paquier Discussion: https://postgr.es/m/20220905002320.GD31833@telsasoft.com Backpatch-through: 15 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/df4a056619a7e9868ec43a15e2088ff8ccf94471 Modified Files -------------- src/backend/access/transam/xlogreader.c | 22 +++++++++++++++++----- src/backend/access/transam/xlogrecovery.c | 4 +++- src/backend/access/transam/xlogutils.c | 4 +++- 3 files changed, 23 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-09-09 01:02 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-09-09 01:02 pgsql: Add more error context to RestoreBlockImage() and consume it Michael Paquier <michael@paquier.xyz> 2022-09-09 01:02 pgsql: Add more error context to RestoreBlockImage() and consume it Michael Paquier <michael@paquier.xyz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox