From d1e8bcd4f7dda41a520ffc6ac17c8b51422dc8e0 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Wed, 25 Sep 2024 18:18:02 -0400 Subject: [PATCH] Revert "Revert change to default reapply type" (#5956) Change default `ResetReapply` enum value to `ALL_ELIGIBLE`. Reverts temporalio/temporal#5688, i.e. after this PR we will have the behavior described in https://github.com/temporalio/temporal/pull/5360. This means both signals *and* updates will be reapplied by default during resets and coinflict resolution, which is the product behavior we want. - #5360 attempted to introduce a new proto enum value and start using it as the default - However, that is not a valid single-deploy change, since it can cause a frontend client on the new version to send a value that is unknown to a history node on the old version. - Therefore #5688 reverted the change to the default, allowing the new proto enum value to be introduced to the codebase - This PR is deployable iff all clusters that we deploy to have #5360 deployed I didn't. Tests were added in the original PR https://github.com/temporalio/temporal/pull/5360. Could break reset or history conflict resolution. 1.25.1 --- common/enums/defaults.go | 2 +- tests/reset_workflow.go | 8 ++++++++ tests/xdc/history_replication_signals_and_updates_test.go | 1 - 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/enums/defaults.go b/common/enums/defaults.go index 30c1ad76291..af535705a7f 100644 --- a/common/enums/defaults.go +++ b/common/enums/defaults.go @@ -75,7 +75,7 @@ func SetDefaultContinueAsNewInitiator(f *enumspb.ContinueAsNewInitiator) { func SetDefaultResetReapplyType(f *enumspb.ResetReapplyType) { if *f == enumspb.RESET_REAPPLY_TYPE_UNSPECIFIED { - *f = enumspb.RESET_REAPPLY_TYPE_SIGNAL + *f = enumspb.RESET_REAPPLY_TYPE_ALL_ELIGIBLE } } diff --git a/tests/reset_workflow.go b/tests/reset_workflow.go index ac1b28ba18e..b87fe6ed975 100644 --- a/tests/reset_workflow.go +++ b/tests/reset_workflow.go @@ -219,6 +219,14 @@ func (s *FunctionalSuite) TestResetWorkflow() { s.Equal(we.RunId, descResp.WorkflowExecutionInfo.GetFirstRunId()) } +func (s *FunctionalSuite) TestResetWorkflow_ExcludeNoneReapplyDefault() { + t := resetTest{ + FunctionalSuite: s, + tv: testvars.New(s.T()), + } + t.run() +} + func (s *FunctionalSuite) TestResetWorkflow_ExcludeNoneReapplyAll() { t := resetTest{ FunctionalSuite: s, diff --git a/tests/xdc/history_replication_signals_and_updates_test.go b/tests/xdc/history_replication_signals_and_updates_test.go index 116e1c3071d..c22879fd2da 100644 --- a/tests/xdc/history_replication_signals_and_updates_test.go +++ b/tests/xdc/history_replication_signals_and_updates_test.go @@ -935,7 +935,6 @@ func (c *hrsuTestCluster) resetWorkflow(ctx context.Context, workflowTaskFinishE WorkflowExecution: c.t.tv.WorkflowExecution(), Reason: "reset", WorkflowTaskFinishEventId: workflowTaskFinishEventId, - ResetReapplyType: enumspb.RESET_REAPPLY_TYPE_ALL_ELIGIBLE, }) c.t.s.NoError(err) return resp.RunId