Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 74791200C52 for ; Mon, 10 Apr 2017 15:57:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7305C160B99; Mon, 10 Apr 2017 13:57:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BA576160B85 for ; Mon, 10 Apr 2017 15:57:08 +0200 (CEST) Received: (qmail 89151 invoked by uid 500); 10 Apr 2017 13:57:07 -0000 Mailing-List: contact dev-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list dev@flink.apache.org Received: (qmail 89140 invoked by uid 99); 10 Apr 2017 13:57:07 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2017 13:57:07 +0000 Received: from MacBook.local.mail (unknown [209.49.240.226]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 558131A002E for ; Mon, 10 Apr 2017 13:57:07 +0000 (UTC) Date: Mon, 10 Apr 2017 06:57:06 -0700 From: "Tzu-Li (Gordon) Tai" To: dev@flink.apache.org Message-ID: In-Reply-To: References: Subject: Re: Possible bug in Kafka producer partitioning logic X-Mailer: Airmail (420) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="58eb8f32_1136a914_800c" archived-at: Mon, 10 Apr 2017 13:57:09 -0000 --58eb8f32_1136a914_800c Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I would prefer to make this a blocker for a future bugfix actually, and n= ot 1.2.1. The reason is that to fix this properly we might need to look again into = (and possibly change) how partitioners are provided. The main problem is that the =60open=60 method can only possibly be calle= d once with the partitions of one topic. So, we might need the user to provide multiple partitioners, one for each= of all the possible topics that will be written to. One way or another, my gut feeling is that this would need somewhat sligh= t change to the Kafka producer APIs. And I=E2=80=99m not so sure of rushing API changes into releases. On April 10, 2017 at 6:46:29 AM, Gyula =46=C3=B3ra (gyula.fora=40gmail.co= m) wrote: Thanks for checking this out. =20 I would say this is definitely a blocking issue for the bugfix release, =20 what do you think=3F =20 Gyula =20 Tzu-Li (Gordon) Tai ezt =C3=ADrta (id=C5=91pont: = 2017. =C3=A1pr. =20 10., H, 15:39): =20 Hi Gyula, =20 Yes, I think the semantics of the Partitioner interface is a bit off. =20 The =60numPartitions=60 value ideally should be the number of partitions = of the =20 =60targetTopic=60. =20 Here=E2=80=99s a JIRA I just filed to track the issue: =20 https://issues.apache.org/jira/browse/=46LINK-6288. =20 Cheers, =20 Gordon =20 On April 10, 2017 at 1:16:18 AM, Gyula =46=C3=B3ra (gyula.fora=40gmail.co= m) wrote: =20 Hi all, =20 We had some problems with custom partitioning for the 0.8 Kafka producer = =20 and now that I checked the code it seems there might be a problem with th= e =20 logic. =20 The producer determines the number of partitions in the open method and =20 seems to be using that as a value passed to the custom partitioner for =20 producing the records. =20 This will however only work if the defaultTopicId (topic) has the same =20 number of partitions as all other topics in the kafka cluster when =20 producing to multiple topics. =20 In our case the default topic had 16 and new ones have 3 as default so it= =20 gives an out of range partition error. =20 Is my understanding correct or am I overlooking something=3F =20 Thank you=21 =20 Gyula =20 --58eb8f32_1136a914_800c--