pgsql: Fix race condition at backend exit when deleting element in sync

2019-11-01 Thread Michael Paquier
Fix race condition at backend exit when deleting element in syncrep queue When a backend exits, it gets deleted from the syncrep queue if present. The queue was checked without SyncRepLock taken in exclusive mode, so it would have been possible for a backend to remove itself after a WAL sender alr

pgsql: Fix race condition at backend exit when deleting element in sync

2019-11-01 Thread Michael Paquier
Fix race condition at backend exit when deleting element in syncrep queue When a backend exits, it gets deleted from the syncrep queue if present. The queue was checked without SyncRepLock taken in exclusive mode, so it would have been possible for a backend to remove itself after a WAL sender alr

pgsql: Fix race condition at backend exit when deleting element in sync

2019-11-01 Thread Michael Paquier
Fix race condition at backend exit when deleting element in syncrep queue When a backend exits, it gets deleted from the syncrep queue if present. The queue was checked without SyncRepLock taken in exclusive mode, so it would have been possible for a backend to remove itself after a WAL sender alr

pgsql: Fix race condition at backend exit when deleting element in sync

2019-11-01 Thread Michael Paquier
Fix race condition at backend exit when deleting element in syncrep queue When a backend exits, it gets deleted from the syncrep queue if present. The queue was checked without SyncRepLock taken in exclusive mode, so it would have been possible for a backend to remove itself after a WAL sender alr

pgsql: Fix race condition at backend exit when deleting element in sync

2019-11-01 Thread Michael Paquier
Fix race condition at backend exit when deleting element in syncrep queue When a backend exits, it gets deleted from the syncrep queue if present. The queue was checked without SyncRepLock taken in exclusive mode, so it would have been possible for a backend to remove itself after a WAL sender alr

pgsql: Fix race condition at backend exit when deleting element in sync

2019-11-01 Thread Michael Paquier
Fix race condition at backend exit when deleting element in syncrep queue When a backend exits, it gets deleted from the syncrep queue if present. The queue was checked without SyncRepLock taken in exclusive mode, so it would have been possible for a backend to remove itself after a WAL sender alr

pgsql: Fix race condition at backend exit when deleting element in sync

2019-11-01 Thread Michael Paquier
Fix race condition at backend exit when deleting element in syncrep queue When a backend exits, it gets deleted from the syncrep queue if present. The queue was checked without SyncRepLock taken in exclusive mode, so it would have been possible for a backend to remove itself after a WAL sender alr