Medium: pgsql: support replication (3 node or higher)
- In sync mode
- When master is broken, the RA promotes the node whose status is STREAMING|SYNC.
- If the slave's data is newer than new master's one, the resource will be failed on pre-promote.
- In async mode
- When master is broken, the RA doesn't promote any node immediately.
- Compare all node's data and promote the node which has the newest data.