Re: Best Practices for Checking PostgreSQL Server Mode with Multiple Connections

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: YoungUk Song <pidaoh(at)g(dot)skku(dot)edu>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, psycopg(at)postgresql(dot)org
Subject: Re: Best Practices for Checking PostgreSQL Server Mode with Multiple Connections
Date: 2024-12-09 14:14:30
Message-ID: F9E69013-F05C-4095-A1BC-DA1B8F6B781A@thebuild.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: psycopg

> On Dec 9, 2024, at 06:04, YoungUk Song <pidaoh(at)g(dot)skku(dot)edu> wrote:
> Are there any best practices for efficiently handling this task across such a large number of servers?

Out of curiosity, shouldn't something in your infrastructure know this information already? After all, something created all these servers.

That being said, you will need to open connections to the servers to determine if they are in recovery or not. You might be able to do a small optimization in that, when you connect, you also query to see what servers are attached to that server as binary replicas: you can then remove them from the list of servers that need to be checked, since you know they are in recovery. If you have cascaded binary replicas, however, this could end up creating more work than it solves.

In response to

Browse psycopg by date

  From Date Subject
Next Message Adrian Klaver 2024-12-09 16:53:21 Re: Best Practices for Checking PostgreSQL Server Mode with Multiple Connections
Previous Message YoungUk Song 2024-12-09 14:04:51 Re: Best Practices for Checking PostgreSQL Server Mode with Multiple Connections