Kafka-1641

2017-09-19 Thread Bhavi C
We are running into KAFKA-1641 where the log cleaner thread dies with the below 
INFO. Is there a work around for this issue? We are running kafka-0.9.0.


2017-09-18 16:12:41,621 INFO kafka.log.LogCleaner: Cleaner 0: Building offset 
map for log __consumer_offsets-16 for 2149 segments in offset range [9754121, 
2628596995).
java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
9754121 but segment base offset is 9754100 for log __consumer_offsets-16.


Appreciate any inputs on this one.


Thanks,

Bhavik


[jira] [Commented] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2017-01-20 Thread Peter Davis (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15832266#comment-15832266
 ] 

Peter Davis commented on KAFKA-1641:


"Me too" on 0.10.0.1 - does this issue need to be reopened?

java.lang.IllegalArgumentException: requirement failed: Last clean 
offset is 43056300 but segment base offset is 42738384 for log -redacted- -0.
at scala.Predef$.require(Predef.scala:224)
at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:604)
at kafka.log.Cleaner.clean(LogCleaner.scala:329)
at kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:237)
at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:215)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:63)


> Log cleaner exits if last cleaned offset is lower than earliest offset
> --
>
>     Key: KAFKA-1641
> URL: https://issues.apache.org/jira/browse/KAFKA-1641
> Project: Kafka
>  Issue Type: Bug
>Affects Versions: 0.8.1.1
>Reporter: Joel Koshy
>Assignee: Guozhang Wang
> Fix For: 0.9.0.0
>
> Attachments: KAFKA-1641_2014-10-09_13:04:15.patch, KAFKA-1641.patch
>
>
> Encountered this recently: the log cleaner exited a while ago (I think 
> because the topic had compressed messages). That issue was subsequently 
> addressed by having the producer only send uncompressed. However, on a 
> subsequent restart of the broker we see this:
> In this scenario I think it is reasonable to just emit a warning and have the 
> cleaner round up its first dirty offset to the base offset of the first 
> segment.
> {code}
> [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
> java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
> 54770438 but segment base offset is 382844024 for log testtopic-0.
> at scala.Predef$.require(Predef.scala:145)
> at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
> at kafka.log.Cleaner.clean(LogCleaner.scala:288)
> at 
> kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
> at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
> at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2016-12-02 Thread yuanjiali (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15714892#comment-15714892
 ] 

yuanjiali commented on KAFKA-1641:
--

We are hitting this problem in 0.10.0.0. Log as blow:
[2016-12-02 11:33:52,744] ERROR [kafka-log-cleaner-thread-0], Error due to  
(kafka.log.LogCleaner)
java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
282330655505 but segment base offset is 0 for log __consumer_offsets-11.
at scala.Predef$.require(Predef.scala:224)
at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:617)
at kafka.log.Cleaner.clean(LogCleaner.scala:329)
at kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:237)
at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:215)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:63)
[2016-12-02 11:33:52,744] INFO [kafka-log-cleaner-thread-0], Stopped  
(kafka.log.LogCleaner)

