[COMMITTERS] pgsql: Fix, or at least ameliorate,bugs in logicalrep_worker_launch().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Fix, or at least ameliorate,bugs in logicalrep_worker_launch().
Дата
Msg-id E1dty9Y-00022S-K3@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix, or at least ameliorate, bugs in logicalrep_worker_launch().

If we failed to get a background worker slot, the code just walked
away from the logicalrep-worker slot it already had, leaving that
looking like the worker is still starting up.  This led to an indefinite
hang in subscription startup, as reported by Thomas Munro.  We must
release the slot on failure.

Also fix a thinko: we must capture the worker slot's generation before
releasing LogicalRepWorkerLock the first time, else testing to see if
it's changed is pretty meaningless.

BTW, the CHECK_FOR_INTERRUPTS() in WaitForReplicationWorkerAttach is a
ticking time bomb, even without considering the possibility of elog(ERROR)
in one of the other functions it calls.  Really, this entire business needs
a redesign with some actual thought about error recovery.  But for now
I'm just band-aiding the case observed in testing.

Back-patch to v10 where this code was added.

Discussion: https://postgr.es/m/CAEepm=2bP3TBMFBArP6o20AZaRduWjMnjCjt22hSdnA-EvrtCw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3e1683d37e1d751eb2df9a5cb0507bebc6cf7d05

Modified Files
--------------
src/backend/replication/logical/launcher.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)


--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: [COMMITTERS] pgsql: Update some dead external links in the documentation
Следующее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names moreco