BDR: cannot drop database even after parting the node - Mailing list pgsql-general

From Florin Andrei
Subject BDR: cannot drop database even after parting the node
Date
Msg-id 2a3eac9e4e1dd2d248727dacd1054490@andrei.myip.org
Whole thread Raw
Responses Re: BDR: cannot drop database even after parting the node
Re: BDR: cannot drop database even after parting the node
List pgsql-general
postgres=# SELECT bdr.bdr_version();
     bdr_version
-------------------
  0.9.2-2015-07-24-
(1 row)


I've tested BDR with one database on two nodes and it worked well. I've
created the group on node1 like this:

SELECT bdr.bdr_group_create(
       local_node_name := 'node1',
       node_external_dsn := 'node1 dbname=bdrdemo'
);
SELECT bdr.bdr_node_join_wait_for_ready();

I've then joined node2 like this:

SELECT bdr.bdr_group_join(
       local_node_name := 'node2',
       node_external_dsn := 'host=node2 dbname=bdrdemo',
       join_using_dsn := 'host=node1 dbname=bdrdemo'
);
SELECT bdr.bdr_node_join_wait_for_ready();

I did a variety of transactions both ways, cross-checked the nodes,
everything was fine.

Then, from node1, I've parted node2 like this:

SELECT bdr.bdr_part_by_node_names('{node2}');

And then also on node1 I've parted node1 like this:

SELECT bdr.bdr_part_by_node_names('{node1}');

Now I want to start over with a clean slate, so I want to drop the
bdrdemo database on node1. But I can't:

postgres=# DROP DATABASE bdrdemo;
ERROR:  database "bdrdemo" is being accessed by other users
DETAIL:  There is 1 other session using the database.
postgres=# SELECT pid FROM pg_stat_activity where pid <>
pg_backend_pid();
   pid
-------
  10259
  10260
(2 rows)

# ps ax | grep -e 10259 -e 10260 | grep -v grep
10259 ?        Ss     0:00 postgres: bgworker: bdr supervisor
10260 ?        Ss     0:00 postgres: bgworker: bdr db: bdrdemo

If I kill those workers and then drop the database, the workers get
respawned, and then the logs fill up with complaints from the workers
that they can't find the bdrdemo database.

Is there a way to stop BDR completely, so that those workers are laid to
rest and never respawn?

Basically, how do I reset BDR completely? It seems to retain the memory
of the bdrdemo database somewhere.

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


pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Import Problem
Next
From: Florin Andrei
Date:
Subject: Re: BDR: cannot drop database even after parting the node