pgsql: Clear async.c's isAdvancing flag when a notify read is aborted.

Поиск
Список
Период
Сортировка
Искать

pgsql: Clear async.c's isAdvancing flag when a notify read is aborted.

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Clear async.c's isAdvancing flag when a notify read is aborted.

asyncQueueReadAllNotifications() sets our isAdvancing flag and clears
it when done.  But if we error out in between, for example on a
cancel while waiting for a safe snapshot, the flag stays set and
SignalBackends() never advances or wakes us again, so the queue tail
stops moving.  To fix, clear the flag in AtAbort_Notify().
(We need not worry about this in subtransaction abort, since
asyncQueueReadAllNotifications() is only called in top-level
transactions.)

Author: shihao zhong 
Reviewed-by: Tom Lane 
Discussion: https://postgr.es/m/CAGRkXqQ1bmVwBw2CXiyZeWWP=XkHPXLPcQ7BSg2Q5JKSvDAnTA@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/871dee0ccbe292cf4c2874aa7b460d242262d242

Modified Files
--------------
src/backend/commands/async.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

FAQ