Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bergundy committed Jun 8, 2023
1 parent b4438b1 commit 5658607
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
4 changes: 0 additions & 4 deletions common/dynamicconfig/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ const (
FrontendHistoryMaxPageSize = "frontend.historyMaxPageSize"
// FrontendRPS is workflow rate limit per second
FrontendRPS = "frontend.rps"
// FrontendNamespaceReplicationInducingAPIsRPS limits the per second request rate for namespace replication inducing
// APIs (e.g. UpdateNamespace, UpdateWorkerBuildIdCompatibility).
// This config is EXPERIMENTAL and may be changed or removed in a later release.
FrontendNamespaceReplicationInducingAPIsRPS = "frontend.rps.namespaceReplicationInducingAPIs"
// FrontendMaxNamespaceRPSPerInstance is workflow namespace rate limit per second
FrontendMaxNamespaceRPSPerInstance = "frontend.namespaceRPS"
// FrontendMaxNamespaceBurstPerInstance is workflow namespace burst limit
Expand Down
3 changes: 1 addition & 2 deletions service/frontend/fx.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,12 @@ func RateLimitInterceptorProvider(
serviceConfig *Config,
) *interceptor.RateLimitInterceptor {
rateFn := func() float64 { return float64(serviceConfig.RPS()) }
namespaceReplicationInducingRateFn := func() float64 { return float64(serviceConfig.NamespaceReplicationInducingAPIsRPS()) }

return interceptor.NewRateLimitInterceptor(
configs.NewRequestToRateLimiter(
quotas.NewDefaultIncomingRateLimiter(rateFn),
quotas.NewDefaultIncomingRateLimiter(rateFn),
quotas.NewDefaultIncomingRateLimiter(namespaceReplicationInducingRateFn),
quotas.NewDefaultIncomingRateLimiter(rateFn),
quotas.NewDefaultIncomingRateLimiter(rateFn),
),
map[string]int{},
Expand Down
6 changes: 2 additions & 4 deletions service/frontend/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ type Config struct {

HistoryMaxPageSize dynamicconfig.IntPropertyFnWithNamespaceFilter
RPS dynamicconfig.IntPropertyFn
NamespaceReplicationInducingAPIsRPS dynamicconfig.IntPropertyFn
MaxNamespaceRPSPerInstance dynamicconfig.IntPropertyFnWithNamespaceFilter
MaxNamespaceBurstPerInstance dynamicconfig.IntPropertyFnWithNamespaceFilter
MaxNamespaceCountPerInstance dynamicconfig.IntPropertyFnWithNamespaceFilter
Expand Down Expand Up @@ -203,9 +202,8 @@ func NewConfig(
VisibilityDisableOrderByClause: dc.GetBoolPropertyFnWithNamespaceFilter(dynamicconfig.VisibilityDisableOrderByClause, true),
VisibilityEnableManualPagination: dc.GetBoolPropertyFnWithNamespaceFilter(dynamicconfig.VisibilityEnableManualPagination, true),

HistoryMaxPageSize: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.FrontendHistoryMaxPageSize, common.GetHistoryMaxPageSize),
RPS: dc.GetIntProperty(dynamicconfig.FrontendRPS, 2400),
NamespaceReplicationInducingAPIsRPS: dc.GetIntProperty(dynamicconfig.FrontendNamespaceReplicationInducingAPIsRPS, 5),
HistoryMaxPageSize: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.FrontendHistoryMaxPageSize, common.GetHistoryMaxPageSize),
RPS: dc.GetIntProperty(dynamicconfig.FrontendRPS, 2400),

MaxNamespaceRPSPerInstance: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.FrontendMaxNamespaceRPSPerInstance, 2400),
MaxNamespaceBurstPerInstance: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.FrontendMaxNamespaceBurstPerInstance, 4800),
Expand Down
1 change: 0 additions & 1 deletion tests/versioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func (s *versioningIntegSuite) SetupSuite() {
// Make sure we don't hit the rate limiter in tests
dynamicconfig.FrontendMaxNamespaceNamespaceReplicationInducingAPIsRPSPerInstance: 1000,
dynamicconfig.FrontendMaxNamespaceNamespaceReplicationInducingAPIsBurstPerInstance: 1000,
dynamicconfig.FrontendNamespaceReplicationInducingAPIsRPS: 1000,

// The dispatch tests below rely on being able to see the effects of changing
// versioning data relatively quickly. In general we only promise to act on new
Expand Down
1 change: 0 additions & 1 deletion tests/xdc/user_data_replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func (s *userDataReplicationTestSuite) SetupSuite() {
// Make sure we don't hit the rate limiter in tests
dynamicconfig.FrontendMaxNamespaceNamespaceReplicationInducingAPIsRPSPerInstance: 1000,
dynamicconfig.FrontendMaxNamespaceNamespaceReplicationInducingAPIsBurstPerInstance: 1000,
dynamicconfig.FrontendNamespaceReplicationInducingAPIsRPS: 1000,
}
s.setupSuite([]string{"task_queue_repl_active", "task_queue_repl_standby"})
}
Expand Down

0 comments on commit 5658607

Please sign in to comment.