-
Notifications
You must be signed in to change notification settings - Fork 805
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
Change cadence config to dynamic #851
Conversation
_matchingDomainTaskListRoot + "enableSyncMatch", | ||
_matchingDomainTaskListRoot + "updateAckInterval", | ||
_matchingDomainTaskListRoot + "idleTasklistCheckInterval", | ||
"testGetPropertyKey", |
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.
Instead of having keys as a flat array, can we make it a map of service to list of configs?
I think it will be much cleaner if we separate them out per service.
Another thing is I don't like we rely on the ordering of how keys are defined. Can we convert them into a map too, otherwise it will be very error prone.
Basically the keys definition would look something like:
map[serviceIdx]map[int]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.
changed
service/frontend/workflowHandler.go
Outdated
if getRequest.GetMaximumPageSize() == 0 { | ||
getRequest.MaximumPageSize = common.Int32Ptr(wh.config.DefaultHistoryMaxPageSize) | ||
if getRequest.GetMaximumPageSize() <= 0 { | ||
domainFilter := dynamicconfig.DomainFilter(getRequest.GetDomain()) |
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.
Can we define a strongly typed helper function on config which takes the domain when reading any config which supports filter on domain. Then we can have the code to create filter in one location and have a straightforward API for rest of the code to load the config.
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.
add GetIntPropertyWithDomainFilter
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.
Rest looks good. Let's make changes to address the comments I have made and then I can approve this request.
ExecutionMgrNumConns: "history.executionMgrNumConns", | ||
HistoryMgrNumConns: "history.historyMgrNumConns", | ||
MaximumBufferedEventsBatch: "history.maximumBufferedEventsBatch", | ||
ShardUpdateMinInterval: "history.shardUpdateMinInterval", | ||
} | ||
|
||
const ( | ||
// The order of constants is important. It should match the order in the keys array above. |
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.
Probably this comment is not relevant anymore. Delete this.
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.
Good catch done
service/frontend/workflowHandler.go
Outdated
if getRequest.GetMaximumPageSize() == 0 { | ||
getRequest.MaximumPageSize = common.Int32Ptr(wh.config.DefaultHistoryMaxPageSize) | ||
if getRequest.GetMaximumPageSize() <= 0 { | ||
getRequest.MaximumPageSize = common.Int32Ptr(int32( |
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 still too verbose. Can we have a strongly typed API on config like:
GetHistoryMaxPageSize(domain)?
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.
Refactored
No description provided.