libpq-failover-10vs11.diff

text/plain

Filename: libpq-failover-10vs11.diff
Type: text/plain
Part: 0
Message: Re: Patch: Implement failover on libpq connect level.
1,6d0
< commit 52270559f28ab673e14124b813b7cdfb772cd1bd
< Author: mithun <mithun@localhost.localdomain>
< Date:   Thu Oct 13 12:07:15 2016 +0530
< 
<     libpq10
< 
8c2
< index 4e34f00..fd2fa88 100644
---
> index 4e34f00..adbad75 100644
44c38
< +   There can be serveral host specifications, optionally accompanied
---
> +   There can be several host specifications, optionally accompanied
56,59c50,53
< +       the connect string. In this case these hosts would be considered
< +       alternate entries into same database and if connect to first one
< +       fails, library would try to connect second etc. This can be used
< +       for high availability cluster or for load balancing. See
---
> +       the connection string. In this case these hosts would be considered
> +       alternate entries into same database and if connection to first one
> +       fails, the second would be attemped, and so on. This can be used
> +       for high availability clusters or for load balancing. See the
63,66c57,60
< +       Network host name can be accompanied with port number, separated by
< +       colon. If so, this port number is used only when connected to
< +       this host. If there is no port number, port specified in the
< +       <xref linkend="libpq-connect-port"> parameter would be used.
---
> +       The network host name can be accompanied by a port number, separated by
> +       colon. This port number is used only when connected to
> +       this host. If there is no port number, the port specified in the
> +       <xref linkend="libpq-connect-port"> parameter would be used instead.
71c65
< @@ -943,7 +964,43 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
---
> @@ -943,7 +964,42 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
79c73
< +      Specifies how to choose host from list of alternate hosts,
---
> +      Specifies how to choose the host from the list of alternate hosts,
83,86c77,79
< +      If value of this argument is <literal>sequential</literal> (the
< +      default) library connects to the hosts in order they specified,
< +      and tries to connect second one only if connection to the first
< +      fails.
---
> +      If the value of this argument is <literal>sequential</literal> (the
> +      default) connections to the hosts will be attempted in the order in
> +      which they are specified.
89,93c82,86
< +      If value is <literal>random</literal> host to connect is randomly
< +      picked from the list. It allows to balance load between several
< +      cluster nodes. However, currently PostgreSQL doesn't support
< +      multimaster clusters. So, without use of third-party products,
< +      only read-only connections can take advantage from the
---
> +      If the value is <literal>random</literal>, the host to connect to
> +      will be randomly picked from the list. It allows load balacing between
> +      several cluster nodes. However, PostgreSQL doesn't currently support
> +      multimaster clusters. So, without the use of third-party products,
> +      only read-only connections can take advantage from
102,104c95,97
< +      If this parameter is <literal>master</literal> upon successful connection
< +      library checks if host is in recovery state, and if it is so,
< +      tries next host in the connect string. If this parameter is
---
> +      If this parameter is <literal>master</literal>, upon successful connection
> +      the host is checked to determine whether it is in a recovery state.  If it
> +      is, it then tries next host in the connection string. If this parameter is
115c108
< @@ -985,7 +1042,6 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
---
> @@ -985,7 +1041,6 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
123c116
< @@ -996,7 +1052,27 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
---
> @@ -996,7 +1051,28 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
132c125
< +     Maximum time to cyclically retry all the hosts in connect string.
---
> +     Maximum time to cyclically retry all the hosts in the connection string.
138,141c131,134
< +     take some time to promote one of standby nodes to the new master.
< +     So clients which notice that connect to the master fails, can
< +     already give up attempt to reestablish a connection when new master
< +     became available.
---
> +     take some time to promote one of the standby nodes to the new master.
> +     So clients which detect failure to connect to the master might
> +     abandon attempts to reestablish a connection before the new master
> +     becomes available.
144,145c137,139
< +     Setting this parameter to reasonable time makes library try to
< +     reconnect all the host in cyclically until new master appears.
---
> +     Setting this parameter to a value that takes into account the amount of
> +     time needed for failover to complete will ensure attempts to connect
> +     to hosts continue to be made until the new master becomes available.
152c146
< @@ -7227,6 +7303,18 @@ user=admin
---
> @@ -7227,6 +7303,19 @@ user=admin
157,159c151,154
< +  If more than one <literal>host</literal> option present in the section of service file, it
< +  is interpeted as alternate servers for failover or load-balancing. See
< +  <xref linkend="libpq-connect-host"> option in the connect string.
---
> +  If more than one <literal>host</literal> option is present in the same
> +  section of the service file, it is interpeted as alternate servers for
> +  failover or load-balancing. See  <xref linkend="libpq-connect-host">
> +  option in the connection string.
162c157
< +  For all other options first value takes precedence over later ones.
---
> +  For all other options, the first value takes precedence over later ones.
165c160
< +  Options, specified in the connect string along with service option
---
> +  Options specified in the connection string, along with the service option,