pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix postmaster's handling of fork failure for a bgworker process 4+ messages / 1 participants [nested] [flat]
* pgsql: Fix postmaster's handling of fork failure for a bgworker process @ 2017-04-24 16:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2017-04-24 16:17 UTC (permalink / raw) To: pgsql-committers Fix postmaster's handling of fork failure for a bgworker process. This corner case didn't behave nicely at all: the postmaster would (partially) update its state as though the process had started successfully, and be quite confused thereafter. Fix it to act like the worker had crashed, instead. In passing, refactor so that do_start_bgworker contains all the state-change logic for bgworker launch, rather than just some of it. Back-patch as far as 9.4. 9.3 contains similar logic, but it's just enough different that I don't feel comfortable applying the patch without more study; and the use of bgworkers in 9.3 was so small that it doesn't seem worth the extra work. transam/parallel.c is still entirely unprepared for the possibility of bgworker startup failure, but that seems like material for a separate patch. Discussion: https://postgr.es/m/4905.1492813727@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4fe04244b584749351657e99f3e6e1436e9b65a8 Modified Files -------------- src/backend/postmaster/postmaster.c | 110 +++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 33 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix postmaster's handling of fork failure for a bgworker process @ 2017-04-24 16:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2017-04-24 16:17 UTC (permalink / raw) To: pgsql-committers Fix postmaster's handling of fork failure for a bgworker process. This corner case didn't behave nicely at all: the postmaster would (partially) update its state as though the process had started successfully, and be quite confused thereafter. Fix it to act like the worker had crashed, instead. In passing, refactor so that do_start_bgworker contains all the state-change logic for bgworker launch, rather than just some of it. Back-patch as far as 9.4. 9.3 contains similar logic, but it's just enough different that I don't feel comfortable applying the patch without more study; and the use of bgworkers in 9.3 was so small that it doesn't seem worth the extra work. transam/parallel.c is still entirely unprepared for the possibility of bgworker startup failure, but that seems like material for a separate patch. Discussion: https://postgr.es/m/4905.1492813727@sss.pgh.pa.us Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/63f64d2824b290a75a82ac60c5b62a971b7c7a4e Modified Files -------------- src/backend/postmaster/postmaster.c | 108 +++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 31 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix postmaster's handling of fork failure for a bgworker process @ 2017-04-24 16:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2017-04-24 16:17 UTC (permalink / raw) To: pgsql-committers Fix postmaster's handling of fork failure for a bgworker process. This corner case didn't behave nicely at all: the postmaster would (partially) update its state as though the process had started successfully, and be quite confused thereafter. Fix it to act like the worker had crashed, instead. In passing, refactor so that do_start_bgworker contains all the state-change logic for bgworker launch, rather than just some of it. Back-patch as far as 9.4. 9.3 contains similar logic, but it's just enough different that I don't feel comfortable applying the patch without more study; and the use of bgworkers in 9.3 was so small that it doesn't seem worth the extra work. transam/parallel.c is still entirely unprepared for the possibility of bgworker startup failure, but that seems like material for a separate patch. Discussion: https://postgr.es/m/4905.1492813727@sss.pgh.pa.us Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/dba1f310a564e8dc3496cd5ddec14ab6645ffd15 Modified Files -------------- src/backend/postmaster/postmaster.c | 108 +++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 31 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix postmaster's handling of fork failure for a bgworker process @ 2017-04-24 16:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2017-04-24 16:17 UTC (permalink / raw) To: pgsql-committers Fix postmaster's handling of fork failure for a bgworker process. This corner case didn't behave nicely at all: the postmaster would (partially) update its state as though the process had started successfully, and be quite confused thereafter. Fix it to act like the worker had crashed, instead. In passing, refactor so that do_start_bgworker contains all the state-change logic for bgworker launch, rather than just some of it. Back-patch as far as 9.4. 9.3 contains similar logic, but it's just enough different that I don't feel comfortable applying the patch without more study; and the use of bgworkers in 9.3 was so small that it doesn't seem worth the extra work. transam/parallel.c is still entirely unprepared for the possibility of bgworker startup failure, but that seems like material for a separate patch. Discussion: https://postgr.es/m/4905.1492813727@sss.pgh.pa.us Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/436b560b86ca688ebbebf28f0709ab45eadfa3ce Modified Files -------------- src/backend/postmaster/postmaster.c | 127 ++++++++++++++++++++++++------------ 1 file changed, 87 insertions(+), 40 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2017-04-24 16:17 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-04-24 16:17 pgsql: Fix postmaster's handling of fork failure for a bgworker process Tom Lane <tgl@sss.pgh.pa.us> 2017-04-24 16:17 pgsql: Fix postmaster's handling of fork failure for a bgworker process Tom Lane <tgl@sss.pgh.pa.us> 2017-04-24 16:17 pgsql: Fix postmaster's handling of fork failure for a bgworker process Tom Lane <tgl@sss.pgh.pa.us> 2017-04-24 16:17 pgsql: Fix postmaster's handling of fork failure for a bgworker process Tom Lane <tgl@sss.pgh.pa.us>
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