-
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
c/topic_config: Explicitly initialize non-class fields #23149
c/topic_config: Explicitly initialize non-class fields #23149
Conversation
Since we need a default constructor to keep serde happy.
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.
do we not backport because it's "just tests"?
i think we should still backport it |
Happy to do so. I didn't realize this code was on older branches. |
/backport v24.2.x |
int32_t partition_count; | ||
int32_t partition_count{0}; | ||
// using signed integer because Kafka protocol defines it as signed int | ||
int16_t replication_factor; | ||
int16_t replication_factor{0}; | ||
// bypass migration restrictions | ||
bool is_migrated; | ||
bool is_migrated{false}; |
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.
nice find
Since we need a default constructor to keep serde happy.
This PR adds some default initializers to
cluster::topic_configuration
to avoid UB when the default constructor is used as in this function. We could/should adjust the test code to avoid this pattern, but precluding the invalid state at the struct definition is probably sufficient here.Backports Required
Release Notes