{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/docs.particular.net/issues/1877","repository_url":"https://api.github.com/repos/Particular/docs.particular.net","labels_url":"https://api.github.com/repos/Particular/docs.particular.net/issues/1877/labels{/name}","comments_url":"https://api.github.com/repos/Particular/docs.particular.net/issues/1877/comments","events_url":"https://api.github.com/repos/Particular/docs.particular.net/issues/1877/events","html_url":"https://github.com/Particular/docs.particular.net/pull/1877","id":175524240,"number":1877,"title":"Distributor upgrade guide","user":{"login":"timbussmann","id":3524870,"avatar_url":"https://avatars.githubusercontent.com/u/3524870?v=3","gravatar_id":"","url":"https://api.github.com/users/timbussmann","html_url":"https://github.com/timbussmann","followers_url":"https://api.github.com/users/timbussmann/followers","following_url":"https://api.github.com/users/timbussmann/following{/other_user}","gists_url":"https://api.github.com/users/timbussmann/gists{/gist_id}","starred_url":"https://api.github.com/users/timbussmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timbussmann/subscriptions","organizations_url":"https://api.github.com/users/timbussmann/orgs","repos_url":"https://api.github.com/users/timbussmann/repos","events_url":"https://api.github.com/users/timbussmann/events{/privacy}","received_events_url":"https://api.github.com/users/timbussmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-07T14:54:25Z","updated_at":"2016-09-13T15:24:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Particular/docs.particular.net/pulls/1877","html_url":"https://github.com/Particular/docs.particular.net/pull/1877","diff_url":"https://github.com/Particular/docs.particular.net/pull/1877.diff","patch_url":"https://github.com/Particular/docs.particular.net/pull/1877.patch"},"body":"connects to Particular/V6Launch#68\r\n\r\nping @SzymonPobiega @DavidBoike @bording please have a look"},"comment":{"url":"https://api.github.com/repos/Particular/docs.particular.net/issues/comments/246718795","html_url":"https://github.com/Particular/docs.particular.net/pull/1877#issuecomment-246718795","issue_url":"https://api.github.com/repos/Particular/docs.particular.net/issues/1877","id":246718795,"user":{"login":"janovesk","id":396480,"avatar_url":"https://avatars.githubusercontent.com/u/396480?v=3","gravatar_id":"","url":"https://api.github.com/users/janovesk","html_url":"https://github.com/janovesk","followers_url":"https://api.github.com/users/janovesk/followers","following_url":"https://api.github.com/users/janovesk/following{/other_user}","gists_url":"https://api.github.com/users/janovesk/gists{/gist_id}","starred_url":"https://api.github.com/users/janovesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janovesk/subscriptions","organizations_url":"https://api.github.com/users/janovesk/orgs","repos_url":"https://api.github.com/users/janovesk/repos","events_url":"https://api.github.com/users/janovesk/events{/privacy}","received_events_url":"https://api.github.com/users/janovesk/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T15:24:11Z","updated_at":"2016-09-13T15:24:11Z","body":"Consider the scenario where A subscribes to B, and B to A. Both run on a machine called \"dist\".\r\n\r\nFollowing this guide, you would get:\r\n\r\n1. v5 A subscription store contains : **(B@dist)**\r\n\r\n   v5 B subscription store contains: **(A@dist)**\r\n2. Shut down **A distributor** \r\n\r\n3. Upgrade A distributor to v6, run it as worker, let's call it **v6 A distworker**\r\n\r\n4. **v6 A distworker** sends **subscribe (A@dist,A)** to **B**  \r\n\r\n5. v5 B subscription store now contains: **(A@dist)** (ignores the endpoint name in the new subscription)\r\n\r\n6. Upgrade other worker for A to v6, let's call it **v6 A worker1**\r\n\r\n7. **v6 A worker1** sends **subscribe (A@worker1,A)** to B\r\n\r\n8. v5 B now contains sub: **(A@dist)**, **(A@worker1)**. This will generate duplicate events.\r\n\r\nBasically v5 endpoints can never receive subscribe messages from multiple instances of v6 send-side endpoints. v5 endpoints are unable to duplicate these subscriptions and will always generate duplicated events. \r\n\r\nI suggest we change the recommendation to shut down all the distributors first, upgrading them to v6 workers and then restarting them all. This will result in duplicates in the subscription storage, but it will be in v6 endpoints. It handles this gracefully and makes sure only ONE event is published per logical endpoint.  Once the distributors have been converted and started, the rest of the workers can be converted.\r\n\r\nIf you do all the distributors first, you get: \r\n\r\n1. v5 A subscription store contains : **(B@dist)**\r\n\r\n   v5 B subscription store contains: **(A@dist)**\r\n2. Shut down **A distributor** \r\n\r\n3. Shut down **B distributor** \r\n\r\n4. Upgrade A distributor to v6, run it as worker, let's call it **v6 A distworker**\r\n5. Upgrade B distributor to v6, run it as worker, let's call it **v6 B distworker**\r\n\r\n6. **v6 A distworker** sends **subscribe (A@dist,A)** to **B**  \r\n\r\n7. **v6 B distworker** sends **subscribe (B@dist,B)** to **A**  \r\n\r\n8. v6 A subscription store contains : **(B@dist, B)**\r\n\r\n   v6 B subscription store contains: **(A@dist, A)**\r\n9. Upgrade A worker1 to v6: let's call it **v6 A worker1**\r\n\r\n10. **v6 A worker1** sends **subscribe (A@worker1,A)** to **B**\r\n\r\n11. \r\n   v6 B subscription store contains: **(A@dist, A)**,**(A@worker1, A)**- Duplicates, but fine in a v6 endpoint\r\n\r\n\r\n"}}
{"actor":{"display_login":"janovesk"}}