-
Notifications
You must be signed in to change notification settings - Fork 592
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
Fix enabling whole topic no-op check #15071
Conversation
Previously we incorrectly assumed that fully enabling a partially disabled topic is a no-op. This is a no-op is if the topic was previously fully enabled.
a9fb5f9
to
37dd96c
Compare
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/41497#018bf250-3ad4-458d-a3af-be085b0382c1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
@@ -4418,12 +4418,12 @@ struct topic_disabled_partitions_set | |||
bool is_disabled(model::partition_id id) const { | |||
return !partitions || partitions->contains(id); | |||
} | |||
bool is_topic_disabled() const { return !partitions.has_value(); } | |||
bool is_empty() const { return partitions && partitions->empty(); } | |||
bool is_fully_disabled() const { return !partitions.has_value(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a general question, for my understanding, is there a difference between partitions=std::nullopt and partitions.empty() = true? Curious if we really need an optional here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference is explained in the comment a few lines earlier - partitions=nullopt means all partitions are disabled. It looks a bit awkward but I thought that this is better than having a separate "all disabled" flag.
Previously we incorrectly assumed that fully enabling a partially disabled topic is a no-op. This is a no-op only if the topic was previously fully enabled.
Backports Required
Release Notes