-
Notifications
You must be signed in to change notification settings - Fork 816
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
Update the default values of dynamic config to not depend on static config #4858
Conversation
3f9fbd6
to
50b8f7b
Compare
common/archiver/archivalMetadata.go
Outdated
@@ -55,7 +55,8 @@ type ( | |||
archivalConfig struct { | |||
staticClusterStatus ArchivalStatus | |||
dynamicClusterStatus dynamicconfig.StringPropertyFn | |||
enableRead dynamicconfig.BoolPropertyFn | |||
staticEnableRead bool |
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.
I don't quite understand what these two values are intended to imply from the user of the config.
what does dynamicEnableRead
== true and staticEnalbleRead
mean, for example? Is this something you're intending to hide through a getter (I might have missed it if you have).
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.
yes, it's hided through ReadEnabled() bool
. if both are true, read is enabled
common/archiver/archivalMetadata.go
Outdated
@@ -177,7 +183,7 @@ func (a *archivalConfig) ReadEnabled() bool { | |||
if !a.ClusterConfiguredForArchival() { | |||
return false | |||
} | |||
return a.enableRead() | |||
return a.staticEnableRead && a.dynamicEnableRead() |
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.
This configuration might be surprising as some folks might expect either ||
or if dynamicConfig != nil return dynamicConfig else staticConfig
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.
I dont have a strong opinion on what it should be as I don't know enough about how this and similar config values are used in production, but I think maybe we should call out this both in the head of the diff and maybe in comments?
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.
This is to keep the behavior the same as GetClusterStatus function
6dc1a8b
to
b05ee62
Compare
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.
Looks good. I'm mildly worried this might manifest in some behaviour changes, but maybe we can use Steven's config dump to detect this.
@@ -117,7 +117,7 @@ func (cf *rpcClientFactory) NewHistoryClientWithTimeout(timeout time.Duration) ( | |||
peerResolver := history.NewPeerResolver(cf.numberOfHistoryShards, cf.resolver, namedPort) | |||
|
|||
supportedMessageSize := cf.rpcFactory.GetMaxMessageSize() | |||
maxSizeConfig := cf.dynConfig.GetIntProperty(dynamicconfig.GRPCMaxSizeInByte, supportedMessageSize) | |||
maxSizeConfig := cf.dynConfig.GetIntProperty(dynamicconfig.GRPCMaxSizeInByte, 4*1024*1024) |
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.
maybe could we put 4*1024*1024
as a constant too? it's not super clear to the ignorant reader (me) what this refers to?
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.
will be addressed in #4863
What changed?
Update the default values of dynamic config to be static values, and to not depend on values read from static config file
Why?
How did you test it?
existing test
Potential risks
Release notes
If there is no
system.grpcMaxSizeInByte
config, it needs to be created. And the value should be the same as themaxPayloadSize
in the static config.Documentation Changes