Re: BDR to ignore table exists error - Mailing list pgsql-general

From Nikhil
Subject Re: BDR to ignore table exists error
Date
Msg-id CALo-6YP0isiad0opHG_rRAgdCrUwszc5wybpwZX4bqauij4ihA@mail.gmail.com
Whole thread Raw
In response to Re: BDR to ignore table exists error  (Martín Marqués <martin@2ndquadrant.com>)
Responses Re: BDR to ignore table exists error
List pgsql-general
Please see my replies inline.

On Sat, May 28, 2016 at 8:08 PM, Martín Marqués <martin@2ndquadrant.com> wrote:
El 28/05/16 a las 08:57, Nikhil escribió:
> Once the node which was down is brought back the replication slot is not
> turned active. The reason being replication slot is trying to create a
> partition table which already exists. Because of this error replication
> slot is stuck in inactive mode. Is there any way to ignore this error?

BTW, how did you end up in such a state? Did you create the partition
table skipping ddl locking?
​Nik>> skip_ddl_locking is set to True in my configuration. As this was preventing single
​node from doing DDL operation (if one is down majority is not there for doing DDL on available node)
 

At this point the easiest way out is to drop the table on the node where
it's trying to get applied with bdr_replication off or
skip_ddl_replication on, so the table is dropped locally but not
replicated, and the create table from the slot can be consumed.

The other option is to consume the create table statement from the slot
directly.
​Nik>> DDL used is
ERROR:  relation "af_npx_l3_16_146_10" already exists
<596802016-05-29 08:53:07 GMT%CONTEXT:  during DDL replay of ddl statement: CREATE  TABLE  public.af_npx_license_l3_16_146_
10 (CONSTRAINT af_npx_license_l3_16_146_10_rpt_sample_time_check CHECK (((rpt_sample_time OPERATOR(pg_catalog.>=) 146417040
0) AND (rpt_sample_time OPERATOR(pg_catalog.<=) 1464173999))) ) INHERITS (public.af_npx_l3) WITH (oids=OFF)
<554132016-05-29 08:53:07 GMT%LOG:  worker process: bdr (6288512113617339435,2,16384,)->bdr (6288505144157102317,1, (PID 59
680) exited with exit code 1
 

Be aware of the dangers of changing the default values for such
parameters, (bdr_replication, skip_ddl_replication, skip_ddl_locking)
and when needed they should be used with special care.
​Nik>>. The DDL replay is started once the node join back to bdr group. I think its started from an old check point causing partition already exists error. Is there any way to ignore replay error ? or ignore DDL errors while replay ?​

Regards,

--
Martín Marqués                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

pgsql-general by date:

Previous
From: Johannes
Date:
Subject: recordings of pgconf us 2016
Next
From: Francisco Olarte
Date:
Subject: Re: Migrate 2 DB's - v8.3