Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jB1SR-0004jG-0m for pgsql-general@arkaria.postgresql.org; Sun, 08 Mar 2020 19:19:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jB1SP-0001et-Oh for pgsql-general@arkaria.postgresql.org; Sun, 08 Mar 2020 19:19:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jB1SP-0001ee-BV for pgsql-general@lists.postgresql.org; Sun, 08 Mar 2020 19:19:25 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jB1SI-0001Ys-Oj for pgsql-general@lists.postgresql.org; Sun, 08 Mar 2020 19:19:23 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 1791F274F; Sun, 8 Mar 2020 20:19:13 +0100 (CET) Date: Sun, 8 Mar 2020 20:19:13 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Advice request : simultaneous function/data updates on many databases Message-ID: <20200308191913.GB22585@hjp.at> References: <20200304220426.GB7232@campbell-lange.net> <7ce9074f-0468-1cc8-3337-018b66e56679@aklaver.com> <20200304222257.GA11376@campbell-lange.net> <42b4d82b-d468-3f9e-c021-c20bcc141245@aklaver.com> <20200304223342.GA11628@campbell-lange.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QTprm0S8XgL7H0Dt" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --QTprm0S8XgL7H0Dt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-03-04 14:42:01 -0800, Guyren Howe wrote: > On Mar 4, 2020, at 14:33 , Rory Campbell-Lange = wrote: > Essentially we wish to reduce the window where the frontend and backe= nd > aren't synchronised. >=20 > If we have (for example) 200 databases which each take 2 seconds to > update, a client could be on the wrong frontend code for over 6 minut= es. >=20 >=20 > Send each of the servers a PL/PGSQL method that executes all the things i= n a > transaction and then waits until the same clock time to commit. Last time I looked, some DDL commands (especially "drop table") took an exclusive lock on the affected table. So you may want to keep transactions which execute such commands very short to prevent them from blocking other transactions for a noticeable amount of time. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --QTprm0S8XgL7H0Dt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAl5lRSsACgkQ8g5IURL+ KF2mkA//UpNM54mpLieXZXKy97Ru2CFNHb/Uho0/mibjiacvGIinGfKkuzvj45pq u1n8s2xiDJAG+pZGKZ1LQGEIxWBg73tmKiM05va4f4hDzTk3WeCYqzaL+BwGDUpH dIASdWLeqjbtpG/AlxH5nmFQAfk7bjWu8WcWQMEAi4EiPWh+XijlbQWGsiwvRY2O I2cmEsnTgyb2ZdPNi+KQO1yNjqf5jNDxQRwnJQ0hicf6yWD7zEcODXjPnrH4nyan dZaHzORhu1gPnRRolXHC+5IGS+TOTYEzXvjNUVlviWF/dX4jFrUM1/LJaAbLGHXn ooek4UlEuTFmLQVAcXaHbQWFeFKR9c3iV7kMZxHSxU7EXqudWpi/m67Bf7a6Pm+C AdwdCEbRPNeOzvUyhelinEo/OcPzs0eKvdgOHMvPRfplf85JkjJpZGKm7UXokB2J Zk3DH9Ua7i4J2K9ObRueGVRk/WzLuzU84T+Yffl03kaUfQILmh+m7xVxIzL2HKKl UB4OfNT2bpmpqJQXmUsyCUsE1Ajha0SkROdFIqN+v6bP/HfdmAG6DxPQl/nh1lKs s0tSBAtLkyI0Z7LEJqS9S5ciRN9rb/sppFNf1YGtbKTO4uMya03EhNuFoSRyslqA 6xyP7dXLugHE4+6ZH8YznJDNlXtVeuGdtbeh2r3gzUL/yxAtZUM= =zwQC -----END PGP SIGNATURE----- --QTprm0S8XgL7H0Dt--