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

chore: ignore applying the same cluster config twice #3932

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

BorysTheDev
Copy link
Contributor

fixes: #3920

added comparison for cluster config and if the new config is equal to the previous one, we do nothing

@BorysTheDev BorysTheDev force-pushed the ignore_the_same_cluster_config branch from 77413c1 to b36fd11 Compare October 15, 2024 16:25
@BorysTheDev BorysTheDev force-pushed the ignore_the_same_cluster_config branch from b36fd11 to ddc276e Compare October 15, 2024 17:15
Comment on lines +58 to +61
std::sort(lreplicas.begin(), lreplicas.end());
std::sort(lmigrations.begin(), lmigrations.end());
std::sort(rreplicas.begin(), rreplicas.end());
std::sort(rmigrations.begin(), rmigrations.end());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the class is immutable, can we sort when we construct it? we can then DCHECK here that all is sorted, and otherwise make this comparison simpler

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 it's possible, but I decided to write less because these vectors in most cases contain 0 or 1 elements. If you think that it's important I will rewrite this code

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that the code will be nicer like that (I didn't propose it for performance reasons), but it's not important :)

@BorysTheDev BorysTheDev merged commit ef814f6 into main Oct 16, 2024
12 checks passed
@BorysTheDev BorysTheDev deleted the ignore_the_same_cluster_config branch October 16, 2024 06:07
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.

Ignore repeated cluster configuration
2 participants