Re: Patch: Implement failover on libpq connect level.

Поиск
Список
Период
Сортировка
От Victor Wagner
Тема Re: Patch: Implement failover on libpq connect level.
Дата
Msg-id 20160906080349.0a7dcf69@wagner.wagner.home
обсуждение исходный текст
Ответ на Re: Patch: Implement failover on libpq connect level.  (Mithun Cy <mithun.cy@enterprisedb.com>)
Список pgsql-hackers
On Tue, 6 Sep 2016 07:58:28 +0530
Mithun Cy <mithun.cy@enterprisedb.com> wrote:

> 
> Now if only one host is in connection string and it ask for read_write
> connection(connect to master) I mean read_only is set 0 explicitly.
> With above logic we will allow it to connect to standby?. I still
> think psql connection to standby should be handled by changing the
> default value of readonly to 1 (which means connect to any). 

It would definitely be more logical, but I haven't found easy way to do
it. May be I should return to this place and rethink. I don't like and
idea to explicitely ignore connection string parameter due to some
condition. 

Really, I think, test for replication connection can be either
removed from this part of code now.  


> Thinking
> further probably replacing readonly parameter with
> targetServerType=any|master (with default being any) should clear
> some confusions and bring consistency since same is used in JDBC
> multi host connection string.

It seems that in this context change readonly=0|1 to
targetServerType=any|master  makes sense.


> 2)
> @@ -1460,33 +1538,80 @@ connectDBStart(PGconn *conn)
>    portstr,
>    (int) (UNIXSOCK_PATH_BUFLEN - 1));
>   conn->options_valid = false;
> + free(nodes->port);
> 
> nodes->port was not allocated at this point.
> 

I'll recheck it.

--                                   Victor Wagner <vitus@wagner.pp.ru>



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: patch: function xmltable
Следующее
От: Abhijit Menon-Sen
Дата:
Сообщение: Re: Proposal for changes to recovery.conf API