bdr appears to be trying to replicate to itself

From: Cj B <blackc2004(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: bdr appears to be trying to replicate to itself
Date: 2015-11-16 15:46:52
Message-ID: FCF0C1BA-8FE9-4D5D-9426-7C2C26B54710@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I noticed a very strange issue starting about 20 days ago and my pg_xlog has just been filling up since then.

```
HOST A:
postgres=# select * from pg_replication_slots;
slot_name | plugin | slot_type | datoid | database | active | xmin | catalog_xmin | restart_lsn
-----------------------------------------+--------+-----------+--------+-----------+--------+------+--------------+-------------
bdr_16385_6188730679935789649_1_16385__ | bdr | logical | 16385 | database_name | f | | 28174997 | 25/7677F300
bdr_16385_6188733518371128845_2_16385__ | bdr | logical | 16385 | database_name | t | | 38613316 | 41/7B7EDF80

select bdr.bdr_get_local_nodeid();
bdr_get_local_nodeid
-------------------------------
(6188730679935789649,1,16385)

SELECT slot_name, database, active, pg_xlog_location_diff(pg_current_xlog_insert_location(), restart_lsn) AS retained_bytes FROM pg_replication_slots WHERE plugin = 'bdr';
slot_name | database | active | retained_bytes
-----------------------------------------+-----------+--------+----------------
bdr_16385_6188730679935789649_1_16385__ | database_name | f | 120353015152
bdr_16385_6188733518371128845_2_16385__ | database_name | t | 2288
(2 rows)
```

HOST B:

```
select * from pg_replication_slots;
slot_name | plugin | slot_type | datoid | database | active | xmin | catalog_xmin | restart_lsn
-----------------------------------------+--------+-----------+--------+-----------+--------+------+--------------+-------------
bdr_16385_6188730679935789649_1_16385__ | bdr | logical | 16385 | database_name | t | | 3499719 | 3/B53F00A8

select bdr.bdr_get_local_nodeid();
bdr_get_local_nodeid
-------------------------------
(6188733518371128845,2,16385)

SELECT slot_name, database, active, pg_xlog_location_diff(pg_current_xlog_insert_location(), restart_lsn) AS retained_bytes FROM pg_replication_slots WHERE plugin = 'bdr';
slot_name | database | active | retained_bytes
-----------------------------------------+-----------+--------+----------------
bdr_16385_6188730679935789649_1_16385__ | database_name | t | 68736
```

So it almost looks like HOST A is trying to replicate to itself since the replication_slots has the same node_id of itself and it's just filling up the pg_xlog.

This server has been setup since mid-may and I haven't added any new nodes but I did upgrade just this past weekend before I noticed there was a problem:
dpkg -l | grep '^ii' | grep postgre
ii pgdg-keyring 2014.1 all keyring for apt.postgresql.org
ii postgresql-bdr-9.4 9.4.5-1trusty amd64 object-relational SQL database, version 9.4 server
ii postgresql-bdr-9.4-bdr-plugin 0.9.3-1trusty amd64 BDR Plugin for PostgreSQL-BDR 9.4
ii postgresql-bdr-client-9.4 9.4.5-1trusty amd64 front-end programs for PostgreSQL-BDR 9.4
ii postgresql-bdr-contrib-9.4 9.4.5-1trusty amd64 additional facilities for PostgreSQL
ii postgresql-client-common 170.pgdg14.04+1 all manager for multiple PostgreSQL client versions
ii postgresql-common 170.pgdg14.04+1 all PostgreSQL database-cluster manager
ii postgresql-contrib 9.4+170.pgdg14.04+1 all additional facilities for PostgreSQL (supported version)

Before I was on postgresql-bdr-client-9.4 9.4.4-1trusty

Can anyone help me fix this? I'm running out of HD space.

Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2015-11-16 15:48:53 Re: referencing other INSERT VALUES columns inside the insert
Previous Message Tom Lane 2015-11-16 15:02:28 Re: database corrupt