Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vyG2q-00HZPw-3B for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2026 21:15:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vyG2p-001RTI-0h for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2026 21:15:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vyG2o-001RTA-2o for pgsql-hackers@lists.postgresql.org; Thu, 05 Mar 2026 21:15:43 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vyG2n-000000014g8-04pn for pgsql-hackers@postgresql.org; Thu, 05 Mar 2026 21:15:43 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7d4beaf25deso7609449a34.0 for ; Thu, 05 Mar 2026 13:15:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772745339; cv=none; d=google.com; s=arc-20240605; b=ezuzaXtrID+aJhGYi7MJb1ykdbvg7ylEeOk8HK1jAyHiDAj6vnGUu/ybEj35O2vbok O5wZHhARXyYPbA/81j1Gd5nxX5gI3qd5egoaSVHOH/uLltgdsbyMj6AHmO1iZfrcrnnZ egabQu8XECS9fN0T27ugsxWxKjUgh8ET9MeE42hIY/8CaC8I+XkxXd91lMOm149t4o0y syBvN+nO8ZgdqTeTK2cenEykyCQW+RhItsxGcAyGJ/YRsUEF4wooxNa6EM1gGn42kd0n g1QhT0uY+C4g0JPJ2IN9F5whPXIJHhbob5lsuxcGMboFpuuUm2l0e06ufXU2mq6qLLuH 0UwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=2Tubov/GWZo4VtZImd1S6gdF6tWvhLTK8xpLCCHiiic=; fh=0yUucsw6WDj7o7GrsMBL8XSndT2Ya8FBH+Gs4Mw9ukI=; b=jy7Qu0MnA2oew17O+KksPu/Wr3txukAdZJMvNsaC4maCrXU1TfwpXeYfUNskKltG38 Mb6ji9R1kJXICyTlOJq8oeodLG5eeH/bWOvwtQzp5QtBFmUtl2RpVsvjxTVK4khvIbBA jbQkMFU17jpRxD7mr+RqxUFLeEWWvUQcoSYznFesIHbjPNKL9t3MSuMxlH3Vvsx2LVDQ wudz12svQaBEo8Ec43113E5RBo7vvi5agptej9iX0kmzWXfYWGaPVm0rdppwnQy6cVDD 9HwJzd6U+aP7mokcvuIeVqpLNCqtE2jAHNHRGjnkRbCoqFt2FnQnNUa7MFh1oNLTy4Ie L6Dg==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772745339; x=1773350139; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2Tubov/GWZo4VtZImd1S6gdF6tWvhLTK8xpLCCHiiic=; b=Tlo2rkLofpZpnbd0O98FAfMAajzP921cBjtKBZA9Rnjw5kmOjJ4XjNvdQ9N1TuyCO7 UJR5J1GPKS0hf6mQDbS4e16s8vDIobCPYnzHgk6GWlzrnbyUS+Pk2tEcn3AAIQlmumH1 XvD+SuAmNoq7jDQ+WbK3bB6ZPW4fxlunVerEueqGkccbDikCQzSwmgcazdvL0Vt8tt8F eWHppNep/ym7H38j6V/SWkrzqIrJuKBjldR0h3u9FIt4LJ+KlCcWRUsdhnCzmYZH+Lai EOKwmUHx9IcMmkhkJmS3NMR+eubrZ5fHjbnYPuuQkf3OhDp9eVJBptmB2PbDeMo61gb/ xXHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772745339; x=1773350139; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2Tubov/GWZo4VtZImd1S6gdF6tWvhLTK8xpLCCHiiic=; b=gv1XGb+zD8lsbHzh1+3SulVNiYI+Smv4BmevXRCH0U0ofRS1bvBsB2b3YdZoVsus+W MDnlf6rSFHE001M9qyZMoLYCrS0fwX0tFPZEGMvuYdc2AXIuucEYkCXl5Frhn87XblvH rg9NIU+GU79qGME1Er6mzbtcWbDoKuyWd/yXwgc2mTovHFBXDpaDKRlMIZZXN7dfHcLg W8jNt6rX+gYOit0tG8K77o4ANm7i3L9IlaaChjMl2UQtdFljuT/dfIlM8Fk6OI0cQ0je AI1LZuQ/X1d8RWSzMH7/UgsclLM0L2Fp+54bg+JkIno75AnokFOqOcaF5EtyXc+RG5B7 EBGw== X-Gm-Message-State: AOJu0YxCUmItPuArCZRTDiF+9Bau4SG1haXVua9ZY7FnppIPRWU55sJY gOc7yYcGY8b2EMNPvrtw+gLuUu8R6FRqDW5Qx8BT+/VxIJiR0lXwF6usEgxBaslV3YUP+Jde32v lcLzbi0qRJYYP4yIhgYE0+OjViONnqRc= X-Gm-Gg: ATEYQzxfaipfrsCmsoeH8VzItXZ8jMxb9FbEzh9eVpcM2yDMZqgnpMbpMWNcRZBiN64 E8JEFc5qbmXltMu+VcjkD77LpVmfmbLWyO4OyrovLlKXEJJtSvQKdxNN4Fy/tToVuVryeFUZBcm E/QAb2WP9S1KjeZPt1I6JURzNmcD4J3PW2UUD9yVHNDjitMfETSFJvZkC1vI3cLZ9ZfI5HMeFRU 45a4VtjwS6xsFxCn8ZJ5H2elk5XCaBOWJGC7IRQQGugq4s404hthICQXUOZakS5C+/GbnuFmTmi S/eYfgM= X-Received: by 2002:a05:6820:1ca9:b0:66a:e8cd:4954 with SMTP id 006d021491bc7-67b944c2804mr2729826eaf.7.1772745339363; Thu, 05 Mar 2026 13:15:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrew Jackson Date: Thu, 5 Mar 2026 15:15:26 -0600 X-Gm-Features: AaiRm50DmZ7U_9-ceyw4PDuFIgRW4DEmDqb_qFx1_ZmYu80uKezwqPWUmKGaQLE Message-ID: Subject: Re: Add Option To Check All Addresses For Matching target_session_attr To: Evgeny Kuzin Cc: pgsql-hackers Content-Type: multipart/alternative; boundary="0000000000003ae46e064c4d70e3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003ae46e064c4d70e3 Content-Type: text/plain; charset="UTF-8" While I prefer your solution, I suspect that it would not be possible/worth it to change the behavior at this point. It seems likely there is some niche setup out there that relies on the current logic in some capacity. I can imagine something along the lines of: someone sets up a hostname that points to 2 IP records that each use different network infra or something like that. In the case where you are looking for a primary you would not want to duplicatively check the same host in this scenario because you already confirmed that it is not the one you are looking for. With your patch you would be increasing connection latency, probably not by that much granted but this is the scenario that encouraged me to implement this as a new parameter. All that being said I'm fine with either patch and would love to see one of them get merged. I suspect there are a lot of extraneous haproxy's that have been set up in the wild that would be unneeded if one of our our patches were merged and the changes proliferate to downstream drivers. One note on your patch though: you may want to incorporate the unit tests that I built out for this patch in yours. --0000000000003ae46e064c4d70e3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
While I prefer your solution, I suspect that it would not= be possible/worth it to change the behavior at this point. It seems likely= there is some niche setup out there that relies on the current logic in so= me capacity.=C2=A0

I can imagi= ne something along the lines of: someone sets up a hostname that points to = 2 IP records that each use different network infra or something like that. = In the case where you are looking for a primary you would not want to dupli= catively check the same host in this scenario because you already confirmed= that it is not the one you are looking for. With your patch you would be i= ncreasing connection latency, probably not by that much granted but this is= the scenario that encouraged me to implement this as a new parameter.

All that being said I'm = fine with either patch and would love to see one of them get merged. I susp= ect there are a lot of extraneous haproxy's that have been set up in th= e wild that would be unneeded if one of our our patches were merged and the= changes proliferate to downstream drivers.

One note on your patch though: you may want to incorpor= ate the unit tests that I built out for this patch in yours.
--0000000000003ae46e064c4d70e3--