{"action":"created","issue":{"url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/175","labels_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/175/comments","events_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/175/events","html_url":"https://github.com/SOHU-Co/kafka-node/issues/175","id":62247780,"number":175,"title":"Kafka-Node: Producer never get notified when a partition moved to new broker on auto rebalance.","user":{"login":"lsampathreddy","id":11512007,"avatar_url":"https://avatars.githubusercontent.com/u/11512007?v=3","gravatar_id":"","url":"https://api.github.com/users/lsampathreddy","html_url":"https://github.com/lsampathreddy","followers_url":"https://api.github.com/users/lsampathreddy/followers","following_url":"https://api.github.com/users/lsampathreddy/following{/other_user}","gists_url":"https://api.github.com/users/lsampathreddy/gists{/gist_id}","starred_url":"https://api.github.com/users/lsampathreddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsampathreddy/subscriptions","organizations_url":"https://api.github.com/users/lsampathreddy/orgs","repos_url":"https://api.github.com/users/lsampathreddy/repos","events_url":"https://api.github.com/users/lsampathreddy/events{/privacy}","received_events_url":"https://api.github.com/users/lsampathreddy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-17T00:59:45Z","updated_at":"2015-03-17T06:36:51Z","closed_at":null,"body":"Scenario,\r\nI have two brokers (broker 1 & broker 2) with  auto.leader.rebalance.enable=true. \r\nCreate TEST topic with replica: 2, partitions 8.\r\nUse a producer to push message on TEST topic.\r\n\r\n when i stopped a broker1, broker2 became leader for all the partitions. few mins later broker1 comes online. after leader.imbalance.check.interval.seconds, all partitions are distribute among two brokers but my producer never gets notified to refresh the metadata. \r\n there after some msgs are getting failing because of payload was sending to broker w/ invalid or non-exist partition.\r\n\r\nIs it right behavior of Producer? or am i doing wrong?"},"comment":{"url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/comments/82151275","html_url":"https://github.com/SOHU-Co/kafka-node/issues/175#issuecomment-82151275","issue_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/175","id":82151275,"user":{"login":"kadishmal","id":978004,"avatar_url":"https://avatars.githubusercontent.com/u/978004?v=3","gravatar_id":"","url":"https://api.github.com/users/kadishmal","html_url":"https://github.com/kadishmal","followers_url":"https://api.github.com/users/kadishmal/followers","following_url":"https://api.github.com/users/kadishmal/following{/other_user}","gists_url":"https://api.github.com/users/kadishmal/gists{/gist_id}","starred_url":"https://api.github.com/users/kadishmal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadishmal/subscriptions","organizations_url":"https://api.github.com/users/kadishmal/orgs","repos_url":"https://api.github.com/users/kadishmal/repos","events_url":"https://api.github.com/users/kadishmal/events{/privacy}","received_events_url":"https://api.github.com/users/kadishmal/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T06:36:51Z","updated_at":"2015-03-17T06:36:51Z","body":"Which producer are you using: low level or high level?\r\n\r\nThe low level producer, I think, doesn't do this detection job. Not sure, thought. But the high level producer may handle this scenario.\r\n\r\nThe desirable behavior of the high level producer, in my opinion, should be as follows:\r\n\r\n1. The producer sends messages to a non-existing partition which might have moved to a different broker.\r\n2. The producer receives an error from the server.\r\n3. If the error says that the partition is not found, then the producer should try to refresh its metadata.\r\n4. Then try sending again to the same partition found in another broker.\r\n5. If the partition is not found after refreshing the metadata, then should escalate the error to the client.\r\n\r\n@haio what do you say?"}}