Fix race condition when changing synchronous_standby_names

Simon Riggs <simon@2ndQuadrant.com>

Commit: 48c9f4926562278a2fd2b85e7486c6d11705f177
Author: Simon Riggs <simon@2ndQuadrant.com>
Date: 2017-12-29T14:30:33Z
Releases: 11.0
Fix race condition when changing synchronous_standby_names

A momentary window exists when synchronous_standby_names
changes that allows commands issued after the change to
continue to act as async until the change becomes visible.
Remove the race by using more appropriate test in syncrep.c

Author: Asim Rama Praveen and Ashwin Agrawal
Reported-by: Xin Zhang, Ashwin Agrawal, and Asim Rama Praveen
Reviewed-by: Michael Paquier, Masahiko Sawada

Files

PathChange+/−
src/backend/replication/syncrep.c modified +2 −4