-
Notifications
You must be signed in to change notification settings - Fork 577
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
Do not restart cluster when scaling up #4964
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,7 @@ func (c *GlobalConfiguration) GetNodeConfigurationHash() (string, error) { | |
clone := *c | ||
// clean any cluster property from config before serializing | ||
clone.ClusterConfiguration = nil | ||
removeIgnoredFields(&clone) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think probably we don't need to clone the object, but the code above seems to suggest we do a deep copy, while in practice it's doing a shallow one and the object is probably being modified |
||
props := clone.NodeConfiguration.Redpanda.Other | ||
clone.NodeConfiguration.Redpanda.Other = make(map[string]interface{}) | ||
for k, v := range props { | ||
|
@@ -135,6 +136,25 @@ func (c *GlobalConfiguration) GetNodeConfigurationHash() (string, error) { | |
return fmt.Sprintf("%x", md5Hash), nil | ||
} | ||
|
||
// GetAllConfigurationHash computes a hash of the whole serialized config. This | ||
// is default behavior prior to centralized configuration feature was developed | ||
func (c *GlobalConfiguration) GetAllConfigurationHash() (string, error) { | ||
clone := *c | ||
removeIgnoredFields(&clone) | ||
serialized, err := clone.Serialize() | ||
if err != nil { | ||
return "", err | ||
} | ||
md5Hash := md5.Sum(serialized.RedpandaFile) // nolint:gosec // this is not encrypting secure info | ||
return fmt.Sprintf("%x", md5Hash), nil | ||
} | ||
|
||
func removeIgnoredFields(clone *GlobalConfiguration) { | ||
// ignore seeds for hash computation so that changes in this field don't | ||
// trigger cluster restats | ||
clone.NodeConfiguration.Redpanda.SeedServers = []config.SeedServer{} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there are other cases where we iterate over the replicas to create urls, such as for panda proxy and schema registry |
||
} | ||
|
||
// GetAdditionalRedpandaProperty retrieves a configuration option | ||
func (c *GlobalConfiguration) GetAdditionalRedpandaProperty( | ||
prop string, | ||
|
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.
Better using
Consistently(func ...)
in this case, even if it takes more timeThere 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.
Also the
sts
is not reloaded