{"action":"created","issue":{"url":"https://api.github.com/repos/2ndQuadrant/bdr/issues/88","labels_url":"https://api.github.com/repos/2ndQuadrant/bdr/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/2ndQuadrant/bdr/issues/88/comments","events_url":"https://api.github.com/repos/2ndQuadrant/bdr/issues/88/events","html_url":"https://github.com/2ndQuadrant/bdr/issues/88","id":89057233,"number":88,"title":"bdr_init_copy connects to wrong database when multiple upstream DBs are BDR-enabled","user":{"login":"jtorral","id":12737865,"avatar_url":"https://avatars.githubusercontent.com/u/12737865?v=3","gravatar_id":"","url":"https://api.github.com/users/jtorral","html_url":"https://github.com/jtorral","followers_url":"https://api.github.com/users/jtorral/followers","following_url":"https://api.github.com/users/jtorral/following{/other_user}","gists_url":"https://api.github.com/users/jtorral/gists{/gist_id}","starred_url":"https://api.github.com/users/jtorral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtorral/subscriptions","organizations_url":"https://api.github.com/users/jtorral/orgs","repos_url":"https://api.github.com/users/jtorral/repos","events_url":"https://api.github.com/users/jtorral/events{/privacy}","received_events_url":"https://api.github.com/users/jtorral/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/2ndQuadrant/bdr/labels/bdr","name":"bdr","color":"080000"},{"url":"https://api.github.com/repos/2ndQuadrant/bdr/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/2ndQuadrant/bdr/labels/initialisation","name":"initialisation","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/2ndQuadrant/bdr/milestones/4","html_url":"https://github.com/2ndQuadrant/bdr/milestones/next","labels_url":"https://api.github.com/repos/2ndQuadrant/bdr/milestones/4/labels","id":1024778,"number":4,"title":"next","description":"Work that needs to be done with some priority but has no specific due date.","creator":{"login":"ringerc","id":274337,"avatar_url":"https://avatars.githubusercontent.com/u/274337?v=3","gravatar_id":"","url":"https://api.github.com/users/ringerc","html_url":"https://github.com/ringerc","followers_url":"https://api.github.com/users/ringerc/followers","following_url":"https://api.github.com/users/ringerc/following{/other_user}","gists_url":"https://api.github.com/users/ringerc/gists{/gist_id}","starred_url":"https://api.github.com/users/ringerc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ringerc/subscriptions","organizations_url":"https://api.github.com/users/ringerc/orgs","repos_url":"https://api.github.com/users/ringerc/repos","events_url":"https://api.github.com/users/ringerc/events{/privacy}","received_events_url":"https://api.github.com/users/ringerc/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":5,"state":"open","created_at":"2015-03-17T03:36:56Z","updated_at":"2015-06-29T06:31:59Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-06-17T15:58:17Z","updated_at":"2015-06-29T06:31:59Z","closed_at":"2015-06-29T06:31:59Z","body":"In the process of testing out BDR for a possible solution. I originally setup the environment on two\r\nseparate servers as per the quick start guid and used the sql commands to create groups and\r\nadd nodes. \r\n\r\n* originally on node 1\r\n* created db1 and db2\r\n* use bdr_group_create inside of db1 to create group\r\n* use bdr_group_create inside of db2 to create group\r\n* went to node2 and created blank db's connected to each db and joined groups from node 1\r\n\r\nThe above worked as expected\r\n\r\nHowever, moving on to command line, I am running into some issues.\r\n\r\nI am sure I am just overlooking something really simple. But, on the\r\nnode1 I created two databases and created two groups. one within\r\neach database. No issues so far. \r\n\r\nI figured if these databases had valid data I would use bdr_init_copy to join node2 to node1 and copy data at the same time.\r\n\r\nHowever, now on the 2nd node, I want to\r\nadd it to the cluster using bdr_init_copy. It partially works but then it\r\ndies as you can see below. \r\n\r\nJust a side note. If I create only 1 db on node one and run the command it works.\r\n\r\n```\r\n/var/lib/pgsql/9.4-bdr/data\r\n\r\n-bash-4.1$ rm -rf *\r\n\r\n-bash-4.1$ bdr_init_copy -D /var/lib/pgsql/9.4-bdr/data -n node2 -d\r\n'host=10.5.101.176 port=5432' --local-dbname='host=10.5.101.179 port=5432'\r\n\r\nbdr_init_copy: starting ...\r\n\r\nGetting remote server identification ...\r\n\r\nDetected 2 BDR database(s) on remote server\r\n\r\nUpdating BDR configuration on the remote node:\r\n\r\n abc: validating BDR configuration ...\r\n\r\n abc: creating replication slot ...\r\n\r\n abc: creating node entry for local node ...\r\n\r\n xyz: validating BDR configuration ...\r\n\r\n xyz: creating replication slot ...\r\n\r\n xyz: creating node entry for local node ...\r\n\r\nCreating base backup of the remote node...\r\n\r\n44543/44543 kB (100%), 1/1 tablespace\r\n\r\nCreating restore point on remote node ...\r\n\r\nBringing local node to the restore point ...\r\n\r\nTransaction log reset\r\n\r\nInitializing BDR on the local node:\r\n\r\n abc: adding the database to BDR cluster ...\r\n\r\n*Could not add local node to cluster, status PGRES_FATAL_ERROR: ERROR:\r\ngetting remote node id failed*\r\n\r\nDETAIL:  SELECT sysid, timeline, dboid FROM bdr.bdr_get_local_nodeid()\r\nfailed with: ERROR:  schema \"bdr\" does not exist\r\n\r\n\r\nCONTEXT:  SQL statement \"SELECT *                           FROM\r\nbdr_get_remote_nodeinfo(node_local_dsn)\"\r\n\r\nPL/pgSQL function internal_begin_join(text,text,text,text) line 41 at SQL\r\nstatement\r\n\r\nSQL statement \"SELECT bdr.internal_begin_join(\r\n\r\n        'bdr_group_join',\r\n\r\n        local_node_name,\r\n\r\n        CASE WHEN node_local_dsn IS NULL THEN node_external_dsn ELSE\r\nnode_local_dsn END,\r\n\r\n        join_using_dsn)\"\r\n\r\nPL/pgSQL function bdr_group_join(text,text,text,text,integer,text[]) line\r\n21 at PERFORM\r\n```\r\n\r\nThanks for looking.\r\n\r\nJT"},"comment":{"url":"https://api.github.com/repos/2ndQuadrant/bdr/issues/comments/116476814","html_url":"https://github.com/2ndQuadrant/bdr/issues/88#issuecomment-116476814","issue_url":"https://api.github.com/repos/2ndQuadrant/bdr/issues/88","id":116476814,"user":{"login":"ringerc","id":274337,"avatar_url":"https://avatars.githubusercontent.com/u/274337?v=3","gravatar_id":"","url":"https://api.github.com/users/ringerc","html_url":"https://github.com/ringerc","followers_url":"https://api.github.com/users/ringerc/followers","following_url":"https://api.github.com/users/ringerc/following{/other_user}","gists_url":"https://api.github.com/users/ringerc/gists{/gist_id}","starred_url":"https://api.github.com/users/ringerc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ringerc/subscriptions","organizations_url":"https://api.github.com/users/ringerc/orgs","repos_url":"https://api.github.com/users/ringerc/repos","events_url":"https://api.github.com/users/ringerc/events{/privacy}","received_events_url":"https://api.github.com/users/ringerc/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T06:31:59Z","updated_at":"2015-06-29T06:31:59Z","body":"Should be fixed by Petr's commit."}}