Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for host failover with PostgreSQL
Since version 10, PostgreSQL allows to specify serveral hosts in the connnection string, and can, if the connection option target_session_atts=read-write is added, automatically choose the primary (writable) node in a cluster. If the primary changes (due to a failover or switchover), the client connection will be retried for the next host until a writable primary is found again. To leverage this, add the "dbfailover" option to dboptions. If it is set, add "target_session_attr=read-write" to the connection string. This, in conjunction with specifying several hosts in $CFG->dbhost config variable makes it possible to point Moodle at a high-available PostgreSQL cluster and let it follow failovers automatically.
- Loading branch information