Re: [BDR] Best practice to automatically abort a DDL operation when one node is down

From: Sylvain MARECHAL <marechal(dot)sylvain2(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [BDR] Best practice to automatically abort a DDL operation when one node is down
Date: 2016-01-18 08:30:54
Message-ID: 569CA2BE.9040406@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>
> What is the best practice to make sure the DDL operation will
> fail, possibly after a timeout, if one of the node is down?
>
>
> statement_timeout

Ok. Thank-you for pointing this. I have just tried it, and this work
great even for nodes that are not properly power off (plug removed).
>
> I could check the state of the node before issuing the DDL
> operation, but this solution is far from being perfect as the node
> may fail right after this.
>
>
> Correct, but it's still useful to do.
>
> I'd check to see all nodes are connected in pg_stat_replication then
> I'd issue the DDL with a statement_timeout set.

Ok. For the first check, I was using
|bdr.bdr_test_remote_connectback(/peer_dsn/, /local_dsn/), getting the
dsn from the bdr.bdr_nodes table; but using the |pg_stat_replication
table is problably quicker and simpler.

Thank-you again,

Sylvain

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Agarwal, Prateek 2016-01-18 08:49:11 Re: Missing RHEL rpm(pg_catcheck-95) in postgres 9.5 repo.
Previous Message yang 2016-01-18 07:31:33 How can i add a postgresql connection using inno setup?