Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions api/persistence/v1/executions.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions common/dynamicconfig/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,11 @@ and deployment interaction in matching and history.`,
false,
`EnableSuggestCaNOnNewTargetVersion lets Pinned workflows receive SuggestContinueAsNew when a new target version is available.`,
)
EnableSendTargetVersionChanged = NewNamespaceBoolSetting(
"system.enableSendTargetVersionChanged",
true,
`EnableSendTargetVersionChanged lets Pinned workflows receive TargetWorkerDeploymentVersionChanged=true when a new target version is available for that workflow.`,
)
EnableNexus = NewGlobalBoolSetting(
"system.enableNexus",
true,
Expand Down
1 change: 1 addition & 0 deletions common/metrics/metric_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,7 @@ var (
StartDeploymentTransitionCounter = NewCounterDef("start_deployment_transition_count")
VersioningDataPropagationLatency = NewTimerDef("versioning_data_propagation_latency")
SlowVersioningDataPropagationCounter = NewCounterDef("slow_versioning_data_propagation")
WorkflowTargetVersionChangedCount = NewCounterDef("workflow_target_version_changed_count")

// Continue-as-new
WorkflowContinueAsNewCount = NewCounterDef("workflow_continue_as_new_count")
Expand Down
9 changes: 0 additions & 9 deletions common/metrics/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const (
suggestContinueAsNewReasonTooManyUpdates = "suggest_continue_as_new_reason_too_many_updates"
suggestContinueAsNewReasonTooManyHistoryEvents = "suggest_continue_as_new_reason_too_many_history_events"
suggestContinueAsNewReasonHistorySizeTooLarge = "suggest_continue_as_new_reason_history_size_too_large"
suggestContinueAsNewReasonTargetVersionChanged = "suggest_continue_as_new_reason_target_version_changed"
isFirstAttempt = "first-attempt"
workflowStatus = "workflow_status"
behaviorBefore = "behavior_before"
Expand Down Expand Up @@ -414,14 +413,6 @@ func ContinueAsNewVersioningBehaviorTag(canBehavior enumspb.ContinueAsNewVersion
return Tag{Key: continueAsNewVersioningBehavior, Value: canBehavior.String()}
}

func SuggestContinueAsNewReasonTargetVersionChangedTag(present bool) Tag {
v := falseValue
if present {
v = trueValue
}
return Tag{Key: suggestContinueAsNewReasonTargetVersionChanged, Value: v}
}

func SuggestContinueAsNewReasonTooManyUpdatesTag(present bool) Tag {
v := falseValue
if present {
Expand Down
1 change: 1 addition & 0 deletions common/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ func TestMergeProtoExcludingFields(t *testing.T) {
&info.WorkflowTaskType,
&info.WorkflowTaskSuggestContinueAsNew,
&info.WorkflowTaskSuggestContinueAsNewReasons,
&info.WorkflowTaskTargetWorkerDeploymentVersionChanged,
&info.WorkflowTaskHistorySizeBytes,
&info.WorkflowTaskBuildId,
&info.WorkflowTaskBuildIdRedirectCounter,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ require (
go.opentelemetry.io/otel/sdk v1.34.0
go.opentelemetry.io/otel/sdk/metric v1.34.0
go.opentelemetry.io/otel/trace v1.34.0
go.temporal.io/api v1.62.1
go.temporal.io/api v1.62.2-0.20260212001044-b64b7ab17efc
go.temporal.io/sdk v1.38.0
go.uber.org/fx v1.24.0
go.uber.org/mock v0.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
go.temporal.io/api v1.62.1 h1:7UHMNOIqfYBVTaW0JIh/wDpw2jORkB6zUKsxGtvjSZU=
go.temporal.io/api v1.62.1/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
go.temporal.io/api v1.62.2-0.20260212001044-b64b7ab17efc h1:hFmYOJKWlLJVG5wfziY8SLv+iXEswyGVnm9c7ebMi7k=
go.temporal.io/api v1.62.2-0.20260212001044-b64b7ab17efc/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
go.temporal.io/sdk v1.38.0 h1:4Bok5LEdED7YKpsSjIa3dDqram5VOq+ydBf4pyx0Wo4=
go.temporal.io/sdk v1.38.0/go.mod h1:a+R2Ej28ObvHoILbHaxMyind7M6D+W0L7edt5UJF4SE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ message WorkflowExecutionInfo {
temporal.server.api.enums.v1.WorkflowTaskType workflow_task_type = 68;
bool workflow_task_suggest_continue_as_new = 69;
repeated temporal.api.enums.v1.SuggestContinueAsNewReason workflow_task_suggest_continue_as_new_reasons = 110;
bool workflow_task_target_worker_deployment_version_changed = 112;
int64 workflow_task_history_size_bytes = 70;
// tracks the started build ID for transient/speculative WFT. This info is used for two purposes:
// - verify WFT completes by the same Build ID that started in the latest attempt
Expand Down
2 changes: 2 additions & 0 deletions service/history/configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ type Config struct {

// Worker-Versioning related settings
EnableSuggestCaNOnNewTargetVersion dynamicconfig.BoolPropertyFnWithNamespaceFilter
EnableSendTargetVersionChanged dynamicconfig.BoolPropertyFnWithNamespaceFilter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnableSuggestCaNOnNewTargetVersion config is now dead code

Low Severity

EnableSuggestCaNOnNewTargetVersion is still defined, initialized, and registered as a dynamic config, but the only business logic that referenced it (in workflow_task_state_machine.go) now uses EnableSendTargetVersionChanged instead. The old config field is never read, so setting it has no effect. An operator configuring system.enableSuggestCaNOnNewTargetVersion would expect it to do something, but it silently does nothing.

Additional Locations (2)

Fix in Cursor Fix in Web

UseRevisionNumberForWorkerVersioning dynamicconfig.BoolPropertyFnWithNamespaceFilter
VersionMembershipCacheTTL dynamicconfig.DurationPropertyFn
VersionMembershipCacheMaxSize dynamicconfig.IntPropertyFn
Expand Down Expand Up @@ -770,6 +771,7 @@ func NewConfig(
// Worker-Versioning related
UseRevisionNumberForWorkerVersioning: dynamicconfig.UseRevisionNumberForWorkerVersioning.Get(dc),
EnableSuggestCaNOnNewTargetVersion: dynamicconfig.EnableSuggestCaNOnNewTargetVersion.Get(dc),
EnableSendTargetVersionChanged: dynamicconfig.EnableSendTargetVersionChanged.Get(dc),
VersionMembershipCacheTTL: dynamicconfig.VersionMembershipCacheTTL.Get(dc),
VersionMembershipCacheMaxSize: dynamicconfig.VersionMembershipCacheMaxSize.Get(dc),
RoutingInfoCacheTTL: dynamicconfig.RoutingInfoCacheTTL.Get(dc),
Expand Down
3 changes: 3 additions & 0 deletions service/history/historybuilder/event_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func (b *EventFactory) CreateWorkflowTaskStartedEvent(
versioningStamp *commonpb.WorkerVersionStamp,
buildIdRedirectCounter int64,
suggestContinueAsNewReasons []enumspb.SuggestContinueAsNewReason,
targetWorkerDeploymentVersionChanged bool,
) *historypb.HistoryEvent {
event := b.createHistoryEvent(enumspb.EVENT_TYPE_WORKFLOW_TASK_STARTED, startTime)
event.Attributes = &historypb.HistoryEvent_WorkflowTaskStartedEventAttributes{
Expand All @@ -137,6 +138,8 @@ func (b *EventFactory) CreateWorkflowTaskStartedEvent(
HistorySizeBytes: historySizeBytes,
WorkerVersion: versioningStamp,
BuildIdRedirectCounter: buildIdRedirectCounter,

TargetWorkerDeploymentVersionChanged: targetWorkerDeploymentVersionChanged,
},
}
return event
Expand Down
2 changes: 2 additions & 0 deletions service/history/historybuilder/history_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func (b *HistoryBuilder) AddWorkflowTaskStartedEvent(
versioningStamp *commonpb.WorkerVersionStamp,
buildIdRedirectCounter int64,
suggestContinueAsNewReasons []enumspb.SuggestContinueAsNewReason,
targetWorkerDeploymentVersionChanged bool,
) *historypb.HistoryEvent {
event := b.EventFactory.CreateWorkflowTaskStartedEvent(
scheduledEventID,
Expand All @@ -209,6 +210,7 @@ func (b *HistoryBuilder) AddWorkflowTaskStartedEvent(
versioningStamp,
buildIdRedirectCounter,
suggestContinueAsNewReasons,
targetWorkerDeploymentVersionChanged,
)
event, _ = b.EventStore.add(event)
return event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ func (s *sutTestingAdapter) AddWorkflowExecutionStartedEvent(_ ...eventConfig) *
}

func (s *sutTestingAdapter) AddWorkflowTaskStartedEvent(_ ...eventConfig) *historypb.HistoryEvent {
return s.HistoryBuilder.AddWorkflowTaskStartedEvent(64, "request-1", "identity-1", s.today, false, 100, nil, 0, nil)
return s.HistoryBuilder.AddWorkflowTaskStartedEvent(64, "request-1", "identity-1", s.today, false, 100, nil, 0, nil, true)
}

func (s *sutTestingAdapter) AddWorkflowTaskCompletedEvent(_ ...eventConfig) *historypb.HistoryEvent {
Expand Down
3 changes: 3 additions & 0 deletions service/history/historybuilder/history_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ func (s *historyBuilderSuite) TestWorkflowTaskStarted() {
nil,
int64(0),
nil,
true,
)
s.Equal(event, s.flush())
s.Equal(&historypb.HistoryEvent{
Expand All @@ -674,6 +675,8 @@ func (s *historyBuilderSuite) TestWorkflowTaskStarted() {
SuggestContinueAsNew: false,
SuggestContinueAsNewReasons: nil,
HistorySizeBytes: 123678,

TargetWorkerDeploymentVersionChanged: true,
},
},
}, event)
Expand Down
2 changes: 1 addition & 1 deletion service/history/interfaces/mutable_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ type (
ApplyWorkflowTaskCompletedEvent(*historypb.HistoryEvent) error
ApplyWorkflowTaskFailedEvent() error
ApplyWorkflowTaskScheduledEvent(int64, int64, *taskqueuepb.TaskQueue, *durationpb.Duration, int32, *timestamppb.Timestamp, *timestamppb.Timestamp, enumsspb.WorkflowTaskType) (*WorkflowTaskInfo, error)
ApplyWorkflowTaskStartedEvent(*WorkflowTaskInfo, int64, int64, int64, string, time.Time, bool, int64, *commonpb.WorkerVersionStamp, int64, []enumspb.SuggestContinueAsNewReason) (*WorkflowTaskInfo, error)
ApplyWorkflowTaskStartedEvent(*WorkflowTaskInfo, int64, int64, int64, string, time.Time, bool, int64, *commonpb.WorkerVersionStamp, int64, []enumspb.SuggestContinueAsNewReason, bool) (*WorkflowTaskInfo, error)
ApplyWorkflowTaskTimedOutEvent(enumspb.TimeoutType) error
ApplyExternalWorkflowExecutionCancelRequested(*historypb.HistoryEvent) error
ApplyExternalWorkflowExecutionSignaled(*historypb.HistoryEvent) error
Expand Down
Loading
Loading