Re: [EXTERNAL] Support load balancing in libpq

Поиск
Список
Период
Сортировка
Искать
От
Jelte Fennema
Тема
Re: [EXTERNAL] Support load balancing in libpq
Дата
Msg-id
CAGECzQSPkkvgihXJxwA2Xbfd-hYGOzaUmCo=KeCc2vPZzaeAkQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Support load balancing in libpq Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: Support load balancing in libpq Aleksander Alekseev <aleksander@timescale.com>
Re: Support load balancing in libpq Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: Support load balancing in libpq Michael Banck <mbanck@gmx.net>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Michael Banck <mbanck@gmx.net>
Re: [EXTERNAL] Re: Support load balancing in libpq Maxim Orlov <orlovmg@gmail.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Michael Banck <mbanck@gmx.net>
Re: Support load balancing in libpq Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: Support load balancing in libpq Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: Support load balancing in libpq Michael Banck <mbanck@gmx.net>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Jacob Champion <jchampion@timescale.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Re: Support load balancing in libpq Jacob Champion <jchampion@timescale.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Jacob Champion <jchampion@timescale.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Re: Support load balancing in libpq Greg S <stark.cfm@gmail.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Re: Support load balancing in libpq Andrey Borodin <amborodin86@gmail.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Re: Support load balancing in libpq "Gregory Stark (as CFM)" <stark.cfm@gmail.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Support load balancing in libpq Daniel Gustafsson <daniel@yesql.se>
Re: [EXTERNAL] Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Support load balancing in libpq Daniel Gustafsson <daniel@yesql.se>
Re: [EXTERNAL] Support load balancing in libpq Tatsuo Ishii <ishii@sraoss.co.jp>
Re: [EXTERNAL] Support load balancing in libpq Daniel Gustafsson <daniel@yesql.se>
Re: [EXTERNAL] Support load balancing in libpq Tatsuo Ishii <ishii@sraoss.co.jp>
Re: [EXTERNAL] Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Support load balancing in libpq Tatsuo Ishii <ishii@sraoss.co.jp>
Re: [EXTERNAL] Support load balancing in libpq Daniel Gustafsson <daniel@yesql.se>
RE: [EXTERNAL] Support load balancing in libpq "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: [EXTERNAL] Support load balancing in libpq Daniel Gustafsson <daniel@yesql.se>
Re: [EXTERNAL] Support load balancing in libpq Julien Rouhaud <rjuju123@gmail.com>
Re: [EXTERNAL] Support load balancing in libpq Daniel Gustafsson <daniel@yesql.se>
Re: [EXTERNAL] Support load balancing in libpq Daniel Gustafsson <daniel@yesql.se>
Re: [EXTERNAL] Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Support load balancing in libpq Daniel Gustafsson <daniel@yesql.se>
Re: [EXTERNAL] Support load balancing in libpq Aleksander Alekseev <aleksander@timescale.com>
Re: [EXTERNAL] Support load balancing in libpq Aleksander Alekseev <aleksander@timescale.com>
Re: [EXTERNAL] Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: [EXTERNAL] Support load balancing in libpq Aleksander Alekseev <aleksander@timescale.com>
Re: [EXTERNAL] Support load balancing in libpq Aleksander Alekseev <aleksander@timescale.com>
Re: [EXTERNAL] Support load balancing in libpq Jelte Fennema <postgres@jeltef.nl>
Re: Support load balancing in libpq Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: [EXTERNAL] Re: Support load balancing in libpq Jelte Fennema <Jelte.Fennema@microsoft.com>
RE: Support load balancing in libpq "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
Re: Support load balancing in libpq Jelte Fennema <Jelte.Fennema@microsoft.com>
RE: Support load balancing in libpq "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
Looks good overall. I attached a new version with a few small changes:

>   * Changed store_conn_addrinfo to return int like how all the functions
>     dealing with addrinfo does.  Also moved the error reporting to inside there
>     where the error happened.

I don't feel strong about the int vs bool return type. The existing
static libpq functions are a bit of a mixed bag around this, so either
way seems fine to me. And moving the log inside the function seems
fine too. But it seems you accidentally removed the "goto
error_return" part as well, so now we're completely ignoring the
allocation failure. The attached patch fixes that.

>+ok($node1_occurences > 1, "expected at least one execution on node1, found none");
>+ok($node2_occurences > 1, "expected at least one execution on node2, found none");
>+ok($node3_occurences > 1, "expected at least one execution on node3, found none");

I changed the message to be a description of the expected case,
instead of the failure case. This is in line with the way these
messages are used in other tests, and indeed seems like the correct
way because you get output from "meson test -v postgresql:libpq /
libpq/003_load_balance_host_list" like this:
▶ 6/6 - received at least one connection on node1       OK
▶ 6/6 - received at least one connection on node2       OK
▶ 6/6 - received at least one connection on node3       OK
▶ 6/6 - received 50 connections across all nodes        OK

Finally, I changed a few small typos in your updated commit message
(some of which originated from my earlier commit messages)
В списке pgsql-hackers по дате отправления
От: Alexander Korotkov
Дата:
От: Daniel Gustafsson
Дата:
FAQ