Return-Path: X-Original-To: apmail-kafka-commits-archive@www.apache.org Delivered-To: apmail-kafka-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A390C1879A for ; Wed, 6 Jan 2016 22:17:00 +0000 (UTC) Received: (qmail 15374 invoked by uid 500); 6 Jan 2016 22:17:00 -0000 Delivered-To: apmail-kafka-commits-archive@kafka.apache.org Received: (qmail 15340 invoked by uid 500); 6 Jan 2016 22:17:00 -0000 Mailing-List: contact commits-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 commits@kafka.apache.org Received: (qmail 15331 invoked by uid 99); 6 Jan 2016 22:17:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jan 2016 22:17:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4137FDFF87; Wed, 6 Jan 2016 22:17:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: junrao@apache.org To: commits@kafka.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: kafka git commit: KAFKA-2937; Disable the leaderIsr check if the topic is to be deleted. Date: Wed, 6 Jan 2016 22:17:00 +0000 (UTC) Repository: kafka Updated Branches: refs/heads/trunk 25fa39d5e -> a788c65f0 KAFKA-2937; Disable the leaderIsr check if the topic is to be deleted. The check was implemented in KAFKA-340 : If we are shutting down a broker when the ISR of a partition includes only that broker, we could lose some messages that have been previously committed. For clean shutdown, we need to guarantee that there is at least 1 other broker in ISR after the broker is shut down. When we are deleting the topic, this check can be avoided. Author: Mayuresh Gharat Reviewers: Dong Lin , Rajini Sivaram , Jun Rao Closes #729 from MayureshGharat/kafka-2937 Project: http://git-wip-us.apache.org/repos/asf/kafka/repo Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/a788c65f Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/a788c65f Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/a788c65f Branch: refs/heads/trunk Commit: a788c65f02ae493abc27fe63c6d181e6a9b8edfe Parents: 25fa39d Author: Mayuresh Gharat Authored: Wed Jan 6 14:16:56 2016 -0800 Committer: Jun Rao Committed: Wed Jan 6 14:16:56 2016 -0800 ---------------------------------------------------------------------- core/src/main/scala/kafka/controller/ReplicaStateMachine.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kafka/blob/a788c65f/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala index 32ed288..8bb9099 100755 --- a/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala +++ b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala @@ -265,7 +265,7 @@ class ReplicaStateMachine(controller: KafkaController) extends Logging { case None => true } - if (leaderAndIsrIsEmpty) + if (leaderAndIsrIsEmpty && !controller.deleteTopicManager.isPartitionToBeDeleted(topicAndPartition)) throw new StateChangeFailedException( "Failed to change state of replica %d for partition %s since the leader and isr path in zookeeper is empty" .format(replicaId, topicAndPartition))