-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix DeleteWorkflowExecution API when delete non current execution #2484
8000New 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
Changes from all commits
aef6a07
9e8e28f
ae1ce56
c426d4b
0efa1eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,6 @@ import ( | |
|
||
enumsspb "go.temporal.io/server/api/enums/v1" | ||
"go.temporal.io/server/common/clock" | ||
"go.temporal.io/server/common/log" | ||
"go.temporal.io/server/common/namespace" | ||
"go.temporal.io/server/common/persistence/versionhistory" | ||
"go.temporal.io/server/common/primitives/timestamp" | ||
|
@@ -54,7 +53,7 @@ type ( | |
) error | ||
GenerateDeleteExecutionTask( | ||
now time.Time, | ||
) error | ||
) (*tasks.DeleteExecutionTask, error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. return Once queue refactor change is done, I am going to update all the generator methods to return the generated task, instead of adding it to ms directly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Depend on interface, return concrete type", right? Unless there is a good reason for exception. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we control the caller code and we can prevent them from being closely coupled, I don't really have a strong opinion here. |
||
GenerateRecordWorkflowStartedTasks( | ||
now time.Time, | ||
startEvent *historypb.HistoryEvent, | ||
|
@@ -120,9 +119,7 @@ type ( | |
|
||
TaskGeneratorImpl struct { | ||
namespaceRegistry namespace.Registry | ||
logger log.Logger | ||
|
||
mutableState MutableState | ||
mutableState MutableState | ||
} | ||
) | ||
|
||
|
@@ -132,15 +129,12 @@ var _ TaskGenerator = (*TaskGeneratorImpl)(nil) | |
|
||
func NewTaskGenerator( | ||
namespaceRegistry namespace.Registry, | ||
logger log.Logger, | ||
mutableState MutableState, | ||
) *TaskGeneratorImpl { | ||
|
||
mstg := &TaskGeneratorImpl{ | ||
namespaceRegistry: namespaceRegistry, | ||
logger: logger, | ||
|
||
mutableState: mutableState, | ||
mutableState: mutableState, | ||
} | ||
|
||
return mstg | ||
|
@@ -212,18 +206,16 @@ func (r *TaskGeneratorImpl) GenerateWorkflowCloseTasks( | |
|
||
func (r *TaskGeneratorImpl) GenerateDeleteExecutionTask( | ||
now time.Time, | ||
) error { | ||
) (*tasks.DeleteExecutionTask, error) { | ||
|
||
currentVersion := r.mutableState.GetCurrentVersion() | ||
|
||
r.mutableState.AddTasks(&tasks.DeleteExecutionTask{ | ||
return &tasks.DeleteExecutionTask{ | ||
// TaskID is set by shard | ||
WorkflowKey: r.mutableState.GetWorkflowKey(), | ||
VisibilityTimestamp: now, | ||
Version: currentVersion, | ||
}) | ||
|
||
return nil | ||
}, nil | ||
} | ||
|
||
func (r *TaskGeneratorImpl) GenerateDelayedWorkflowTasks( | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.