Обсуждение: BDR: cannot remove node from group

Поиск
Список
Период
Сортировка

BDR: cannot remove node from group

От
Florin Andrei
Дата:
Testing BDR for the first time, using the binary packages for Ubuntu
10.04 provided at http://packages.2ndquadrant.com/bdr/apt/

Postgres 9.4.4 and BDR 0.9.2 (I think)

I'm loosely following this document:

http://bdr-project.org/docs/stable/quickstart-enabling.html

Except I've created two separate instances and I'm trying to replicate
between instances.

I've created the bdrdemo database, and then I've created the extensions:

CREATE EXTENSION btree_gist;
CREATE EXTENSION bdr;

Then I did bdr_group_create on one node:

SELECT bdr.bdr_group_create(
    local_node_name := 'pg-test1-dev-uswest2-aws',
    node_external_dsn := 'port=5432 dbname=bdrdemo'
);

But then I've realized I need a host statement in node_external_dsn. So
now I'm trying to remove this node:

SELECT bdr.bdr_part_by_node_names('{pg-test1-dev-uswest2-aws}');

But if I try to re-add it with the new parameters:

SELECT bdr.bdr_group_create(
    local_node_name := 'pg-test1-dev-uswest2-aws',
    node_external_dsn := 'host=pg-test1-dev-uswest2-aws port=5432
dbname=bdrdemo'
);

I get this:

ERROR:  This node is already a member of a BDR group
HINT:  Connect to the node you wish to add and run bdr_group_join from
it instead

What do I need to do to start over? I want to delete all traces of the
BDR configuration I've done so far.

--
Florin Andrei
http://florin.myip.org/


Re: BDR: cannot remove node from group

От
Craig Ringer
Дата:
On 26 August 2015 at 07:19, Florin Andrei <florin@andrei.myip.org> wrote:

> What do I need to do to start over? I want to delete all traces of the BDR
> configuration I've done so far.

you need to DROP the database you removed, then re-create it as a new
empty database. You cannot re-join a node that has been removed.


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: BDR: cannot remove node from group

От
Florin Andrei
Дата:
On 2015-08-25 18:29, Craig Ringer wrote:
> On 26 August 2015 at 07:19, Florin Andrei <florin@andrei.myip.org>
> wrote:
>
>> What do I need to do to start over? I want to delete all traces of the
>> BDR
>> configuration I've done so far.
>
> you need to DROP the database you removed, then re-create it as a new
> empty database. You cannot re-join a node that has been removed.

postgres=# DROP DATABASE bdrdemo;
ERROR:  database "bdrdemo" is being accessed by other users
DETAIL:  There is 1 other session using the database.

Something's holding it open, not sure exactly what.

--
Florin Andrei
http://florin.myip.org/


Re: BDR: cannot remove node from group

От
Florin Andrei
Дата:
On 2015-09-15 16:45, Florin Andrei wrote:
> On 2015-08-25 18:29, Craig Ringer wrote:
>> On 26 August 2015 at 07:19, Florin Andrei <florin@andrei.myip.org>
>> wrote:
>>
>>> What do I need to do to start over? I want to delete all traces of
>>> the BDR
>>> configuration I've done so far.
>>
>> you need to DROP the database you removed, then re-create it as a new
>> empty database. You cannot re-join a node that has been removed.
>
> postgres=# DROP DATABASE bdrdemo;
> ERROR:  database "bdrdemo" is being accessed by other users
> DETAIL:  There is 1 other session using the database.
>
> Something's holding it open, not sure exactly what.

More specifically, it seems like it's the bgworker that's holding that
DB:

  1123 ?        S      0:00 /usr/lib/postgresql/9.4/bin/postgres -D
/var/lib/postgresql/9.4/main -c
config_file=/etc/postgresql/9.4/main/postgresql.conf
  1124 ?        Ss     0:00  \_ postgres: logger process
  1126 ?        Ss     0:00  \_ postgres: checkpointer process
  1127 ?        Ss     0:00  \_ postgres: writer process
  1128 ?        Ss     0:00  \_ postgres: wal writer process
  1129 ?        Ss     0:00  \_ postgres: autovacuum launcher process
  1130 ?        Ss     0:00  \_ postgres: stats collector process
  1136 ?        Ss     0:00  \_ postgres: bgworker: bdr supervisor
  1137 ?        Ss     0:00  \_ postgres: bgworker: bdr db: bdrdemo

Should I just kill that process, or is there a "nicer" way to do it?

More generally, is there a way to just turn off BDR entirely on one
node? I can't find a clear answer in the documentation to questions like
- how do I turn on or off replication altogether?

--
Florin Andrei
http://florin.myip.org/