This is an automated email from the ASF dual-hosted git repository.

guozhang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new bc6873a  MINOR: To verify segment.hasOverflow, the path of the segment 
should be printed (#10925)
bc6873a is described below

commit bc6873a61bf0f718a4a614fe4b442438763bf4b6
Author: 阿洋 <xinzhuxiansh...@126.com>
AuthorDate: Mon Jun 28 11:32:06 2021 +0800

    MINOR: To verify segment.hasOverflow, the path of the segment should be 
printed (#10925)
    
    When refer to the return "Check whether the last offset of the last batch 
in this segment overflows the indexes", if the result is not expected, the path 
of the segment should be printed so that users can find problems.
    
    Reviewers: Luke Chen, Guozhang Wang <wangg...@gmail.com>
---
 core/src/main/scala/kafka/log/Log.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/scala/kafka/log/Log.scala 
b/core/src/main/scala/kafka/log/Log.scala
index bccd2a3..69851da 100644
--- a/core/src/main/scala/kafka/log/Log.scala
+++ b/core/src/main/scala/kafka/log/Log.scala
@@ -2594,7 +2594,7 @@ object Log extends Logging {
                                           producerStateManager: 
ProducerStateManager,
                                           logPrefix: String): List[LogSegment] 
= {
     require(Log.isLogFile(segment.log.file), s"Cannot split file 
${segment.log.file.getAbsoluteFile}")
-    require(segment.hasOverflow, "Split operation is only permitted for 
segments with overflow")
+    require(segment.hasOverflow, s"Split operation is only permitted for 
segments with overflow, and the problem path is 
${segment.log.file.getAbsoluteFile}")
 
     info(s"${logPrefix}Splitting overflowed segment $segment")
 

Reply via email to