pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid spurious failures in the login event trigger recovery test 4+ messages / 1 participants [nested] [flat]
* pgsql: Avoid spurious failures in the login event trigger recovery test @ 2026-10-16 15:20 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Fujii Masao @ 2026-10-16 15:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid spurious failures in the login event trigger recovery test Buildfarm member skink reported failures in 053_standby_login_event_trigger.pl. The checks that dathasloginevt was cleared on the primary and that the cleared flag reached the standby both found the flag still set. The test assumed that the first login after dropping the trigger would clear the flag. However, EventTriggerOnLogin() acquires the database lock conditionally to avoid delaying connections for this cleanup. Concurrent connection startup, including that of an autovacuum worker, can hold a conflicting lock and cause the cleanup to be skipped. The standby correctly retained the flag because it had not been cleared on the primary. Fix this by using poll_query_until() to retry with fresh connections to the test database until the flag is cleared, giving the login cleanup repeated opportunities to acquire the lock. Backpatch to v17, like commit bec61f59354, which added this test. Reported-by: Alexander Lakhin <exclusion@gmail.com> Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/09561429-50c1-4d06-a262-300c7a845175@gmail.com Backpatch-through: 17 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/80cf51123601318a7d80a4eec7be568e22462a4c Modified Files -------------- .../recovery/t/053_standby_login_event_trigger.pl | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Avoid spurious failures in the login event trigger recovery test @ 2026-10-16 15:20 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Fujii Masao @ 2026-10-16 15:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid spurious failures in the login event trigger recovery test Buildfarm member skink reported failures in 053_standby_login_event_trigger.pl. The checks that dathasloginevt was cleared on the primary and that the cleared flag reached the standby both found the flag still set. The test assumed that the first login after dropping the trigger would clear the flag. However, EventTriggerOnLogin() acquires the database lock conditionally to avoid delaying connections for this cleanup. Concurrent connection startup, including that of an autovacuum worker, can hold a conflicting lock and cause the cleanup to be skipped. The standby correctly retained the flag because it had not been cleared on the primary. Fix this by using poll_query_until() to retry with fresh connections to the test database until the flag is cleared, giving the login cleanup repeated opportunities to acquire the lock. Backpatch to v17, like commit bec61f59354, which added this test. Reported-by: Alexander Lakhin <exclusion@gmail.com> Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/09561429-50c1-4d06-a262-300c7a845175@gmail.com Backpatch-through: 17 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c705304a0f43d314239ffe62fe0f3a64443c19b0 Modified Files -------------- .../recovery/t/053_standby_login_event_trigger.pl | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Avoid spurious failures in the login event trigger recovery test @ 2026-10-16 15:20 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Fujii Masao @ 2026-10-16 15:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid spurious failures in the login event trigger recovery test Buildfarm member skink reported failures in 053_standby_login_event_trigger.pl. The checks that dathasloginevt was cleared on the primary and that the cleared flag reached the standby both found the flag still set. The test assumed that the first login after dropping the trigger would clear the flag. However, EventTriggerOnLogin() acquires the database lock conditionally to avoid delaying connections for this cleanup. Concurrent connection startup, including that of an autovacuum worker, can hold a conflicting lock and cause the cleanup to be skipped. The standby correctly retained the flag because it had not been cleared on the primary. Fix this by using poll_query_until() to retry with fresh connections to the test database until the flag is cleared, giving the login cleanup repeated opportunities to acquire the lock. Backpatch to v17, like commit bec61f59354, which added this test. Reported-by: Alexander Lakhin <exclusion@gmail.com> Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/09561429-50c1-4d06-a262-300c7a845175@gmail.com Backpatch-through: 17 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/92d47d544bf64274b6a7aa8775f7b35bcf71f339 Modified Files -------------- .../recovery/t/053_standby_login_event_trigger.pl | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Avoid spurious failures in the login event trigger recovery test @ 2026-10-16 15:20 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Fujii Masao @ 2026-10-16 15:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid spurious failures in the login event trigger recovery test Buildfarm member skink reported failures in 053_standby_login_event_trigger.pl. The checks that dathasloginevt was cleared on the primary and that the cleared flag reached the standby both found the flag still set. The test assumed that the first login after dropping the trigger would clear the flag. However, EventTriggerOnLogin() acquires the database lock conditionally to avoid delaying connections for this cleanup. Concurrent connection startup, including that of an autovacuum worker, can hold a conflicting lock and cause the cleanup to be skipped. The standby correctly retained the flag because it had not been cleared on the primary. Fix this by using poll_query_until() to retry with fresh connections to the test database until the flag is cleared, giving the login cleanup repeated opportunities to acquire the lock. Backpatch to v17, like commit bec61f59354, which added this test. Reported-by: Alexander Lakhin <exclusion@gmail.com> Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/09561429-50c1-4d06-a262-300c7a845175@gmail.com Backpatch-through: 17 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e4cc408acd2d5ef56d717930b0873eedb4c9ba2e Modified Files -------------- .../recovery/t/053_standby_login_event_trigger.pl | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2026-10-16 15:20 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-16 15:20 pgsql: Avoid spurious failures in the login event trigger recovery test Fujii Masao <fujii@postgresql.org> 2026-10-16 15:20 pgsql: Avoid spurious failures in the login event trigger recovery test Fujii Masao <fujii@postgresql.org> 2026-10-16 15:20 pgsql: Avoid spurious failures in the login event trigger recovery test Fujii Masao <fujii@postgresql.org> 2026-10-16 15:20 pgsql: Avoid spurious failures in the login event trigger recovery test Fujii Masao <fujii@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