Re: Patch: Implement failover on libpq connect level.
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Mithun Cy <mithun.cy@enterprisedb.com>
Cc: Peter van Hardenberg <pvh@pvh.ca>, Peter Eisentraut <peter_e@gmx.net>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2016-10-27T17:45:57Z
Lists: pgsql-hackers
Attachments
- multihost-v2.patch (application/x-download) patch v2
On Thu, Oct 27, 2016 at 9:46 AM, Mithun Cy <mithun.cy@enterprisedb.com> wrote: > On Wed, Oct 26, 2016 at 8:49 PM, Robert Haas <robertmhaas@gmail.com> wrote: >> Let me know your thoughts. > > One small issue. I tried to run make installcheck after applying patch there > seems to be a invalid write access in code (resulting in crash). > > ==118997== Invalid write of size 1 > ==118997== at 0x4E3DDF1: connectOptions2 (fe-connect.c:884) > ==118997== by 0x4E3D6FF: PQconnectStartParams (fe-connect.c:608) > ==118997== by 0x4E3D553: PQconnectdbParams (fe-connect.c:465) > ==118997== by 0x413067: main (startup.c:245) > ==118997== Address 0x5dc4014 is 0 bytes after a block of size 4 alloc'd > ==118997== at 0x4C29BFD: malloc (in > /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) > ==118997== by 0x4E3DD3C: connectOptions2 (fe-connect.c:880) > ==118997== by 0x4E3D6FF: PQconnectStartParams (fe-connect.c:608) > ==118997== by 0x4E3D553: PQconnectdbParams (fe-connect.c:465) > ==118997== by 0x413067: main (startup.c:245) > > After locally fixing this by allocating an extra space for string terminal > character. make installcheck tests pass. > -(char *) malloc(sizeof(char) * (e - s)); > + (char *) malloc(sizeof(char) * (e - s + 1)); Thanks. Here's a new version with a fix for that issue and also a fix for PQconnectionNeedsPassword(), which was busted in v1. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
libpq: Add target_session_attrs parameter.
- 721f7bd3cbcc 10.0 landed
-
Remove superuser checks in pgstattuple
- fd321a1dfd64 10.0 cited
-
Fix unwanted flushing of libpq's input buffer when socket EOF is seen.
- c405918858c0 9.6.0 cited