Skip to content
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

KAFKA-18634: Fix ELR metadata version issues #18680

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

Conversation

CalvinConfluent
Copy link
Contributor

  • Clean up the places that should not use MV to determine ELR is enabled

  • Mark 4.0IV1 stable.

https://issues.apache.org/jira/browse/KAFKA-18634

@github-actions github-actions bot added triage PRs from the community core Kafka Broker kraft labels Jan 23, 2025
Copy link
Contributor Author

@CalvinConfluent CalvinConfluent left a comment

Choose a reason for hiding this comment

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

Most of the changes are because the PartitionRecord needs the feature version to determine if it should keep the ELR related fields. So I added the finalized features to the ImageWriterOptions.

@github-actions github-actions bot removed the triage PRs from the community label Jan 24, 2025
Copy link
Contributor

@ahuang98 ahuang98 left a comment

Choose a reason for hiding this comment

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

Just for my understanding, how is ELRV_1 currently enabled? Is it currently only possible via the storage tool feature argument?

also noticed

  • EligibleLeaderReplicasVersion.isEligibleLeaderReplicasFeatureEnabeld() has a typo and seems to be dead code
  • EligibleLeaderReplicasVersion.fromFeatureLevel(short version) also seems unused

@@ -113,15 +113,15 @@ public enum MetadataVersion {
// Bootstrap metadata version for version 1 of the GroupVersion feature (KIP-848).
IBP_4_0_IV0(22, "4.0", "IV0", false),

// Add ELR related supports (KIP-966).
Copy link
Contributor

Choose a reason for hiding this comment

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

Jira mentioned we should include what metadata records changed, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -30,6 +31,7 @@ public final class ImageWriterOptions {
public static class Builder {
private MetadataVersion metadataVersion;
private MetadataVersion requestedMetadataVersion;
private Map<String, Short> finalizedFeatures;
Copy link
Contributor

Choose a reason for hiding this comment

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

can we derive the MetadataVersion from the finalizedFeatures map? or alternatively just store EligibleLeaderReplicasVersion instead of the whole features map

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@github-actions github-actions bot added the small Small PRs label Feb 3, 2025
@@ -387,7 +387,7 @@ public ApiMessageAndVersion toRecord(Uuid topicId, int partitionId, ImageWriterO
setLeaderRecoveryState(leaderRecoveryState.value()).
setLeaderEpoch(leaderEpoch).
setPartitionEpoch(partitionEpoch);
if (options.metadataVersion().isElrSupported()) {
if (options.isEligibleLeaderReplicasEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the case where metadata is lost, we need to use the lossHandler to print a warning message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assume it is not relevant to this PR but I add the metadata check here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants