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-2624; Change log message position
Date Sat, 14 Nov 2015 17:26:14 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.9.0 e96b7239f -> 2261763bc


KAFKA-2624; Change log message position

Log warning message before truncating log in order to
display right offset value for the truncated log.

Author: Francois Visconte <f.visconte@criteo.com>

Reviewers: Dong Lin <lindong28@gmail.com>, Jun Rao <junrao@gmail.com>

Closes #287 from dopuskh3/KAFKA-2624

(cherry picked from commit 356544caba6448c6ba3bcdb38bea787e1fbc277b)
Signed-off-by: Jun Rao <junrao@gmail.com>


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

Branch: refs/heads/0.9.0
Commit: 2261763bca19bb1ba578775e5cce98c2450311d9
Parents: e96b723
Author: Francois Visconte <f.visconte@criteo.com>
Authored: Sat Nov 14 09:25:57 2015 -0800
Committer: Jun Rao <junrao@gmail.com>
Committed: Sat Nov 14 09:26:10 2015 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/server/ReplicaFetcherThread.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/2261763b/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 745ea2e..aa8e14f 100644
--- a/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
+++ b/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
@@ -167,9 +167,9 @@ class ReplicaFetcherThread(name: String,
         Runtime.getRuntime.halt(1)
       }
 
-      replicaMgr.logManager.truncateTo(Map(topicAndPartition -> leaderEndOffset))
       warn("Replica %d for partition %s reset its fetch offset from %d to current leader
%d's latest offset %d"
         .format(brokerConfig.brokerId, topicAndPartition, replica.logEndOffset.messageOffset,
sourceBroker.id, leaderEndOffset))
+      replicaMgr.logManager.truncateTo(Map(topicAndPartition -> leaderEndOffset))
       leaderEndOffset
     } else {
       /**


Mime
View raw message