I propose to backpatch b61d161c14 [1] (Introduce vacuum errcontext to display additional information.). In the recent past, we have seen an error report similar to "ERROR: found xmin 2157740646 from before relfrozenxid 1197" from multiple EDB customers. A similar report is seen on pgsql-bugs as well [2] which I think has triggered the implementation of this feature for v13. Such reports mostly indicate database corruption rather than any postgres bug which is also indicated by the error-code (from before relfrozenxid) for this message. I think there is a good reason to back-patch this as multiple users are facing similar issues. This patch won't fix this issue but it will help us in detecting the problematic part of the heap/index and then if users wish they can delete the portion of data that appeared to be corrupted and resume the operations on that relation.
I have tried to back-patch this for v12 and attached is the result. The attached patch passes make check-world but I have yet to test it manually and also prepare the patch for other branches once we agree on this proposal. Thoughts? [1] - commit b61d161c146328ae6ba9ed937862d66e5c8b035a Author: Amit Kapila <akap...@postgresql.org> Date: Mon Mar 30 07:33:38 2020 +0530 Introduce vacuum errcontext to display additional information. The additional information displayed will be block number for error occurring while processing heap and index name for error occurring while processing the index. [2] - https://www.postgresql.org/message-id/20190807235154.erbmr4o4bo6vgnjv%40alap3.anarazel.de -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
Introduce-vacuum-errcontext-to-display-additional-in.v12.patch
Description: Binary data