> Log cleaner exits if last cleaned offset is lower than earliest offset
> --
>
>     Key: KAFKA-1641
> URL: https://issues.apache.org/jira/browse/KAFKA-1641
> Project: Kafka
>  Issue Type: Bug
>Affects Versions: 0.8.1.1
>Reporter: Joel Koshy
>Assignee: Guozhang Wang
> Fix For: 0.9.0.0
>
> Attachments: KAFKA-1641.patch, KAFKA-1641_2014-10-09_13:04:15.patch
>
>
> Encountered this recently: the log cleaner exited a while ago (I think 
> because the topic had compressed messages). That issue was subsequently 
> addressed by having the producer only send uncompressed. However, on a 
> subsequent restart of the broker we see this:
> In this scenario I think it is reasonable to just emit a warning and have the 
> cleaner round up its first dirty offset to the base offset of the first 
> segment.
> {code}
> [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
> java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
> 54770438 but segment base offset is 382844024 for log testtopic-0.
> at scala.Predef$.require(Predef.scala:145)
> at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
> at kafka.log.Cleaner.clean(LogCleaner.scala:288)
> at 
> kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
> at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
> at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2015-10-28 Thread Denis Zhdanov (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14977958#comment-14977958
 ] 

Denis Zhdanov commented on KAFKA-1641:
--

Ah, according to Github and release plan 0.9.0 is planned for Nov 2015 and no 
releases planned for 0.8.x *sigh*


> Log cleaner exits if last cleaned offset is lower than earliest offset
> --
>
>     Key: KAFKA-1641
> URL: https://issues.apache.org/jira/browse/KAFKA-1641
> Project: Kafka
>  Issue Type: Bug
>Affects Versions: 0.8.1.1
>Reporter: Joel Koshy
>Assignee: Guozhang Wang
> Fix For: 0.9.0.0
>
> Attachments: KAFKA-1641.patch, KAFKA-1641_2014-10-09_13:04:15.patch
>
>
> Encountered this recently: the log cleaner exited a while ago (I think 
> because the topic had compressed messages). That issue was subsequently 
> addressed by having the producer only send uncompressed. However, on a 
> subsequent restart of the broker we see this:
> In this scenario I think it is reasonable to just emit a warning and have the 
> cleaner round up its first dirty offset to the base offset of the first 
> segment.
> {code}
> [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
> java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
> 54770438 but segment base offset is 382844024 for log testtopic-0.
> at scala.Predef$.require(Predef.scala:145)
> at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
> at kafka.log.Cleaner.clean(LogCleaner.scala:288)
> at 
> kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
> at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
> at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2015-10-27 Thread Denis Zhdanov (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14977512#comment-14977512
 ] 

Denis Zhdanov commented on KAFKA-1641:
--

We are hitting that bug again and again. Is it possible to apply it to current 
0.8.x release ?
I can create PR on Github if allowed, for example.

> Log cleaner exits if last cleaned offset is lower than earliest offset
> --
>
>     Key: KAFKA-1641
> URL: https://issues.apache.org/jira/browse/KAFKA-1641
> Project: Kafka
>  Issue Type: Bug
>Affects Versions: 0.8.1.1
>Reporter: Joel Koshy
>Assignee: Guozhang Wang
> Fix For: 0.9.0.0
>
> Attachments: KAFKA-1641.patch, KAFKA-1641_2014-10-09_13:04:15.patch
>
>
> Encountered this recently: the log cleaner exited a while ago (I think 
> because the topic had compressed messages). That issue was subsequently 
> addressed by having the producer only send uncompressed. However, on a 
> subsequent restart of the broker we see this:
> In this scenario I think it is reasonable to just emit a warning and have the 
> cleaner round up its first dirty offset to the base offset of the first 
> segment.
> {code}
> [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
> java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
> 54770438 but segment base offset is 382844024 for log testtopic-0.
> at scala.Predef$.require(Predef.scala:145)
> at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
> at kafka.log.Cleaner.clean(LogCleaner.scala:288)
> at 
> kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
> at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
> at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-11-14 Thread Joe Stein (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Stein updated KAFKA-1641:
-
Fix Version/s: 0.8.3

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy
Assignee: Guozhang Wang
 Fix For: 0.8.3

 Attachments: KAFKA-1641.patch, KAFKA-1641_2014-10-09_13:04:15.patch


 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-10-23 Thread Guozhang Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14181600#comment-14181600
 ] 

Guozhang Wang commented on KAFKA-1641:
--

[~jjkoshy] Could you take another look?

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy
Assignee: Guozhang Wang
 Attachments: KAFKA-1641.patch, KAFKA-1641_2014-10-09_13:04:15.patch


 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Review Request 26390: Fix KAFKA-1641

2014-10-23 Thread Joel Koshy

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26390/#review58117
---

Ship it!


- Joel Koshy


On Oct. 9, 2014, 8:04 p.m., Guozhang Wang wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/26390/
 ---
 
 (Updated Oct. 9, 2014, 8:04 p.m.)
 
 
 Review request for kafka.
 
 
 Bugs: KAFKA-1641
 https://issues.apache.org/jira/browse/KAFKA-1641
 
 
 Repository: kafka
 
 
 Description
 ---
 
 Reset cleaning start offset upon abnormal log truncation
 
 
 Diffs
 -
 
   core/src/main/scala/kafka/log/LogCleanerManager.scala 
 e8ced6a5922508ea3274905be7c3d6e728f320ac 
 
 Diff: https://reviews.apache.org/r/26390/diff/
 
 
 Testing
 ---
 
 
 Thanks,
 
 Guozhang Wang
 




Re: Review Request 26390: Fix KAFKA-1641

2014-10-23 Thread Joel Koshy

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26390/#review58144
---



core/src/main/scala/kafka/log/LogCleanerManager.scala
https://reviews.apache.org/r/26390/#comment99062

Actually, because of the + the format specifiers are unmatched.

I will fix this on check-in.


- Joel Koshy


On Oct. 9, 2014, 8:04 p.m., Guozhang Wang wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/26390/
 ---
 
 (Updated Oct. 9, 2014, 8:04 p.m.)
 
 
 Review request for kafka.
 
 
 Bugs: KAFKA-1641
 https://issues.apache.org/jira/browse/KAFKA-1641
 
 
 Repository: kafka
 
 
 Description
 ---
 
 Reset cleaning start offset upon abnormal log truncation
 
 
 Diffs
 -
 
   core/src/main/scala/kafka/log/LogCleanerManager.scala 
 e8ced6a5922508ea3274905be7c3d6e728f320ac 
 
 Diff: https://reviews.apache.org/r/26390/diff/
 
 
 Testing
 ---
 
 
 Thanks,
 
 Guozhang Wang
 




[jira] [Updated] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-10-23 Thread Joel Koshy (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joel Koshy updated KAFKA-1641:
--
Resolution: Fixed
Status: Resolved  (was: Patch Available)

Thanks for the patch.

Pushed to trunk (after fixing the log message issue I noted on the RB)

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy
Assignee: Guozhang Wang
 Attachments: KAFKA-1641.patch, KAFKA-1641_2014-10-09_13:04:15.patch


 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-10-09 Thread Guozhang Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14165648#comment-14165648
 ] 

Guozhang Wang commented on KAFKA-1641:
--

Updated reviewboard https://reviews.apache.org/r/26390/diff/
 against branch origin/trunk

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy
Assignee: Guozhang Wang
 Attachments: KAFKA-1641.patch, KAFKA-1641_2014-10-09_13:04:15.patch


 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-10-09 Thread Guozhang Wang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guozhang Wang updated KAFKA-1641:
-
Attachment: KAFKA-1641_2014-10-09_13:04:15.patch

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy
Assignee: Guozhang Wang
 Attachments: KAFKA-1641.patch, KAFKA-1641_2014-10-09_13:04:15.patch


 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Review Request 26390: Fix KAFKA-1641

2014-10-09 Thread Guozhang Wang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26390/
---

(Updated Oct. 9, 2014, 8:04 p.m.)


Review request for kafka.


Bugs: KAFKA-1641
https://issues.apache.org/jira/browse/KAFKA-1641


Repository: kafka


Description
---

Reset cleaning start offset upon abnormal log truncation


Diffs (updated)
-

  core/src/main/scala/kafka/log/LogCleanerManager.scala 
e8ced6a5922508ea3274905be7c3d6e728f320ac 

Diff: https://reviews.apache.org/r/26390/diff/


Testing
---


Thanks,

Guozhang Wang



Re: Review Request 26390: Fix KAFKA-1641

2014-10-07 Thread Joel Koshy

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26390/#review55696
---



core/src/main/scala/kafka/log/LogCleanerManager.scala
https://reviews.apache.org/r/26390/#comment96074

Can we switch to case(topicPartition , log)?



core/src/main/scala/kafka/log/LogCleanerManager.scala
https://reviews.apache.org/r/26390/#comment96073

firstDirtyOffset = logStartOffset

Personally, I prefer this style for these kinds of statement sequences 
since all the logic for setting this val is clearly contained, but again that's 
just a preference - I'm okay with the vars also.

```
val firstDirtyOffset = {
  val offset = lastClean.getOrElse(l._1, logStartOffset)
  if (offset  logStartOffset) {
error(...)
logStartOffset
  }
  else
offset
}
```



core/src/main/scala/kafka/log/LogCleanerManager.scala
https://reviews.apache.org/r/26390/#comment96075

It seems this should be `LogToClean(l._1, l._2, firstDirtyOffset)`


- Joel Koshy


On Oct. 6, 2014, 10:21 p.m., Guozhang Wang wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/26390/
 ---
 
 (Updated Oct. 6, 2014, 10:21 p.m.)
 
 
 Review request for kafka.
 
 
 Bugs: KAFKA-1641
 https://issues.apache.org/jira/browse/KAFKA-1641
 
 
 Repository: kafka
 
 
 Description
 ---
 
 Reset cleaning start offset upon abnormal log truncation
 
 
 Diffs
 -
 
   core/src/main/scala/kafka/log/LogCleanerManager.scala 
 e8ced6a5922508ea3274905be7c3d6e728f320ac 
 
 Diff: https://reviews.apache.org/r/26390/diff/
 
 
 Testing
 ---
 
 
 Thanks,
 
 Guozhang Wang
 




Review Request 26390: Fix KAFKA-1641

2014-10-06 Thread Guozhang Wang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26390/
---

Review request for kafka.


Bugs: KAFKA-1641
https://issues.apache.org/jira/browse/KAFKA-1641


Repository: kafka


Description
---

Reset cleaning start offset upon abnormal log truncation


Diffs
-

  core/src/main/scala/kafka/log/LogCleanerManager.scala 
e8ced6a5922508ea3274905be7c3d6e728f320ac 

Diff: https://reviews.apache.org/r/26390/diff/


Testing
---


Thanks,

Guozhang Wang



[jira] [Updated] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-10-06 Thread Guozhang Wang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guozhang Wang updated KAFKA-1641:
-
Attachment: KAFKA-1641.patch

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy
 Attachments: KAFKA-1641.patch


 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-10-06 Thread Guozhang Wang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guozhang Wang updated KAFKA-1641:
-
Assignee: Guozhang Wang
  Status: Patch Available  (was: Open)

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy
Assignee: Guozhang Wang
 Attachments: KAFKA-1641.patch


 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-10-06 Thread Guozhang Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14161121#comment-14161121
 ] 

Guozhang Wang commented on KAFKA-1641:
--

Created reviewboard https://reviews.apache.org/r/26390/diff/
 against branch origin/trunk

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy
 Attachments: KAFKA-1641.patch


 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-09-19 Thread Jon Bringhurst (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14140887#comment-14140887
 ] 

Jon Bringhurst commented on KAFKA-1641:
---

I'd just like to mention that a possible workaround (depending on your 
situation) is to stop the broker, remove the cleaner offset checkpoint, and 
then start the broker again for each ISR member in serial to get the thread 
running again. Keep in mind that the cleaner will start from the beginning if 
you do this.

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy

 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (KAFKA-1641) Log cleaner exits if last cleaned offset is lower than earliest offset

2014-09-19 Thread Jon Bringhurst (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14140887#comment-14140887
 ] 

Jon Bringhurst edited comment on KAFKA-1641 at 9/19/14 5:10 PM:


I'd just like to mention that a possible workaround (depending on your 
situation in regard to keys) is to stop the broker, remove the cleaner offset 
checkpoint, and then start the broker again for each ISR member in serial to 
get the thread running again. Keep in mind that the cleaner will start from the 
beginning if you do this.


