{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/286","repository_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB","labels_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/286/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/286/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/286/events","html_url":"https://github.com/Particular/NServiceBus.RavenDB/issues/286","id":180136804,"number":286,"title":"Do not store subscriptions by message assembly version","user":{"login":"DavidBoike","id":427110,"avatar_url":"https://avatars.githubusercontent.com/u/427110?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidBoike","html_url":"https://github.com/DavidBoike","followers_url":"https://api.github.com/users/DavidBoike/followers","following_url":"https://api.github.com/users/DavidBoike/following{/other_user}","gists_url":"https://api.github.com/users/DavidBoike/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidBoike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidBoike/subscriptions","organizations_url":"https://api.github.com/users/DavidBoike/orgs","repos_url":"https://api.github.com/users/DavidBoike/repos","events_url":"https://api.github.com/users/DavidBoike/events{/privacy}","received_events_url":"https://api.github.com/users/DavidBoike/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/labels/Type:%20Bug","name":"Type: Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/milestones/40","html_url":"https://github.com/Particular/NServiceBus.RavenDB/milestones/4.0.1","labels_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/milestones/40/labels","id":2038507,"number":40,"title":"4.0.1","description":"","creator":{"login":"DavidBoike","id":427110,"avatar_url":"https://avatars.githubusercontent.com/u/427110?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidBoike","html_url":"https://github.com/DavidBoike","followers_url":"https://api.github.com/users/DavidBoike/followers","following_url":"https://api.github.com/users/DavidBoike/following{/other_user}","gists_url":"https://api.github.com/users/DavidBoike/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidBoike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidBoike/subscriptions","organizations_url":"https://api.github.com/users/DavidBoike/orgs","repos_url":"https://api.github.com/users/DavidBoike/repos","events_url":"https://api.github.com/users/DavidBoike/events{/privacy}","received_events_url":"https://api.github.com/users/DavidBoike/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-09-29T19:08:23Z","updated_at":"2016-09-29T19:13:15Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-09-29T19:13:15Z","updated_at":"2016-09-30T05:33:31Z","closed_at":null,"body":"RavenDB sub-issue of https://github.com/Particular/PlatformDevelopment/issues/960  \r\nAlso related to https://github.com/Particular/NServiceBus/issues/1394\r\n\r\nQuite difficult for Raven because the Major version was included in the calculation of the deterministic guid that becomes part of the document id.\r\n\r\nAny given endpoint cannot simply convert the entire database worth of subscriptions because there may be other endpoints attached to the same database that haven't been updated. There are also odd situations that could result from endpoints running different versions, and having an old endpoint update the subscription store in such a way that the new endpoint is using its converted subscriptions and is no longer paying attention.\r\n\r\nSince this forces us to change the structure of the subscription documents, we might as well also redesign them to not have a collection of subscribers (we originally wanted to for 4.0) as that creates race conditions when multiple endpoints subscribe to the same thing.\r\n\r\nThe only safe way seems to be to do it on a type-by-type conversion basis, the first time any message of a given type is published.\r\n\r\nPlease forgive the amazingly awful pseudocode:\r\n\r\n```\r\nGetSubscribersFor(Type type)\r\n{\r\n    subscribers = Raven.LoadStartingWith(\"NewCollectionName/TypeNameGuid\");\r\n\r\n    if(!subscribers && !conversionForTypeComplete)\r\n    {\r\n        oldSubscribers = Raven.LoadStartingWith(\"OldCollectionName\")\r\n            .LoopThroughPages()\r\n            .FilterInMemory(type);\r\n\r\n        subscribers = Convert(oldSubscribers);\r\n        Raven.Store(subscribers);\r\n\r\n        conversionForTypeComplete = true;\r\n    }\r\n\r\n    return subscribers;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/comments/250662355","html_url":"https://github.com/Particular/NServiceBus.RavenDB/issues/286#issuecomment-250662355","issue_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/286","id":250662355,"user":{"login":"weralabaj","id":7335079,"avatar_url":"https://avatars.githubusercontent.com/u/7335079?v=3","gravatar_id":"","url":"https://api.github.com/users/weralabaj","html_url":"https://github.com/weralabaj","followers_url":"https://api.github.com/users/weralabaj/followers","following_url":"https://api.github.com/users/weralabaj/following{/other_user}","gists_url":"https://api.github.com/users/weralabaj/gists{/gist_id}","starred_url":"https://api.github.com/users/weralabaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weralabaj/subscriptions","organizations_url":"https://api.github.com/users/weralabaj/orgs","repos_url":"https://api.github.com/users/weralabaj/repos","events_url":"https://api.github.com/users/weralabaj/events{/privacy}","received_events_url":"https://api.github.com/users/weralabaj/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T05:33:31Z","updated_at":"2016-09-30T05:33:31Z","body":"BTW does that mean we now only modify query or that we don't change anything for RTM?"}}
{"actor":{"display_login":"weralabaj"}}