-
Notifications
You must be signed in to change notification settings - Fork 850
New 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
Matching logic for pinned workflows #6853
Conversation
…g-behaviors # Conflicts: # api/deployment/v1/message.go-helpers.pb.go # api/deployment/v1/message.pb.go # common/worker_versioning/worker_versioning.go # proto/internal/temporal/server/api/deployment/v1/message.proto
…g-behaviors # Conflicts: # api/persistence/v1/executions.pb.go # service/matching/task_queue_partition_manager.go
…shahab/transfer-versioning-info # Conflicts: # service/history/workflow/mutable_state_impl.go
nonRootPartitionPrefix = "/_sys/" | ||
partitionDelimiter = "/" | ||
versionSetDelimiter = ":" | ||
buildIdDelimiter = "#" | ||
deploymentNameDelimiter = "|" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool! Let's aim to draw something meaningful here. Like a Christmas tree.
func (s *VersioningIntegSuite) startWorkflow() *commonpb.WorkflowExecution { | ||
id := s.randomizeName("my-wf") | ||
wt := "MyWfType" | ||
tqName := "my-tq" | ||
tq := &taskqueuepb.TaskQueue{Name: tqName, Kind: enumspb.TASK_QUEUE_KIND_NORMAL} | ||
identity := "worker1" | ||
|
||
request := &workflowservice.StartWorkflowExecutionRequest{ | ||
RequestId: uuid.New(), | ||
Namespace: s.Namespace(), | ||
WorkflowId: id, | ||
WorkflowType: &commonpb.WorkflowType{Name: wt}, | ||
TaskQueue: tq, | ||
Input: nil, | ||
WorkflowRunTimeout: durationpb.New(100 * time.Second), | ||
WorkflowTaskTimeout: durationpb.New(1 * time.Second), | ||
Identity: identity, | ||
} | ||
|
||
we, err0 := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), request) | ||
s.NoError(err0) | ||
return &commonpb.WorkflowExecution{ | ||
WorkflowId: id, | ||
RunId: we.GetRunId(), | ||
} | ||
} | ||
|
||
// Adds the test name and a random string as postfix to the given name | ||
func (s *VersioningIntegSuite) randomizeName(name string) string { | ||
return testcore.RandomizeStr(name + "_" + s.T().Name()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean randomizeName? why? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an incomplete test because I realize after starting it that I need TaskPoller to finish the test. So I'm waiting to merge the feature branch to main so then I complete the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think he means we should use testvars
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, sure will use testvars once I get to writing tests.
…er-versioning-info # Conflicts: # api/deployment/v1/message.pb.go # api/historyservice/v1/request_response.pb.go # api/persistence/v1/tasks.pb.go # api/taskqueue/v1/message.pb.go # proto/internal/temporal/server/api/deployment/v1/message.proto # proto/internal/temporal/server/api/historyservice/v1/request_response.proto
…haviors # Conflicts: # common/worker_versioning/worker_versioning.go
…er-versioning-info
…g-behaviors # Conflicts: # common/worker_versioning/worker_versioning.go # service/history/workflow/util.go
func (s *VersioningIntegSuite) startWorkflow() *commonpb.WorkflowExecution { | ||
id := s.randomizeName("my-wf") | ||
wt := "MyWfType" | ||
tqName := "my-tq" | ||
tq := &taskqueuepb.TaskQueue{Name: tqName, Kind: enumspb.TASK_QUEUE_KIND_NORMAL} | ||
identity := "worker1" | ||
|
||
request := &workflowservice.StartWorkflowExecutionRequest{ | ||
RequestId: uuid.New(), | ||
Namespace: s.Namespace(), | ||
WorkflowId: id, | ||
WorkflowType: &commonpb.WorkflowType{Name: wt}, | ||
TaskQueue: tq, | ||
Input: nil, | ||
WorkflowRunTimeout: durationpb.New(100 * time.Second), | ||
WorkflowTaskTimeout: durationpb.New(1 * time.Second), | ||
Identity: identity, | ||
} | ||
|
||
we, err0 := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), request) | ||
s.NoError(err0) | ||
return &commonpb.WorkflowExecution{ | ||
WorkflowId: id, | ||
RunId: we.GetRunId(), | ||
} | ||
} | ||
|
||
// Adds the test name and a random string as postfix to the given name | ||
func (s *VersioningIntegSuite) randomizeName(name string) string { | ||
return testcore.RandomizeStr(name + "_" + s.T().Name()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think he means we should use testvars
instead?
## What changed? <!-- Describe what has changed in this PR --> Handling tasks of pinned workflows. ## Why? <!-- Tell your future self why have you made these changes --> Part of versioning 3. ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> Tests will come in a followup PR. ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) -->
What changed?
Handling tasks of pinned workflows.
Why?
Part of versioning 3.
How did you test it?
Tests will come in a followup PR.
Potential risks
Documentation
Is hotfix candidate?