kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject kafka git commit: KAFKA-3924; Replacing halt with exit upon LEO mismatch to trigger gra…
Date Wed, 27 Jul 2016 15:22:27 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 64842f47f -> d58c2d9ac


KAFKA-3924; Replacing halt with exit upon LEO mismatch to trigger gra…

…ceful shutdown

The patch is pretty simple and the justification is explained in https://issues.apache.org/jira/browse/KAFKA-3924

I could not find Andrew Olson, who seems to be the contributor of this part of the code, in
github so I am not sure whom I should ask to review the patch.

 the contribution is my original work and that i license the work to the project under the
project's open source license.

Author: Maysam Yabandeh <myabandeh@dropbox.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Andrew Olson <andrew.olson@cerner.com>,
Jun Rao <junrao@gmail.com>

Closes #1634 from maysamyabandeh/KAFKA-3924


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/d58c2d9a
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/d58c2d9a
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/d58c2d9a

Branch: refs/heads/trunk
Commit: d58c2d9ac6047b14ab22e19c9f7c857bb85a970d
Parents: 64842f4
Author: Maysam Yabandeh <myabandeh@dropbox.com>
Authored: Wed Jul 27 08:22:23 2016 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Wed Jul 27 08:22:23 2016 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/server/ReplicaFetcherThread.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/d58c2d9a/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala b/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
index d58f120..c6a28c6 100644
--- a/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
+++ b/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
@@ -175,10 +175,10 @@ class ReplicaFetcherThread(name: String,
       if (!LogConfig.fromProps(brokerConfig.originals, AdminUtils.fetchEntityConfig(replicaMgr.zkUtils,
         ConfigType.Topic, topicAndPartition.topic)).uncleanLeaderElectionEnable) {
         // Log a fatal error and shutdown the broker to ensure that data loss does not unexpectedly
occur.
-        fatal("Halting because log truncation is not allowed for topic %s,".format(topicAndPartition.topic)
+
+        fatal("Exiting because log truncation is not allowed for topic %s,".format(topicAndPartition.topic)
+
           " Current leader %d's latest offset %d is less than replica %d's latest offset
%d"
           .format(sourceBroker.id, leaderEndOffset, brokerConfig.brokerId, replica.logEndOffset.messageOffset))
-        Runtime.getRuntime.halt(1)
+        System.exit(1)
       }
 
       warn("Replica %d for partition %s reset its fetch offset from %d to current leader
%d's latest offset %d"


Mime
View raw message