Message-ID: From: "davecramer (@davecramer)" To: "pgjdbc/pgjdbc" Date: Tue, 04 Feb 2025 12:51:52 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3506: feat: Add access for global host status tracker In-Reply-To: References: List-Id: X-GitHub-Author-Login: davecramer X-GitHub-Comment-Id: 2633818362 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3506 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3506#issuecomment-2633818362 Content-Type: text/plain; charset=utf-8 > > So `Client` is some library that checks with an external API to figure out if the host is alive ? > > @davecramer, yep. > > > Frankly speaking, I am leaning towards implementing #3409 or something like that. I am afraid if we expose `GlobalHostStatusTracker` as in the current PR, then it might complicate the implementation of 3409. WDYT? > > I saw this pr, but I didn't like it. In this solution, as you (@vlsi) already wrote, it duplicates the current functionality and, ideally, it should be done through a listener and sending notifications via the `reportHostStatus` method. But even in this solution, there is a risk that if the developer adds complex logic to the listener, the entire driver operation will begin to slow down. My solution only provides read access to the Map where the driver's view of hosts is stored. @vlsi, please explain how my solution affects pr [#3304](https://github.com/pgjdbc/pgjdbc/pull/3409)? > > If there is another way to get information from the driver about which host currently has a Connection established? Yes, generally through some kind of topology function in the database. For instance Aurora has [`aurora_replica_status()`](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora_replica_status.html) I'm not a huge fan of the driver reaching out to another port, or API I would entertain the pluggable idea in #3409