You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/06/16 07:55:25 UTC

[GitHub] [kafka] kowshik opened a new pull request #10888: KAFKA-12955: Fix LogLoader to pass materialized view of segments for deletion

kowshik opened a new pull request #10888:
URL: https://github.com/apache/kafka/pull/10888


   Within `LogLoader.removeAndDeleteSegmentsAsync()`, we should force materialization of the `segmentsToDelete` iterable, to make sure the results of the iteration remain valid and deterministic. We should also pass only the materialized view to the logic that deletes the segments.
   
   **Tests:**
   Added the missing unit test coverage to `LogLoaderTest.testLogEndLessThanStartAfterReopen()`.
   Previously the test was in `LogTest` suite but it has been moved over now to `LogLoaderTest` suite, as it deserves to be there instead.
   This test fails without the fix, but passes with this fix:
   ```
   @Test
   def testLogEndLessThanStartAfterReopen(): Unit = {
      ...
      ...
      ...
      // Validate that the remaining segment matches our expectations
      val onlySegment = log.segments.firstSegment.get
      assertEquals(startOffset, onlySegment.baseOffset)
      assertTrue(onlySegment.log.file().exists())
      assertTrue(onlySegment.lazyOffsetIndex.file.exists())
      assertTrue(onlySegment.lazyTimeIndex.file.exists())
   }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] kowshik commented on pull request #10888: KAFKA-12955: Fix LogLoader to pass materialized view of segments for deletion

Posted by GitBox <gi...@apache.org>.
kowshik commented on pull request #10888:
URL: https://github.com/apache/kafka/pull/10888#issuecomment-862144734


   cc @junrao @dhruvilshah3 @ccding  for review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org