pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. @ 2022-11-14 05:23 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Amit Kapila @ 2022-11-14 05:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acquire the pin on the same page before acquiring a lock on it, and then the replay will lead to an error. So instead, directly acquire the cleanup lock on the new bucket page during XLOG_HASH_SPLIT_ALLOCATE_PAGE replay operation. Reported-by: Andres Freund Author: Robert Haas Reviewed-By: Amit Kapila, Andres Freund, Vignesh C Backpatch-through: 11 Discussion: https://postgr.es/m/20220810022617.fvjkjiauaykwrbse@awork3.anarazel.de Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e848be60b5cf9a883765ea8e98c411e7fef0c1c6 Modified Files -------------- src/backend/access/hash/hash_xlog.c | 5 ++--- src/backend/access/hash/hashpage.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. @ 2022-11-14 05:23 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Amit Kapila @ 2022-11-14 05:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acquire the pin on the same page before acquiring a lock on it, and then the replay will lead to an error. So instead, directly acquire the cleanup lock on the new bucket page during XLOG_HASH_SPLIT_ALLOCATE_PAGE replay operation. Reported-by: Andres Freund Author: Robert Haas Reviewed-By: Amit Kapila, Andres Freund, Vignesh C Backpatch-through: 11 Discussion: https://postgr.es/m/20220810022617.fvjkjiauaykwrbse@awork3.anarazel.de Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e49e191815b6a7fc801e03cf798fb83d3b7f2501 Modified Files -------------- src/backend/access/hash/hash_xlog.c | 5 ++--- src/backend/access/hash/hashpage.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. @ 2022-11-14 05:23 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Amit Kapila @ 2022-11-14 05:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acquire the pin on the same page before acquiring a lock on it, and then the replay will lead to an error. So instead, directly acquire the cleanup lock on the new bucket page during XLOG_HASH_SPLIT_ALLOCATE_PAGE replay operation. Reported-by: Andres Freund Author: Robert Haas Reviewed-By: Amit Kapila, Andres Freund, Vignesh C Backpatch-through: 11 Discussion: https://postgr.es/m/20220810022617.fvjkjiauaykwrbse@awork3.anarazel.de Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9693f190076ec04fd06d63ab00ba4d0383515b7c Modified Files -------------- src/backend/access/hash/hash_xlog.c | 5 ++--- src/backend/access/hash/hashpage.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. @ 2022-11-14 05:23 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Amit Kapila @ 2022-11-14 05:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acquire the pin on the same page before acquiring a lock on it, and then the replay will lead to an error. So instead, directly acquire the cleanup lock on the new bucket page during XLOG_HASH_SPLIT_ALLOCATE_PAGE replay operation. Reported-by: Andres Freund Author: Robert Haas Reviewed-By: Amit Kapila, Andres Freund, Vignesh C Backpatch-through: 11 Discussion: https://postgr.es/m/20220810022617.fvjkjiauaykwrbse@awork3.anarazel.de Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/20c22333630111718bc97ce9a19b392f23e3c525 Modified Files -------------- src/backend/access/hash/hash_xlog.c | 5 ++--- src/backend/access/hash/hashpage.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. @ 2022-11-14 05:23 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Amit Kapila @ 2022-11-14 05:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acquire the pin on the same page before acquiring a lock on it, and then the replay will lead to an error. So instead, directly acquire the cleanup lock on the new bucket page during XLOG_HASH_SPLIT_ALLOCATE_PAGE replay operation. Reported-by: Andres Freund Author: Robert Haas Reviewed-By: Amit Kapila, Andres Freund, Vignesh C Backpatch-through: 11 Discussion: https://postgr.es/m/20220810022617.fvjkjiauaykwrbse@awork3.anarazel.de Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4dccccb37e0b87bc3f941ea2c7f0b9e51661bc79 Modified Files -------------- src/backend/access/hash/hash_xlog.c | 5 ++--- src/backend/access/hash/hashpage.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. @ 2022-11-14 05:23 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Amit Kapila @ 2022-11-14 05:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acquire the pin on the same page before acquiring a lock on it, and then the replay will lead to an error. So instead, directly acquire the cleanup lock on the new bucket page during XLOG_HASH_SPLIT_ALLOCATE_PAGE replay operation. Reported-by: Andres Freund Author: Robert Haas Reviewed-By: Amit Kapila, Andres Freund, Vignesh C Backpatch-through: 11 Discussion: https://postgr.es/m/20220810022617.fvjkjiauaykwrbse@awork3.anarazel.de Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1703033f896a7825001d8b1e17fa24613408d852 Modified Files -------------- src/backend/access/hash/hash_xlog.c | 5 ++--- src/backend/access/hash/hashpage.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2022-11-14 05:23 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-11-14 05:23 pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. Amit Kapila <akapila@postgresql.org> 2022-11-14 05:23 pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. Amit Kapila <akapila@postgresql.org> 2022-11-14 05:23 pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. Amit Kapila <akapila@postgresql.org> 2022-11-14 05:23 pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. Amit Kapila <akapila@postgresql.org> 2022-11-14 05:23 pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. Amit Kapila <akapila@postgresql.org> 2022-11-14 05:23 pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. Amit Kapila <akapila@postgresql.org>
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