----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/26346/#review55526 -----------------------------------------------------------
core/src/main/scala/kafka/log/Log.scala <https://reviews.apache.org/r/26346/#comment95904> We probably should enforce that a segment is never larger than config.segmentSize. So, if messageSize is larger than config.segmentSize, we should just throw an exception. Once we do that, it seems that we can just use the following check to cover both conditions. if (segment.size + messageSize > (long) config.segmentSize We likely need to adjust the comment above accordingly. - Jun Rao On Oct. 6, 2014, 4:48 p.m., Sriharsha Chintalapani wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/26346/ > ----------------------------------------------------------- > > (Updated Oct. 6, 2014, 4:48 p.m.) > > > Review request for kafka. > > > Bugs: KAFKA-1670 > https://issues.apache.org/jira/browse/KAFKA-1670 > > > Repository: kafka > > > Description > ------- > > KAFKA-1670. Corrupt log files for segment.bytes values close to Int.MaxInt. > > > Diffs > ----- > > core/src/main/scala/kafka/log/Log.scala > 0ddf97bd30311b6039e19abade41d2fbbad2f59b > > Diff: https://reviews.apache.org/r/26346/diff/ > > > Testing > ------- > > > Thanks, > > Sriharsha Chintalapani > >