Skip to content

Conversation

@LiebingYu
Copy link
Contributor

Purpose

Linked issue: close #1716

Brief change log

Tests

API and Format

Documentation

@LiebingYu LiebingYu force-pushed the fix-corrupt-index-new branch 2 times, most recently from b9b5f2d to ceaf704 Compare September 24, 2025 07:50
@LiebingYu
Copy link
Contributor Author

Ready for CR @wuchong @swuferhong

Copy link
Contributor

@swuferhong swuferhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LiebingYu Thanks for your work. I left some comments.

@LiebingYu LiebingYu force-pushed the fix-corrupt-index-new branch from ceaf704 to 1e8a582 Compare September 25, 2025 14:06
// can potentially skip over more segments.
LogTablet.rebuildWriterState(
writerStateManager, logSegments, 0, segment.getBaseOffset(), false);
int bytesTruncated = segment.recover();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to pass writerStateManager into segment.recover() to update writer state like how kafka does? cc @swuferhong

segment.getFileLogRecords().file().getAbsoluteFile());
}
recoverSegment(segment);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we catch CorruptIndexException and recover segment for this case like how kafka does? And we should rethrow other exceptions in else branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Kafka throw CorruptIndexException because Kafka will do sanity check for transaction file which may throw CorruptIndexException. But here in fluss we don't do sanity check of index files in segment.sanityCheck. So I think we don't need to catch CorruptIndexException here.
  2. The caller of this function will take care of the IOException, maybe we don't need to process other IOException here?

@wuchong
Copy link
Member

wuchong commented Nov 4, 2025

I added a commit to fix the IOException signature problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReplicaFetcherThread keeps throwing UnknownServerException because of corrupt index file

3 participants