fixup! Add a test for node part
authorCraig Ringer <craig@2ndquadrant.com>
Fri, 15 May 2015 09:26:08 +0000 (17:26 +0800)
committerCraig Ringer <craig@2ndquadrant.com>
Mon, 25 May 2015 03:17:57 +0000 (11:17 +0800)
Didn't check in the expected/ data

expected/part_bdr.out

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ac0351d1251f6af977b76f2c02c5918ebb8705a2 100644 (file)
@@ -0,0 +1,46 @@
+\c postgres
+SELECT bdr.bdr_part_by_node_names(ARRAY['node-pg']);
+ bdr_part_by_node_names 
+------------------------
+(1 row)
+
+SELECT pg_xlog_wait_remote_apply(pg_current_xlog_location(), 0);
+ pg_xlog_wait_remote_apply 
+---------------------------
+(1 row)
+
+\c regression
+-- There should now be zero slots
+SELECT plugin, slot_type, database, active FROM pg_replication_slots;
+ plugin | slot_type |  database  | active 
+--------+-----------+------------+--------
+ bdr    | logical   | postgres   | f
+ bdr    | logical   | regression | f
+(2 rows)
+
+-- Zero active connections
+SELECT count(*) FROM pg_stat_replication;
+ count 
+-------
+     0
+(1 row)
+
+-- and the node state for the removed node should show 'k'
+SELECT node_name, node_status FROM bdr.bdr_nodes;
+    node_name    | node_status 
+-----------------+-------------
+ node-regression | r
+ node-pg         | k
+(2 rows)
+
+\c postgres
+-- ... on both nodes.
+SELECT node_name, node_status FROM bdr.bdr_nodes;
+    node_name    | node_status 
+-----------------+-------------
+ node-regression | r
+ node-pg         | k
+(2 rows)
+