Skip to content

MINOR: Refactor LockUtils and improve comments (follow up to KAFKA-19390) #20131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

Forest0923
Copy link
Contributor

This PR performs a refactoring of LockUtils and improves inline comments, as a follow-up to #19961.

@github-actions github-actions bot added triage PRs from the community core Kafka Broker storage Pull requests that target the storage module small Small PRs labels Jul 9, 2025
@github-actions github-actions bot removed the triage PRs from the community label Jul 10, 2025
Copy link
Contributor

@junrao junrao left a comment

Choose a reason for hiding this comment

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

@Forest0923 : Thanks for the PR. Just a minor comment.

// Serializes all index operations that mutate internal state
// Serializes all index operations that mutate internal state.
// Readers do not need to acquire this lock because:
// 1) They only access published entries and are not affected by concurrent writes.
Copy link
Contributor

Choose a reason for hiding this comment

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

How about the following?

Clients only read committed data and are not affected by concurrent appends/truncates. In the rare case, when the data is truncated, the follower could read inconsistent data. The follower has the logic to ignore the inconsistent data through crc and leader epoch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I've updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved core Kafka Broker small Small PRs storage Pull requests that target the storage module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants