Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YRdp4-0000TC-Ln for pgsql-bugs@arkaria.postgresql.org; Sat, 28 Feb 2015 09:36:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YRdp3-0003xU-Se for pgsql-bugs@arkaria.postgresql.org; Sat, 28 Feb 2015 09:36:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YRdp1-0003xL-T7 for pgsql-bugs@postgresql.org; Sat, 28 Feb 2015 09:36:31 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YRdow-0001S1-SB for pgsql-bugs@postgresql.org; Sat, 28 Feb 2015 09:36:30 +0000 Received: from anarazel.de ([84.175.78.254]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0M73gb-1XXDRS2TA5-00wjzD; Sat, 28 Feb 2015 10:36:23 +0100 Received: by anarazel.de (Postfix, from userid 1000) id E6B6A1008F7; Sat, 28 Feb 2015 10:36:22 +0100 (CET) Date: Sat, 28 Feb 2015 10:36:22 +0100 From: 'Andres Freund' To: Ruth Melendo Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12808: BDR lock adding Postgis extension in one node Message-ID: <20150228093622.GA31643@awork2.anarazel.de> References: <20150226162925.2547.93027@wrigleys.postgresql.org> <20150227142428.GS24199@awork2.anarazel.de> <004901d05299$ea34d7f0$be9e87d0$@teltronic.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <004901d05299$ea34d7f0$be9e87d0$@teltronic.es> Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:+N6GfWNZT2LwvAaZUL3SeWS80lYfGg+1VDu4zqiteZtKGHNFZtY N7+MmKLJUTNYRgVtc9zH+RejLc8mdZ8FUlwvqKpzBySJrqogGFn+nuFuEZzRKin+V1RsZRK Mwv/QfnEHTrN8HKOrr0d0dsFNcx86AhVIYrzZ1lumStepY8b2NdTYkQoggS2zWotlfcsUmw A36tB+xEtuHdVRUWv/8yA== X-UI-Out-Filterresults: notjunk:1; X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi, [some information has been acquired privately] On 2015-02-27 15:30:20 +0100, Ruth Melendo wrote: > The error got when adding a PostGIS extension from PGAdmin in node > 1. Extension was created and the depending table too but in node 2 got > the error when adding the extension because the depending table was > not created. > But, although the problem was originated for this, my main dude is how > to fix the database then it=C2=B4s locked. What do I have to do? Because > now, I cannot do any DDL or DML against it. The reason it's locked is that it's waiting for DDL to be replicated. And that fails due to the spatial_ref_sys error. In the version you're using the easiest way to resolve this is probably to skip replication of the problematic transaction, and then fix up things afterwards by hand. To do that connect to the database you performed the CREATE EXTENSION on. There get a list of the outgoing connections with a query like: SELECT slot_name, datoid, database, active FROM pg_replication_slots WHERE slot_name LIKE 'bdr_'||(SELECT oid FROM pg_database WHERE datname =3D= current_database())||'_%'; =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 slot_name =E2=94=82 datoid =E2=94= =82 database =E2=94=82 active =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 bdr_17911_6120567807158814813_1_16385__ =E2=94=82 17911 =E2=94= =82 node_03 =E2=94=82 t =E2=94=82 =E2=94=82 bdr_17911_6120567807158814813_1_17153__ =E2=94=82 17911 =E2=94= =82 node_03 =E2=94=82 f =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 (2 rows) In my three node setup those two consume changes from the node_03 database. To consume the problematic transaction, use something like: COPY (SELECT * FROM pg_logical_slot_get_binary_changes('bdr_17911_612056780= 7158814813_1_16385__', NULL, 1, 'interactive', 'true')) TO '/dev/null'; for each of the remote nodes. After that you should be able to execute DDL again. Then please reconnect and do SET bdr.skip_ddl_replication =3D on; DROP EXTENSION postgis; That should bring the nodes back in sync with regard to the postgis extension. We'll work on making it possible to replicate extensions that insert data into their own tables during creation. Greetings, Andres Freund --=20 Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs