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 C7C4D200B74 for ; Thu, 1 Sep 2016 18:00:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C632D160AB5; Thu, 1 Sep 2016 16:00:29 +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 16160160AA8 for ; Thu, 1 Sep 2016 18:00:28 +0200 (CEST) Received: (qmail 45528 invoked by uid 500); 1 Sep 2016 16:00:28 -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 45503 invoked by uid 99); 1 Sep 2016 16:00:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2016 16:00:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 629FFC3425 for ; Thu, 1 Sep 2016 16:00:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id zdF4OBSoPM0Y for ; Thu, 1 Sep 2016 16:00:25 +0000 (UTC) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id C1A3E5F242 for ; Thu, 1 Sep 2016 16:00:24 +0000 (UTC) Received: by mail-wm0-f53.google.com with SMTP id 1so103166934wmz.1 for ; Thu, 01 Sep 2016 09:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=4UxxL65v0c4mB/ZgfQyrM58je2AYDw22VB6uX8UQn2w=; b=057dAqAWzfMWODp2STz7MIxrS7EPFiiGQeExj63wPPaoleGYjQmseVYwPV6Zf1BFzD YOspyiCGPuCmuMPsJEmkRh4NqNBpHySFVRu2YrRFM0wzDng12LPgsradoNt5msbYt0pT O12PYtxXymBR5Y9tlgWnnEVt7aMQGmgyaJvv7Y9bbAY287OstaAISQUGV422kc4Bfaav IOLq4YzQqJn/hnMUcyLTk4xa5M00cDfv3DfSTa0mBvWDpkWuJ75NJ5WgGcbZHxqgvynN LJMT4cLbKQfbGyaD1M5QJRpWztFSwVurwcthirloux8JlO3tgz1IKXSWoAKyAsC58EKs sTWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4UxxL65v0c4mB/ZgfQyrM58je2AYDw22VB6uX8UQn2w=; b=fsYEui/30tiPBR+vuA41i25m7lhtWmNvqaaeJCp6WRLiFwi28VCykdCZO1CHje/HJx t3KSstoTocrozwy0xt4WXJ6WLfTvq0eBKsDfu4QR0ts17rghyf1vTKCmSNq6T5k0TzGu iVlqjvWlgXZAz3S+fj0V32LhqP0nlT25EEhQFVyo7m5NYDa9swlSQPi3JgcXtDz35lnq Nfn8pmCNlfXbZJI0bLDGtUxypJGcznrbO/SZVac8o3ZcWtmCZwiFHJHX7q+BJJ2yoYac MF/4dX4TX9CQiA7uQfd59K7Vo/rlP4fSoISK2jIxZRktACbYtgS5/84TePzGkUHV2FWB MbOw== X-Gm-Message-State: AE9vXwPMylXxIDcL+/rO1ZG5ZHQYgdjOFQhfeFH5LcPSzIwMRP4NfEooQgOQ9s0LyTnKR/IipK8zheNaiMog7Q== X-Received: by 10.28.63.8 with SMTP id m8mr29195593wma.88.1472745624041; Thu, 01 Sep 2016 09:00:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.29.204 with HTTP; Thu, 1 Sep 2016 09:00:22 -0700 (PDT) From: Florian Hussonnois Date: Thu, 1 Sep 2016 18:00:22 +0200 Message-ID: Subject: PartitionAssignor / Sort members per subscription time before assigning partitions To: dev@kafka.apache.org Content-Type: multipart/alternative; boundary=001a114b2ef4c42358053b744f50 archived-at: Thu, 01 Sep 2016 16:00:30 -0000 --001a114b2ef4c42358053b744f50 Content-Type: text/plain; charset=UTF-8 Hi Kafka Team, I would like to have your opinion before creating a new JIRA. I'm working with the Java Consumer API. The current partition assignors use the consumer ids to sort members before assigning partitions. This works pretty well as long as all consumers are started into the same JVM and no more consumers than the number of partitions are created. However, in many cases consumers are distributed across multiple hosts. To continue consuming with an optimal number of consumers (even with a host failure) we can create as many consumers as partitions on each host. For example, we have two consumers C0, C1 each on a dedicated host and one topic with 4 partitions. With current assignors it is not possible to have 2 consuming threads and 2 idle threads per host. Instead of that, C0 will have 4 consuming threads and C1 will have 4 idle threads. One solution could be to keep a timestamp the first time a member subscribes to a topic. This timestamp can then be used to sort members for the partitions assignment. In this way, the partition assignment will be more predictable as it will not depend on member ids. One drawback of this solution is that the consumer responsible of assignments will keep a local state. Thanks, -- Florian --001a114b2ef4c42358053b744f50--