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 25617200D0A for ; Wed, 4 Oct 2017 11:38:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 23DE01609E2; Wed, 4 Oct 2017 09:38:45 +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 1956C1609D6 for ; Wed, 4 Oct 2017 11:38:43 +0200 (CEST) Received: (qmail 89659 invoked by uid 500); 4 Oct 2017 09:38:42 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 89643 invoked by uid 99); 4 Oct 2017 09:38:42 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Oct 2017 09:38:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C58AF18070D for ; Wed, 4 Oct 2017 09:38:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.05 X-Spam-Level: X-Spam-Status: No, score=-0.05 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id PlP62D7uWM6a for ; Wed, 4 Oct 2017 09:38:36 +0000 (UTC) Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id EDE1E5F3D1 for ; Wed, 4 Oct 2017 09:38:35 +0000 (UTC) Received: by mail-qk0-f175.google.com with SMTP id w63so10835704qkd.10 for ; Wed, 04 Oct 2017 02:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=AONGD295zqrQbw/A+z8NG1bjJjgV/vEA7cBM1Dg3K00=; b=BHadh38hROPrubEsXVP3Oillb46a/vqwj1LacDP+zC/LYkQnusUEUNIUxz1DMMgmgB OQb3epgvXm2aV4FY0NW2SzEh7jrS0n8oO6xSAsPcaysJG5MpmUQkNpe2QOvD01Ca4g66 S5GnM2Mc9mazc83JCx6rsh0GdQgwvijUD3jsaC/rWLBcAyHyk88goJRTxiKUi5h8ie8q ykVezH//aalBNvAjfR4WR6LOefRn3sTYmjsBZdJtWZfS1+qvgqMDiLtKMF0RXkRAIe51 CRCeB7oAKLl71Wk0FVT7BV0VLW/J1W+sUzmQ74t4BV6ZZ874I2y8RMRSHxJqkP12nBPW PgQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=AONGD295zqrQbw/A+z8NG1bjJjgV/vEA7cBM1Dg3K00=; b=e/SK4IKy4GUv4KatX5PjB1FTJ0RSlelJUjzCJnn5NAkAvqNK5P/b+dv2cbl0LIPmMl IsW4AZan0lfmxc6XHYeA221SGRAh2ojcNjCzK0AFmVmgTemjsG6iVmqK+JkNz7OqN9ZZ H0YSizKcOMmbZgOeVpvdy9NUXurjXA9r9fM6n1coGhSi4F+u71glIjw1vbDLWgoIAreD TkmnrdY9/rFfjLzny354lugxVIxkczM1xnqoqgnPTqh1SXMLkJyVQp4i/4G5n5Z/pibo gP8vw0m/NqXvWtz1JJ9yYpfokChKKjpRfJCkw4C7op5cVj57LTIBV4av1rQdjK5FQDEE rYYw== X-Gm-Message-State: AMCzsaWKK7Gzc/PlzcLXk9sGSTEjl6+D2G9ERs5adXiTt3nA7pSphK5i DZjbrboSEIZozDmzHZ75ahe/h6THuYxZvOPgCZmx4Q== X-Google-Smtp-Source: AOwi7QDIixMLJP91/aq2p9xMtTLpNW/rx+PWcWwOfL7/3Gu5R3mlOmkRBaQqQxY9Sk1ZdES/Xk8E/fTLm3tPfKwWcyU= X-Received: by 10.55.40.19 with SMTP id o19mr24145646qkh.146.1507109914708; Wed, 04 Oct 2017 02:38:34 -0700 (PDT) MIME-Version: 1.0 Sender: ismaelj@gmail.com Received: by 10.12.216.179 with HTTP; Wed, 4 Oct 2017 02:37:54 -0700 (PDT) In-Reply-To: References: From: Ismael Juma Date: Wed, 4 Oct 2017 10:37:54 +0100 X-Google-Sender-Auth: BgUa8KqcIehh9WAYnZ7iVzHVxuk Message-ID: Subject: Re: [DISCUSS] KIP-201: Rationalising Policy interfaces To: dev@kafka.apache.org Content-Type: multipart/alternative; boundary="001a1136e5861a90a7055ab55f5d" archived-at: Wed, 04 Oct 2017 09:38:45 -0000 --001a1136e5861a90a7055ab55f5d Content-Type: text/plain; charset="UTF-8" Those two points are related to policies in the following sense: 1. A policy that can't send errors to clients is much less useful 2. Testing policies is much easier with `validateOnly` Ismael On Wed, Oct 4, 2017 at 9:20 AM, Tom Bentley wrote: > Thanks Edoardo, > > I've added that motivation to the KIP. > > KIP-201 doesn't address two points raised in KIP-170: Adding a > validationOnly flag to > DeleteTopicRequest and adding an error message to DeleteTopicResponse. > Since those are not policy-related I think they're best left out of > KIP-201. I suppose it is up to you and Mickael whether to narrow the scope > of KIP-170 to address those points. > > Thanks again, > > Tom > > On 4 October 2017 at 08:20, Edoardo Comar wrote: > > > Thanks Tom, > > looks got to me and KIP-201 could supersede KIP-170 > > but could you please add a missing motivation bullet that was behind > > KIP-170: > > > > introducing ClusterState to allow validation of create/alter topic > request > > > > not just against the request metadata but also > > against the current amount of resources already used in the cluster (eg > > number of partitions). > > > > thanks > > Edo > > -------------------------------------------------- > > > > Edoardo Comar > > > > IBM Message Hub > > > > IBM UK Ltd, Hursley Park, SO21 2JN > > > > > > > > From: Tom Bentley > > To: dev@kafka.apache.org > > Date: 02/10/2017 15:15 > > Subject: Re: [DISCUSS] KIP-201: Rationalising Policy interfaces > > > > > > > > Hi All, > > > > I've updated KIP-201 again so there is now a single policy interface (and > > thus a single key by which to configure it) for topic creation, > > modification, deletion and record deletion, which each have their own > > validation method. > > > > There are still a few loose ends: > > > > 1. I currently propose validateAlterTopic(), but it would be possible to > > be > > more fine grained about this: validateAlterConfig(), validAddPartitions() > > and validateReassignPartitions(), for example. Obviously this results in > a > > policy method per operation, and makes it more clear what is being > > changed. > > I guess the down side is its more work for implementer, and potentially > > makes it harder to change the interface in the future. > > > > 2. A couple of TODOs about what the TopicState interface should return > > when > > a topic's partitions are being reassigned. > > > > Your thoughts on these or any other points are welcome. > > > > Thanks, > > > > Tom > > > > On 27 September 2017 at 11:45, Paolo Patierno > wrote: > > > > > Hi Ismael, > > > > > > > > > 1. I don't have a real requirement now but "deleting" is an > operation > > > that could be really dangerous so it's always better having a way for > > > having more control on that. I know that we have the authorizer used > for > > > that (delete on topic) but fine grained control could be better (even > > > already happens for topic deletion). > > > 2. I know about the problem of restarting broker due to changes on > > > policies but what do you mean by doing that on the clients ? > > > > > > > > > Paolo Patierno > > > Senior Software Engineer (IoT) @ Red Hat > > > Microsoft MVP on Azure & IoT > > > Microsoft Azure Advisor > > > > > > Twitter : @ppatierno< > > https://urldefense.proofpoint.com/v2/url?u=http-3A__twitter. > > com_ppatierno&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r= > > EzRhmSah4IHsUZVekRUIINhltZK7U0OaeRo7hgW4_tQ&m=h-D-nA7uiy1Z-jta5y- > > yh7dKgV77XtsUnJ9Rab1gheY&s=43hzTLEDKw2v5Vh0zwkMTaaKD- > HdJD8d_F4-Bsw25-Y&e= > > > > > > Linkedin : paolopatierno< > > https://urldefense.proofpoint.com/v2/url?u=http-3A__it. > > linkedin.com_in_paolopatierno&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r= > > EzRhmSah4IHsUZVekRUIINhltZK7U0OaeRo7hgW4_tQ&m=h-D-nA7uiy1Z-jta5y- > > yh7dKgV77XtsUnJ9Rab1gheY&s=Ig0N7Nwf9EHfTJ2pH3jRM1JIdlzXw6 > R5Drocu0TMRLk&e= > > > > > > Blog : DevExperience< > > https://urldefense.proofpoint.com/v2/url?u=http-3A__ > > paolopatierno.wordpress.com_&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r= > > EzRhmSah4IHsUZVekRUIINhltZK7U0OaeRo7hgW4_tQ&m=h-D-nA7uiy1Z-jta5y- > > yh7dKgV77XtsUnJ9Rab1gheY&s=Tc9NrTtG2GP7-zRjOHkXHfYI0rncO8_ > jKpedna692z4&e= > > > > > > > > > > > > ________________________________ > > > From: ismaelj@gmail.com on behalf of Ismael Juma < > > > ismael@juma.me.uk> > > > Sent: Wednesday, September 27, 2017 10:30 AM > > > To: dev@kafka.apache.org > > > Subject: Re: [DISCUSS] KIP-201: Rationalising Policy interfaces > > > > > > A couple of questions: > > > > > > 1. Is this a concrete requirement from a user or is it hypothetical? > > > 2. You sure you would want to do this in the broker instead of the > > clients? > > > It's worth remembering that updating broker policies involves a rolling > > > restart of the cluster, so it's not the right place for things that > > change > > > frequently. > > > > > > Ismael > > > > > > On Wed, Sep 27, 2017 at 11:26 AM, Paolo Patierno > > > wrote: > > > > > > > Hi Ismael, > > > > > > > > regarding motivations for delete records, as I said during the > > discussion > > > > on KIP-204, it gives the possibility to avoid deleting messages for > > > > specific partitions (inside the topic) and starting from a specific > > > offset. > > > > I could think on some users solutions where they know exactly what > the > > > > partitions means in a specific topic (because they are using a custom > > > > partitioner on the producer side) so they know what kind of messages > > are > > > > inside a partition allowing to delete them but not the others. In > > such a > > > > policy a user could also check the timestamp related to the offset > for > > > > allowing or not deletion on time base. > > > > > > > > > > > > Paolo Patierno > > > > Senior Software Engineer (IoT) @ Red Hat > > > > Microsoft MVP on Azure & IoT > > > > Microsoft Azure Advisor > > > > > > > > Twitter : @ppatierno< > > https://urldefense.proofpoint.com/v2/url?u=http-3A__twitter. > > com_ppatierno&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r= > > EzRhmSah4IHsUZVekRUIINhltZK7U0OaeRo7hgW4_tQ&m=h-D-nA7uiy1Z-jta5y- > > yh7dKgV77XtsUnJ9Rab1gheY&s=43hzTLEDKw2v5Vh0zwkMTaaKD- > HdJD8d_F4-Bsw25-Y&e= > > > > > > > Linkedin : paolopatierno< > > https://urldefense.proofpoint.com/v2/url?u=http-3A__it. > > linkedin.com_in_paolopatierno&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r= > > EzRhmSah4IHsUZVekRUIINhltZK7U0OaeRo7hgW4_tQ&m=h-D-nA7uiy1Z-jta5y- > > yh7dKgV77XtsUnJ9Rab1gheY&s=Ig0N7Nwf9EHfTJ2pH3jRM1JIdlzXw6 > R5Drocu0TMRLk&e= > > > > > > > Blog : DevExperience< > > https://urldefense.proofpoint.com/v2/url?u=http-3A__ > > paolopatierno.wordpress.com_&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r= > > EzRhmSah4IHsUZVekRUIINhltZK7U0OaeRo7hgW4_tQ&m=h-D-nA7uiy1Z-jta5y- > > yh7dKgV77XtsUnJ9Rab1gheY&s=Tc9NrTtG2GP7-zRjOHkXHfYI0rncO8_ > jKpedna692z4&e= > > > > > > > > > > > > > > > ________________________________ > > > > From: ismaelj@gmail.com on behalf of Ismael > Juma < > > > > ismael@juma.me.uk> > > > > Sent: Wednesday, September 27, 2017 10:18 AM > > > > To: dev@kafka.apache.org > > > > Subject: Re: [DISCUSS] KIP-201: Rationalising Policy interfaces > > > > > > > > A couple more comments: > > > > > > > > 1. "If this KIP is accepted for Kafka 1.1.0 this removal could happen > > in > > > > Kafka 1.2.0 or a later release." -> we only remove code in major > > > releases. > > > > So, if it's deprecated in 1.1.0, it would be removed in 2.0.0. > > > > > > > > 2. Deleting all messages in a topic is not really the same as > deleting > > a > > > > topic. The latter will cause consumers and producers to error out > > while > > > the > > > > former will not. It would be good to motivate the need for the delete > > > > records policy more. > > > > > > > > Ismael > > > > > > > > On Wed, Sep 27, 2017 at 11:12 AM, Ismael Juma > > wrote: > > > > > > > > > Another quick comment: the KIP states that having multiple > > interfaces > > > > > imply that the logic must be in 2 places. That is not true because > > the > > > > same > > > > > class can implement multiple interfaces (this aspect was considered > > > when > > > > we > > > > > decided to introduce policies incrementally). > > > > > > > > > > The main reason why I think the original approach doesn't work well > > is > > > > > that there is no direct mapping between an operation and the > policy. > > > That > > > > > is, we initially thought we would have create/alter/delete topics, > > but > > > > that > > > > > didn't work out as the alter case is better served by multiple > > request > > > > > types. Given that, it's a bit awkward to maintain the original > > approach > > > > and > > > > > a policy for topic management seemed easier to understand. On that > > > note, > > > > > would `TopicManagementPolicy` be a better name? > > > > > > > > > > Looking at the updated KIP, I notice that we actually have a > > > > > TopicDeletionPolicy with a separate config. That seems to be a > > halfway > > > > > house. Not sure about that. > > > > > > > > > > Ismael > > > > > > > > > > On Wed, Sep 27, 2017 at 10:47 AM, Tom Bentley > > > > > > > wrote: > > > > > > > > > >> I have updated the KIP to add a common policy interface for topic > > and > > > > >> message deletion. This included pulling ClusterState and > TopicState > > > > >> interfaces up to the top level so that they can be shared between > > the > > > > two > > > > >> policies. > > > > >> > > > > >> Cheers, > > > > >> > > > > >> Tom > > > > >> > > > > >> On 26 September 2017 at 18:09, Edoardo Comar > > > wrote: > > > > >> > > > > >> > Thanks Tom, > > > > >> > In my original KIP-170 I mentioned that the method > > > > >> > > > > > >> > public Map topicsPartitionCount(); > > > > >> > > > > > >> > was just a starting point for a general purpose ClusterState > > > > >> > as it happened to be exactly the info we needed for our policy > > > > >> > implementation :-) > > > > >> > it definitely doesn't feel general purpose enough. > > > > >> > > > > > >> > what about > > > > >> > > > > > >> > interface ClusterState { > > > > >> > public TopicState topicState(String topicName); > > > > >> > public Set topics(); > > > > >> > } > > > > >> > > > > > >> > I think that the implementation of ClusterState that the server > > will > > > > >> pass > > > > >> > to the policy.validate method > > > > >> > would just lazily tap into MetadataCache. No need for big > upfront > > > > >> > allocations. > > > > >> > > > > > >> > ciao, > > > > >> > Edo > > > > >> > -------------------------------------------------- > > > > >> > > > > > >> > Edoardo Comar > > > > >> > > > > > >> > IBM Message Hub > > > > >> > > > > > >> > IBM UK Ltd, Hursley Park, SO21 2JN > > > > >> > > > > > >> > > > > > >> > > > > > >> > From: Tom Bentley > > > > >> > To: dev@kafka.apache.org > > > > >> > Date: 26/09/2017 17:39 > > > > >> > Subject: Re: [DISCUSS] KIP-201: Rationalising Policy > > > interfaces > > > > >> > > > > > >> > > > > > >> > > > > > >> > Hi Edoardo, > > > > >> > > > > > >> > > > > > >> > what about a single method in ClusterState > > > > >> > > > > > > >> > > interface ClusterState { > > > > >> > > public Map topicsState(); > > > > >> > > > > > > >> > > } > > > > >> > > > > > > >> > > which could return a read-only snapshot of the cluster > metadata > > ? > > > > >> > > > > > > >> > > > > > >> > Sure that would work too. A concern with that is that we end up > > > > >> allocating > > > > >> > a potentially rather large amount for the Map and the > collections > > > > >> present > > > > >> > in the TopicStates in order to provide the snapshot. The caller > > > might > > > > >> only > > > > >> > be interested in one item from the TopicState for one topic in > > the > > > > map. > > > > >> > Accessing this information via methods means the caller only > pays > > > for > > > > >> what > > > > >> > they use. > > > > >> > > > > > >> > Cheers, > > > > >> > > > > > >> > Tom > > > > >> > > > > > >> > > > > > >> > > > > > >> > Unless stated otherwise above: > > > > >> > IBM United Kingdom Limited - Registered in England and Wales > with > > > > number > > > > >> > 741598. > > > > >> > Registered office: PO Box 41, North Harbour, Portsmouth, > > Hampshire > > > PO6 > > > > >> 3AU > > > > >> > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > Unless stated otherwise above: > > IBM United Kingdom Limited - Registered in England and Wales with number > > 741598. > > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 > 3AU > > > --001a1136e5861a90a7055ab55f5d--