pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix handling of orphaned 2PC files in the future at recovery 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix handling of orphaned 2PC files in the future at recovery @ 2024-12-29 23:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2024-12-29 23:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if a transaction ID is aborted or committed which could involve a pg_xact lookup. After this commit, these checks have been done in reverse order. Files detected as in the future do not have a state that can be checked in pg_xact, hence this caused recovery to fail abruptly should an orphaned 2PC file in the future of the transaction ID horizon exist in pg_twophase at the beginning of recovery. A test is added to check for this scenario, using an empty 2PC with a transaction ID large enough to be in the future when running the test. This test is added in 16 and older versions for now. 17 and newer versions are impacted by a second bug caused by the addition of the epoch in the 2PC file names. An equivalent test will be added in these branches in a follow-up commit, once the second set of issues reported are fixed. Author: Vitaly Davydov, Michael Paquier Discussion: https://postgr.es/m/11e597-676ab680-8d-374f23c0@145466129 Backpatch-through: 13 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8f67f994e8ea6ef13619f1ec49b151f8aebf6316 Modified Files -------------- src/backend/access/transam/twophase.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of orphaned 2PC files in the future at recovery @ 2024-12-29 23:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2024-12-29 23:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if a transaction ID is aborted or committed which could involve a pg_xact lookup. After this commit, these checks have been done in reverse order. Files detected as in the future do not have a state that can be checked in pg_xact, hence this caused recovery to fail abruptly should an orphaned 2PC file in the future of the transaction ID horizon exist in pg_twophase at the beginning of recovery. A test is added to check for this scenario, using an empty 2PC with a transaction ID large enough to be in the future when running the test. This test is added in 16 and older versions for now. 17 and newer versions are impacted by a second bug caused by the addition of the epoch in the 2PC file names. An equivalent test will be added in these branches in a follow-up commit, once the second set of issues reported are fixed. Author: Vitaly Davydov, Michael Paquier Discussion: https://postgr.es/m/11e597-676ab680-8d-374f23c0@145466129 Backpatch-through: 13 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/359f31c638eb7ccf0c049c9cd0f717a88b82681a Modified Files -------------- src/backend/access/transam/twophase.c | 16 ++++++++-------- src/test/recovery/t/009_twophase.pl | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of orphaned 2PC files in the future at recovery @ 2024-12-29 23:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2024-12-29 23:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if a transaction ID is aborted or committed which could involve a pg_xact lookup. After this commit, these checks have been done in reverse order. Files detected as in the future do not have a state that can be checked in pg_xact, hence this caused recovery to fail abruptly should an orphaned 2PC file in the future of the transaction ID horizon exist in pg_twophase at the beginning of recovery. A test is added to check for this scenario, using an empty 2PC with a transaction ID large enough to be in the future when running the test. This test is added in 16 and older versions for now. 17 and newer versions are impacted by a second bug caused by the addition of the epoch in the 2PC file names. An equivalent test will be added in these branches in a follow-up commit, once the second set of issues reported are fixed. Author: Vitaly Davydov, Michael Paquier Discussion: https://postgr.es/m/11e597-676ab680-8d-374f23c0@145466129 Backpatch-through: 13 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d9ade6f2d4cdf95097bbb927f575611b525a2646 Modified Files -------------- src/backend/access/transam/twophase.c | 16 ++++++++-------- src/test/recovery/t/009_twophase.pl | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of orphaned 2PC files in the future at recovery @ 2024-12-29 23:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2024-12-29 23:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if a transaction ID is aborted or committed which could involve a pg_xact lookup. After this commit, these checks have been done in reverse order. Files detected as in the future do not have a state that can be checked in pg_xact, hence this caused recovery to fail abruptly should an orphaned 2PC file in the future of the transaction ID horizon exist in pg_twophase at the beginning of recovery. A test is added to check for this scenario, using an empty 2PC with a transaction ID large enough to be in the future when running the test. This test is added in 16 and older versions for now. 17 and newer versions are impacted by a second bug caused by the addition of the epoch in the 2PC file names. An equivalent test will be added in these branches in a follow-up commit, once the second set of issues reported are fixed. Author: Vitaly Davydov, Michael Paquier Discussion: https://postgr.es/m/11e597-676ab680-8d-374f23c0@145466129 Backpatch-through: 13 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e3584258154fac40e16f757fadd3361688a166d2 Modified Files -------------- src/backend/access/transam/twophase.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of orphaned 2PC files in the future at recovery @ 2024-12-29 23:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2024-12-29 23:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if a transaction ID is aborted or committed which could involve a pg_xact lookup. After this commit, these checks have been done in reverse order. Files detected as in the future do not have a state that can be checked in pg_xact, hence this caused recovery to fail abruptly should an orphaned 2PC file in the future of the transaction ID horizon exist in pg_twophase at the beginning of recovery. A test is added to check for this scenario, using an empty 2PC with a transaction ID large enough to be in the future when running the test. This test is added in 16 and older versions for now. 17 and newer versions are impacted by a second bug caused by the addition of the epoch in the 2PC file names. An equivalent test will be added in these branches in a follow-up commit, once the second set of issues reported are fixed. Author: Vitaly Davydov, Michael Paquier Discussion: https://postgr.es/m/11e597-676ab680-8d-374f23c0@145466129 Backpatch-through: 13 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/58626e24a95d2709142045447fc310bd1dd65a44 Modified Files -------------- src/backend/access/transam/twophase.c | 16 ++++++++-------- src/test/recovery/t/009_twophase.pl | 25 ++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix handling of orphaned 2PC files in the future at recovery @ 2024-12-29 23:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2024-12-29 23:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if a transaction ID is aborted or committed which could involve a pg_xact lookup. After this commit, these checks have been done in reverse order. Files detected as in the future do not have a state that can be checked in pg_xact, hence this caused recovery to fail abruptly should an orphaned 2PC file in the future of the transaction ID horizon exist in pg_twophase at the beginning of recovery. A test is added to check for this scenario, using an empty 2PC with a transaction ID large enough to be in the future when running the test. This test is added in 16 and older versions for now. 17 and newer versions are impacted by a second bug caused by the addition of the epoch in the 2PC file names. An equivalent test will be added in these branches in a follow-up commit, once the second set of issues reported are fixed. Author: Vitaly Davydov, Michael Paquier Discussion: https://postgr.es/m/11e597-676ab680-8d-374f23c0@145466129 Backpatch-through: 13 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/03c46e1f26a118c279930d64b343d2dcf8684013 Modified Files -------------- src/backend/access/transam/twophase.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2024-12-29 23:07 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-12-29 23:07 pgsql: Fix handling of orphaned 2PC files in the future at recovery Michael Paquier <michael@paquier.xyz> 2024-12-29 23:07 pgsql: Fix handling of orphaned 2PC files in the future at recovery Michael Paquier <michael@paquier.xyz> 2024-12-29 23:07 pgsql: Fix handling of orphaned 2PC files in the future at recovery Michael Paquier <michael@paquier.xyz> 2024-12-29 23:07 pgsql: Fix handling of orphaned 2PC files in the future at recovery Michael Paquier <michael@paquier.xyz> 2024-12-29 23:07 pgsql: Fix handling of orphaned 2PC files in the future at recovery Michael Paquier <michael@paquier.xyz> 2024-12-29 23:07 pgsql: Fix handling of orphaned 2PC files in the future at recovery 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