{"action":"created","issue":{"url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/612","repository_url":"https://api.github.com/repos/zendesk/ruby-kafka","labels_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/612/labels{/name}","comments_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/612/comments","events_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/612/events","html_url":"https://github.com/zendesk/ruby-kafka/pull/612","id":337771946,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4ODY5Mjc3","number":612,"title":"Clear current offsets on join group","user":{"login":"stsc3000","id":203945,"node_id":"MDQ6VXNlcjIwMzk0NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/203945?v=4","gravatar_id":"","url":"https://api.github.com/users/stsc3000","html_url":"https://github.com/stsc3000","followers_url":"https://api.github.com/users/stsc3000/followers","following_url":"https://api.github.com/users/stsc3000/following{/other_user}","gists_url":"https://api.github.com/users/stsc3000/gists{/gist_id}","starred_url":"https://api.github.com/users/stsc3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stsc3000/subscriptions","organizations_url":"https://api.github.com/users/stsc3000/orgs","repos_url":"https://api.github.com/users/stsc3000/repos","events_url":"https://api.github.com/users/stsc3000/events{/privacy}","received_events_url":"https://api.github.com/users/stsc3000/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-03T07:13:15Z","updated_at":"2018-07-05T11:47:48Z","closed_at":"2018-07-05T11:47:44Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/612","html_url":"https://github.com/zendesk/ruby-kafka/pull/612","diff_url":"https://github.com/zendesk/ruby-kafka/pull/612.diff","patch_url":"https://github.com/zendesk/ruby-kafka/pull/612.patch"},"body":"As is mentioned in a comment in Consumer#join_group, we need to make sure\r\nthat a consumer clears its stored offsets once it is no longer subscribed to a partition.\r\n\r\nThis is managed in the offset manager, however the consumer also keeps the offset\r\nin `@current_offsets`, which is used for seeking when joining a group.\r\n\r\nThis may lead to a consumer seeking to an offset that is actually already processed once re-subscribing to a partition that it was subscribed to previously.\r\n\r\nThis attempt at a solution clears `@current_offsets` exactly as is done in the offset manager.\r\n\r\nNote: I had a hard time testing the behaviour. My unit test (not included) was quite complex as I did not know how to succinctly tease joining and rejoining a group out of the consumer.\r\nI opted to create a functional spec, however I'd be interested in whether it is possible to not reach into the instances `@group` to check whether it is subscribed to a partition. Also the functional test includes _a lot_ of logging, which is meant to illustrate the behavior and will be removed if this gets accepted.\r\n\r\nAs we have noticed the issue #611 in our production environment, I'd be interested in whether our analysis of the issue is correct."},"comment":{"url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/comments/402696471","html_url":"https://github.com/zendesk/ruby-kafka/pull/612#issuecomment-402696471","issue_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/612","id":402696471,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjY5NjQ3MQ==","user":{"login":"dasch","id":6351,"node_id":"MDQ6VXNlcjYzNTE=","avatar_url":"https://avatars0.githubusercontent.com/u/6351?v=4","gravatar_id":"","url":"https://api.github.com/users/dasch","html_url":"https://github.com/dasch","followers_url":"https://api.github.com/users/dasch/followers","following_url":"https://api.github.com/users/dasch/following{/other_user}","gists_url":"https://api.github.com/users/dasch/gists{/gist_id}","starred_url":"https://api.github.com/users/dasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasch/subscriptions","organizations_url":"https://api.github.com/users/dasch/orgs","repos_url":"https://api.github.com/users/dasch/repos","events_url":"https://api.github.com/users/dasch/events{/privacy}","received_events_url":"https://api.github.com/users/dasch/received_events","type":"User","site_admin":false},"created_at":"2018-07-05T11:47:48Z","updated_at":"2018-07-05T11:47:48Z","author_association":"CONTRIBUTOR","body":"Thanks!"}}
{"actor":{"display_login":"dasch"}}