{"action":"created","issue":{"url":"https://api.github.com/repos/rackerlabs/otter/issues/1250","labels_url":"https://api.github.com/repos/rackerlabs/otter/issues/1250/labels{/name}","comments_url":"https://api.github.com/repos/rackerlabs/otter/issues/1250/comments","events_url":"https://api.github.com/repos/rackerlabs/otter/issues/1250/events","html_url":"https://github.com/rackerlabs/otter/pull/1250","id":64580957,"number":1250,"title":"Stop using versions for dirty flags, switch to one dirty flag per request","user":{"login":"radix","id":227068,"avatar_url":"https://avatars.githubusercontent.com/u/227068?v=3","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-26T16:53:57Z","updated_at":"2015-03-26T17:25:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rackerlabs/otter/pulls/1250","html_url":"https://github.com/rackerlabs/otter/pull/1250","diff_url":"https://github.com/rackerlabs/otter/pull/1250.diff","patch_url":"https://github.com/rackerlabs/otter/pull/1250.patch"},"body":"The goal here is to allow us to use a ZooKeeper \"child watch\" to receive immediate notification when a convergence request is made. The current system of only having one dirty flag that has its version bumped every convergence request doesn't work, because ZK child watches don't get triggered when child versions get bumped. They only get triggered when children are created or deleted. Thus, this PR changes the dirty bookkeeping to create a new node for every ZK request, with a random suffix. This allows us to create a child watch on /groups/divergent and get all the events we need to immediately converge when necessary.\r\n\r\nThe downside to this is that we lose the optimization in the old version-based approach, which allowed us to only converge once even if multiple requests have been received. With this system there will always be one convergence per request, which is not the end of the world but also not as efficient as it could be.\r\n\r\nIf anyone has any better ideas on how to do this so that we can maintain that optimization, please let me know.\r\n\r\nNote that this PR does not implement the ZK watcher just yet, it just changes the dirty flag formatting."},"comment":{"url":"https://api.github.com/repos/rackerlabs/otter/issues/comments/86632159","html_url":"https://github.com/rackerlabs/otter/pull/1250#issuecomment-86632159","issue_url":"https://api.github.com/repos/rackerlabs/otter/issues/1250","id":86632159,"user":{"login":"lvh","id":97816,"avatar_url":"https://avatars.githubusercontent.com/u/97816?v=3","gravatar_id":"","url":"https://api.github.com/users/lvh","html_url":"https://github.com/lvh","followers_url":"https://api.github.com/users/lvh/followers","following_url":"https://api.github.com/users/lvh/following{/other_user}","gists_url":"https://api.github.com/users/lvh/gists{/gist_id}","starred_url":"https://api.github.com/users/lvh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvh/subscriptions","organizations_url":"https://api.github.com/users/lvh/orgs","repos_url":"https://api.github.com/users/lvh/repos","events_url":"https://api.github.com/users/lvh/events{/privacy}","received_events_url":"https://api.github.com/users/lvh/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T17:25:38Z","updated_at":"2015-03-26T17:25:38Z","body":"LGTM, thanks for working on this."}}