hachikuji commented on pull request #9590: URL: https://github.com/apache/kafka/pull/9590#issuecomment-790932209
@jolshan The active segment would not be replaced during cleaning at a minimum. I think the recovery logic we want is to scan backwards through the `.swap` files and collect the segments to replace. Maybe something like this? For each swap file in reverse order: - If the next earliest swap file exists, then collect any segments which have a has a base offset larger than the end offset in the next earliest swap and an end offset less than that of the swap segment itself. - If no next earliest swap file exists, then collect all segments which have an end offset less than that of the swap file itself. - Call `replaceSegments` with the swap file and the collected log segments ---------------------------------------------------------------- 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: [email protected]