was (Author: jonbringhurst):
I'd just like to mention that a possible workaround (depending on your 
situation) is to stop the broker, remove the cleaner offset checkpoint, and 
then start the broker again for each ISR member in serial to get the thread 
running again. Keep in mind that the cleaner will start from the beginning if 
you do this.

 Log cleaner exits if last cleaned offset is lower than earliest offset
 --

 Key: KAFKA-1641
 URL: https://issues.apache.org/jira/browse/KAFKA-1641
 Project: Kafka
  Issue Type: Bug
Affects Versions: 0.8.1.1
Reporter: Joel Koshy

 Encountered this recently: the log cleaner exited a while ago (I think 
 because the topic had compressed messages). That issue was subsequently 
 addressed by having the producer only send uncompressed. However, on a 
 subsequent restart of the broker we see this:
 In this scenario I think it is reasonable to just emit a warning and have the 
 cleaner round up its first dirty offset to the base offset of the first 
 segment.
 {code}
 [kafka-server] [] [kafka-log-cleaner-thread-0], Error due to 
 java.lang.IllegalArgumentException: requirement failed: Last clean offset is 
 54770438 but segment base offset is 382844024 for log testtopic-0.
 at scala.Predef$.require(Predef.scala:145)
 at kafka.log.Cleaner.buildOffsetMap(LogCleaner.scala:491)
 at kafka.log.Cleaner.clean(LogCleaner.scala:288)
 at 
 kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:202)
 at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:187)
 at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)