{"action":"created","issue":{"url":"https://api.github.com/repos/2ndQuadrant/pglogical/issues/59","repository_url":"https://api.github.com/repos/2ndQuadrant/pglogical","labels_url":"https://api.github.com/repos/2ndQuadrant/pglogical/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/2ndQuadrant/pglogical/issues/59/comments","events_url":"https://api.github.com/repos/2ndQuadrant/pglogical/issues/59/events","html_url":"https://github.com/2ndQuadrant/pglogical/issues/59","id":189253941,"number":59,"title":"Duplicate rows on initial replication","user":{"login":"mullr","id":24409,"avatar_url":"https://avatars.githubusercontent.com/u/24409?v=3","gravatar_id":"","url":"https://api.github.com/users/mullr","html_url":"https://github.com/mullr","followers_url":"https://api.github.com/users/mullr/followers","following_url":"https://api.github.com/users/mullr/following{/other_user}","gists_url":"https://api.github.com/users/mullr/gists{/gist_id}","starred_url":"https://api.github.com/users/mullr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mullr/subscriptions","organizations_url":"https://api.github.com/users/mullr/orgs","repos_url":"https://api.github.com/users/mullr/repos","events_url":"https://api.github.com/users/mullr/events{/privacy}","received_events_url":"https://api.github.com/users/mullr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-14T23:15:42Z","updated_at":"2016-11-15T23:08:09Z","closed_at":null,"body":"postgresql version: 9.4.9\r\npglogical verison: 1.2.1\r\n\r\nWe are seeing intermittent failures in initial replication that appear to be caused by some rows getting replicated twice. We're still working on a repro for this, but it's something along these lines:\r\n\r\n1. Have a table on the source-side with a uuid primary key (not sure if that matters), some other columns, and a last_active timestamp (which is populated by the application, not the database)\r\n2. Add all tables in the public schema to the default replication set, using replication_set_add_all_tables with synchronize_data=true\r\n3. While the source continues to serve requests as normal, create a subscription on the replica\r\n  a. All the tables get created on the replica side\r\n  b. Two rows appear on the replica side, each with the same uuid primary key, but with different last_active timestamps\r\n  c. PostgreSQL logs an error, saying \"could not create unique index ...\" for the primary key\r\n  d. pglogical logs an error saying \"subscriber <name> initialization failed during nonrecoverable step (c), please try the setup again\"\r\n\r\nIt /appears/ to be triggered to be correlated with write activity on the source side, but that's only anecdotal at this point. "},"comment":{"url":"https://api.github.com/repos/2ndQuadrant/pglogical/issues/comments/260799752","html_url":"https://github.com/2ndQuadrant/pglogical/issues/59#issuecomment-260799752","issue_url":"https://api.github.com/repos/2ndQuadrant/pglogical/issues/59","id":260799752,"user":{"login":"holguinj","id":3395230,"avatar_url":"https://avatars.githubusercontent.com/u/3395230?v=3","gravatar_id":"","url":"https://api.github.com/users/holguinj","html_url":"https://github.com/holguinj","followers_url":"https://api.github.com/users/holguinj/followers","following_url":"https://api.github.com/users/holguinj/following{/other_user}","gists_url":"https://api.github.com/users/holguinj/gists{/gist_id}","starred_url":"https://api.github.com/users/holguinj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holguinj/subscriptions","organizations_url":"https://api.github.com/users/holguinj/orgs","repos_url":"https://api.github.com/users/holguinj/repos","events_url":"https://api.github.com/users/holguinj/events{/privacy}","received_events_url":"https://api.github.com/users/holguinj/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T23:08:09Z","updated_at":"2016-11-15T23:08:09Z","body":"I've been trying to reproduce this to no avail so far. Here's what I did:\r\n\r\n1. create two nodes in two instances of postgres 9.4.10 (primary + replica), without a subscription\r\n2. create a table on the primary with 10,000 rows and run a script to constantly update them (leaving the primary key alone)\r\n3. while that updating is going on, create a subscription from the replica to the primary\r\n\r\nThe result was a well-replicated database without any errors. I've made [this repo](https://github.com/holguinj/pglogical-duplicate-row-bug) to help anyone else who wants to try to reproduce this, if they're so inclined."}}
{"actor":{"display_login":"holguinj"}}