mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-30 18:41:49 -07:00
Per queue max reader count (#5334)
## What changed?
Remove the `history.queueMaxReaderCount` dynamic config in favor of a
per queue config in the form of `history.{queue}QueueMaxReaderCount`
## Why?
Nexus Callback and Operation multi-destination queues need to increase
the default limit without applying the increased limit to other queues.
## How did you test it?
Ran existing tests.
## Potential risks
Users may have altered the existing configuration in their production
setup but that's highly unlikely and it should be fine to add a warning
in the release notes to mention that the old value is no longer applied.
This commit is contained in:
@@ -578,8 +578,6 @@ const (
|
||||
// limit should not be hit and task unloading should happen once critical count is exceeded. But
|
||||
// since queue action is async, we need this hard limit.
|
||||
QueuePendingTaskMaxCount = "history.queuePendingTasksMaxCount"
|
||||
// QueueMaxReaderCount is the max number of readers in one multi-cursor queue
|
||||
QueueMaxReaderCount = "history.queueMaxReaderCount"
|
||||
// ContinueAsNewMinInterval is the minimal interval between continue_as_new executions.
|
||||
// This is needed to prevent tight loop continue_as_new spin. Default is 1s.
|
||||
ContinueAsNewMinInterval = "history.continueAsNewMinInterval"
|
||||
@@ -632,6 +630,8 @@ const (
|
||||
TimerProcessorPollBackoffInterval = "history.timerProcessorPollBackoffInterval"
|
||||
// TimerProcessorMaxTimeShift is the max shift timer processor can have
|
||||
TimerProcessorMaxTimeShift = "history.timerProcessorMaxTimeShift"
|
||||
// TimerQueueMaxReaderCount is the max number of readers in one multi-cursor timer queue
|
||||
TimerQueueMaxReaderCount = "history.timerQueueMaxReaderCount"
|
||||
// RetentionTimerJitterDuration is a time duration jitter to distribute timer from T0 to T0 + jitter duration
|
||||
RetentionTimerJitterDuration = "history.retentionTimerJitterDuration"
|
||||
|
||||
@@ -668,6 +668,8 @@ const (
|
||||
TransferProcessorPollBackoffInterval = "history.transferProcessorPollBackoffInterval"
|
||||
// TransferProcessorEnsureCloseBeforeDelete means we ensure the execution is closed before we delete it
|
||||
TransferProcessorEnsureCloseBeforeDelete = "history.transferProcessorEnsureCloseBeforeDelete"
|
||||
// TransferQueueMaxReaderCount is the max number of readers in one multi-cursor transfer queue
|
||||
TransferQueueMaxReaderCount = "history.transferQueueMaxReaderCount"
|
||||
|
||||
// VisibilityTaskBatchSize is batch size for visibilityQueueProcessor
|
||||
VisibilityTaskBatchSize = "history.visibilityTaskBatchSize"
|
||||
@@ -699,6 +701,8 @@ const (
|
||||
// close task has been processed. Must use Elasticsearch as visibility store, otherwise workflow
|
||||
// data (eg: search attributes) will be lost after workflow is closed.
|
||||
VisibilityProcessorEnableCloseWorkflowCleanup = "history.visibilityProcessorEnableCloseWorkflowCleanup"
|
||||
// VisibilityQueueMaxReaderCount is the max number of readers in one multi-cursor visibility queue
|
||||
VisibilityQueueMaxReaderCount = "history.visibilityQueueMaxReaderCount"
|
||||
|
||||
// ArchivalTaskBatchSize is batch size for archivalQueueProcessor
|
||||
ArchivalTaskBatchSize = "history.archivalTaskBatchSize"
|
||||
@@ -724,6 +728,8 @@ const (
|
||||
ArchivalProcessorArchiveDelay = "history.archivalProcessorArchiveDelay"
|
||||
// ArchivalBackendMaxRPS is the maximum rate of requests per second to the archival backend
|
||||
ArchivalBackendMaxRPS = "history.archivalBackendMaxRPS"
|
||||
// ArchivalQueueMaxReaderCount is the max number of readers in one multi-cursor archival queue
|
||||
ArchivalQueueMaxReaderCount = "history.archivalQueueMaxReaderCount"
|
||||
|
||||
// WorkflowExecutionMaxInFlightUpdates is the max number of updates that can be in-flight (admitted but not yet completed) for any given workflow execution.
|
||||
WorkflowExecutionMaxInFlightUpdates = "history.maxInFlightUpdates"
|
||||
|
||||
@@ -114,7 +114,7 @@ func newQueueFactoryBase(params ArchivalQueueFactoryParams) QueueFactoryBase {
|
||||
params.Config.PersistenceMaxQPS,
|
||||
archivalQueuePersistenceMaxRPSRatio,
|
||||
),
|
||||
int64(params.Config.QueueMaxReaderCount()),
|
||||
int64(params.Config.ArchivalQueueMaxReaderCount()),
|
||||
),
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@ func (f *archivalQueueFactory) newScheduledQueue(shard shard.Context, executor q
|
||||
MaxPollIntervalJitterCoefficient: f.Config.ArchivalProcessorMaxPollIntervalJitterCoefficient,
|
||||
CheckpointInterval: f.Config.ArchivalProcessorUpdateAckInterval,
|
||||
CheckpointIntervalJitterCoefficient: f.Config.ArchivalProcessorUpdateAckIntervalJitterCoefficient,
|
||||
MaxReaderCount: f.Config.QueueMaxReaderCount,
|
||||
MaxReaderCount: f.Config.ArchivalQueueMaxReaderCount,
|
||||
},
|
||||
f.HostReaderRateLimiter,
|
||||
logger,
|
||||
|
||||
@@ -103,7 +103,6 @@ type Config struct {
|
||||
QueueReaderStuckCriticalAttempts dynamicconfig.IntPropertyFn
|
||||
QueueCriticalSlicesCount dynamicconfig.IntPropertyFn
|
||||
QueuePendingTaskMaxCount dynamicconfig.IntPropertyFn
|
||||
QueueMaxReaderCount dynamicconfig.IntPropertyFn
|
||||
|
||||
TaskDLQEnabled dynamicconfig.BoolPropertyFn
|
||||
|
||||
@@ -131,6 +130,7 @@ type Config struct {
|
||||
TimerProcessorMaxPollIntervalJitterCoefficient dynamicconfig.FloatPropertyFn
|
||||
TimerProcessorPollBackoffInterval dynamicconfig.DurationPropertyFn
|
||||
TimerProcessorMaxTimeShift dynamicconfig.DurationPropertyFn
|
||||
TimerQueueMaxReaderCount dynamicconfig.IntPropertyFn
|
||||
RetentionTimerJitterDuration dynamicconfig.DurationPropertyFn
|
||||
|
||||
MemoryTimerProcessorSchedulerWorkerCount dynamicconfig.IntPropertyFn
|
||||
@@ -151,6 +151,7 @@ type Config struct {
|
||||
TransferProcessorCompleteTransferInterval dynamicconfig.DurationPropertyFn
|
||||
TransferProcessorPollBackoffInterval dynamicconfig.DurationPropertyFn
|
||||
TransferProcessorEnsureCloseBeforeDelete dynamicconfig.BoolPropertyFn
|
||||
TransferQueueMaxReaderCount dynamicconfig.IntPropertyFn
|
||||
|
||||
// ReplicatorQueueProcessor settings
|
||||
// TODO: clean up unused replicator settings
|
||||
@@ -288,6 +289,7 @@ type Config struct {
|
||||
VisibilityProcessorPollBackoffInterval dynamicconfig.DurationPropertyFn
|
||||
VisibilityProcessorEnsureCloseBeforeDelete dynamicconfig.BoolPropertyFn
|
||||
VisibilityProcessorEnableCloseWorkflowCleanup dynamicconfig.BoolPropertyFnWithNamespaceFilter
|
||||
VisibilityQueueMaxReaderCount dynamicconfig.IntPropertyFn
|
||||
|
||||
SearchAttributesNumberOfKeysLimit dynamicconfig.IntPropertyFnWithNamespaceFilter
|
||||
SearchAttributesSizeOfValueLimit dynamicconfig.IntPropertyFnWithNamespaceFilter
|
||||
@@ -316,6 +318,7 @@ type Config struct {
|
||||
ArchivalProcessorUpdateAckIntervalJitterCoefficient dynamicconfig.FloatPropertyFn
|
||||
ArchivalProcessorArchiveDelay dynamicconfig.DurationPropertyFn
|
||||
ArchivalBackendMaxRPS dynamicconfig.FloatPropertyFn
|
||||
ArchivalQueueMaxReaderCount dynamicconfig.IntPropertyFn
|
||||
|
||||
WorkflowExecutionMaxInFlightUpdates dynamicconfig.IntPropertyFnWithNamespaceFilter
|
||||
WorkflowExecutionMaxTotalUpdates dynamicconfig.IntPropertyFnWithNamespaceFilter
|
||||
@@ -395,7 +398,6 @@ func NewConfig(
|
||||
QueueReaderStuckCriticalAttempts: dc.GetIntProperty(dynamicconfig.QueueReaderStuckCriticalAttempts, 3),
|
||||
QueueCriticalSlicesCount: dc.GetIntProperty(dynamicconfig.QueueCriticalSlicesCount, 50),
|
||||
QueuePendingTaskMaxCount: dc.GetIntProperty(dynamicconfig.QueuePendingTaskMaxCount, 10000),
|
||||
QueueMaxReaderCount: dc.GetIntProperty(dynamicconfig.QueueMaxReaderCount, 2),
|
||||
|
||||
TaskDLQEnabled: dc.GetBoolProperty(dynamicconfig.HistoryTaskDLQEnabled, true),
|
||||
|
||||
@@ -421,6 +423,7 @@ func NewConfig(
|
||||
TimerProcessorMaxPollIntervalJitterCoefficient: dc.GetFloat64Property(dynamicconfig.TimerProcessorMaxPollIntervalJitterCoefficient, 0.15),
|
||||
TimerProcessorPollBackoffInterval: dc.GetDurationProperty(dynamicconfig.TimerProcessorPollBackoffInterval, 5*time.Second),
|
||||
TimerProcessorMaxTimeShift: dc.GetDurationProperty(dynamicconfig.TimerProcessorMaxTimeShift, 1*time.Second),
|
||||
TransferQueueMaxReaderCount: dc.GetIntProperty(dynamicconfig.TransferQueueMaxReaderCount, 2),
|
||||
RetentionTimerJitterDuration: dc.GetDurationProperty(dynamicconfig.RetentionTimerJitterDuration, 30*time.Minute),
|
||||
|
||||
MemoryTimerProcessorSchedulerWorkerCount: dc.GetIntProperty(dynamicconfig.MemoryTimerProcessorSchedulerWorkerCount, 64),
|
||||
@@ -439,6 +442,7 @@ func NewConfig(
|
||||
TransferProcessorCompleteTransferInterval: dc.GetDurationProperty(dynamicconfig.TransferProcessorCompleteTransferInterval, 60*time.Second),
|
||||
TransferProcessorPollBackoffInterval: dc.GetDurationProperty(dynamicconfig.TransferProcessorPollBackoffInterval, 5*time.Second),
|
||||
TransferProcessorEnsureCloseBeforeDelete: dc.GetBoolProperty(dynamicconfig.TransferProcessorEnsureCloseBeforeDelete, true),
|
||||
TimerQueueMaxReaderCount: dc.GetIntProperty(dynamicconfig.TimerQueueMaxReaderCount, 2),
|
||||
|
||||
ReplicatorTaskBatchSize: dc.GetIntProperty(dynamicconfig.ReplicatorTaskBatchSize, 100),
|
||||
ReplicatorTaskWorkerCount: dc.GetIntProperty(dynamicconfig.ReplicatorTaskWorkerCount, 10),
|
||||
@@ -545,6 +549,7 @@ func NewConfig(
|
||||
VisibilityProcessorPollBackoffInterval: dc.GetDurationProperty(dynamicconfig.VisibilityProcessorPollBackoffInterval, 5*time.Second),
|
||||
VisibilityProcessorEnsureCloseBeforeDelete: dc.GetBoolProperty(dynamicconfig.VisibilityProcessorEnsureCloseBeforeDelete, false),
|
||||
VisibilityProcessorEnableCloseWorkflowCleanup: dc.GetBoolPropertyFnWithNamespaceFilter(dynamicconfig.VisibilityProcessorEnableCloseWorkflowCleanup, false),
|
||||
VisibilityQueueMaxReaderCount: dc.GetIntProperty(dynamicconfig.VisibilityQueueMaxReaderCount, 2),
|
||||
|
||||
SearchAttributesNumberOfKeysLimit: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.SearchAttributesNumberOfKeysLimit, 100),
|
||||
SearchAttributesSizeOfValueLimit: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.SearchAttributesSizeOfValueLimit, 2*1024),
|
||||
@@ -579,6 +584,7 @@ func NewConfig(
|
||||
ArchivalProcessorPollBackoffInterval: dc.GetDurationProperty(dynamicconfig.ArchivalProcessorPollBackoffInterval, 5*time.Second),
|
||||
ArchivalProcessorArchiveDelay: dc.GetDurationProperty(dynamicconfig.ArchivalProcessorArchiveDelay, 5*time.Minute),
|
||||
ArchivalBackendMaxRPS: dc.GetFloat64Property(dynamicconfig.ArchivalBackendMaxRPS, 10000.0),
|
||||
ArchivalQueueMaxReaderCount: dc.GetIntProperty(dynamicconfig.ArchivalQueueMaxReaderCount, 2),
|
||||
|
||||
// workflow update related
|
||||
WorkflowExecutionMaxInFlightUpdates: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.WorkflowExecutionMaxInFlightUpdates, 10),
|
||||
|
||||
@@ -91,7 +91,7 @@ func NewTimerQueueFactory(
|
||||
params.Config.PersistenceMaxQPS,
|
||||
timerQueuePersistenceMaxRPSRatio,
|
||||
),
|
||||
int64(params.Config.QueueMaxReaderCount()),
|
||||
int64(params.Config.TimerQueueMaxReaderCount()),
|
||||
),
|
||||
},
|
||||
}
|
||||
@@ -240,7 +240,7 @@ func (f *timerQueueFactory) CreateQueue(
|
||||
MaxPollIntervalJitterCoefficient: f.Config.TimerProcessorMaxPollIntervalJitterCoefficient,
|
||||
CheckpointInterval: f.Config.TimerProcessorUpdateAckInterval,
|
||||
CheckpointIntervalJitterCoefficient: f.Config.TimerProcessorUpdateAckIntervalJitterCoefficient,
|
||||
MaxReaderCount: f.Config.QueueMaxReaderCount,
|
||||
MaxReaderCount: f.Config.TimerQueueMaxReaderCount,
|
||||
},
|
||||
f.HostReaderRateLimiter,
|
||||
logger,
|
||||
|
||||
@@ -93,7 +93,7 @@ func NewTransferQueueFactory(
|
||||
params.Config.PersistenceMaxQPS,
|
||||
transferQueuePersistenceMaxRPSRatio,
|
||||
),
|
||||
int64(params.Config.QueueMaxReaderCount()),
|
||||
int64(params.Config.TransferQueueMaxReaderCount()),
|
||||
),
|
||||
},
|
||||
}
|
||||
@@ -232,7 +232,7 @@ func (f *transferQueueFactory) CreateQueue(
|
||||
MaxPollIntervalJitterCoefficient: f.Config.TransferProcessorMaxPollIntervalJitterCoefficient,
|
||||
CheckpointInterval: f.Config.TransferProcessorUpdateAckInterval,
|
||||
CheckpointIntervalJitterCoefficient: f.Config.TransferProcessorUpdateAckIntervalJitterCoefficient,
|
||||
MaxReaderCount: f.Config.QueueMaxReaderCount,
|
||||
MaxReaderCount: f.Config.TransferQueueMaxReaderCount,
|
||||
},
|
||||
f.HostReaderRateLimiter,
|
||||
queues.GrouperNamespaceID{},
|
||||
|
||||
@@ -79,7 +79,7 @@ func NewVisibilityQueueFactory(
|
||||
params.Config.PersistenceMaxQPS,
|
||||
visibilityQueuePersistenceMaxRPSRatio,
|
||||
),
|
||||
int64(params.Config.QueueMaxReaderCount()),
|
||||
int64(params.Config.VisibilityQueueMaxReaderCount()),
|
||||
),
|
||||
},
|
||||
}
|
||||
@@ -163,7 +163,7 @@ func (f *visibilityQueueFactory) CreateQueue(
|
||||
MaxPollIntervalJitterCoefficient: f.Config.VisibilityProcessorMaxPollIntervalJitterCoefficient,
|
||||
CheckpointInterval: f.Config.VisibilityProcessorUpdateAckInterval,
|
||||
CheckpointIntervalJitterCoefficient: f.Config.VisibilityProcessorUpdateAckIntervalJitterCoefficient,
|
||||
MaxReaderCount: f.Config.QueueMaxReaderCount,
|
||||
MaxReaderCount: f.Config.VisibilityQueueMaxReaderCount,
|
||||
},
|
||||
f.HostReaderRateLimiter,
|
||||
queues.GrouperNamespaceID{},
|
||||
|
||||
Reference in New Issue
Block a user