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

Enable multi version single step downgrade for KRaft based clusters #10929

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

Conversation

MichaelMorrisEst
Copy link
Contributor

@MichaelMorrisEst MichaelMorrisEst commented Dec 9, 2024

Type of change

Select the type of your PR

  • Enhancement / new feature

Description

Closes #10928
Introduces handling for encountering an unknown Kafka version in downgrade of a KRaft based cluster in order to enable multi version single step downgrade

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

@MichaelMorrisEst MichaelMorrisEst force-pushed the issue-10928 branch 2 times, most recently from 9b600bd to 38f90ce Compare December 9, 2024 21:59
Signed-off-by: MichaelMorris <michael.morris@est.tech>
@scholzj
Copy link
Member

scholzj commented Feb 13, 2025

@MichaelMorrisEst I guess this is ready for review and should match the approved proposal now, or?

@scholzj scholzj added this to the 0.46.0 milestone Feb 13, 2025
try {
versionFrom = versions.version(highestKafkaVersion);
} catch (KafkaUpgradeException exception) {
// From version is unknown but thats ok for downgrade
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should log some warning here? If nothing else, it would be useful to have it tracked as part of the logs in case we are analyzing issues etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will add a log statement

Copy link
Member

Choose a reason for hiding this comment

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

Should this be also unit tested for example here? KafkaUpgradeDowngradeWithKRaftMockTest

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

@scholzj
Copy link
Member

scholzj commented Feb 13, 2025

/azp run regression

@scholzj
Copy link
Member

scholzj commented Feb 13, 2025

/azp run upgrade

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: MichaelMorris <michael.morris@est.tech>
@MichaelMorrisEst
Copy link
Contributor Author

@MichaelMorrisEst I guess this is ready for review and should match the approved proposal now, or?

Yes

Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

Comment on lines 98 to 103
public static String getHigherVersionThanLatest() {
String[] parsedVersion = LATEST_KAFKA_VERSION.split("\\.");
int incrementedMinorVersion = Integer.parseInt(parsedVersion[1]) + 1;
parsedVersion[1] = Integer.toString(incrementedMinorVersion);
return String.join(".", parsedVersion);
}
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to have instead some constant with something like 99.0.0?

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

@scholzj
Copy link
Member

scholzj commented Feb 19, 2025

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Member

scholzj commented Feb 19, 2025

/azp run upgrade

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: MichaelMorris <michael.morris@est.tech>
Co-authored-by: Paolo Patierno <paolo.patierno@gmail.com>
Signed-off-by: Michael Morris <105736419+MichaelMorrisEst@users.noreply.github.com>
Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

[Enhancement]: Enable multi version single step downgrade for KRaft based clusters
4 participants