Skip to content
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

Merged
merged 28 commits into from
Nov 26, 2024
Merged

Conversation

ShahabT
Copy link
Contributor

@ShahabT ShahabT commented Nov 21, 2024

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?

@ShahabT ShahabT requested a review from dnr November 21, 2024 01:32
@ShahabT ShahabT requested a review from a team as a code owner November 21, 2024 01:32
…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
@ShahabT ShahabT changed the base branch from versioning-3 to shahab/v3-internal-protos November 22, 2024 06:33
@ShahabT ShahabT closed this Nov 22, 2024
@ShahabT ShahabT reopened this Nov 22, 2024
@ShahabT ShahabT changed the base branch from shahab/v3-internal-protos to shahab/transfer-versioning-info November 22, 2024 23:42
Comment on lines +41 to +45
nonRootPartitionPrefix = "/_sys/"
partitionDelimiter = "/"
versionSetDelimiter = ":"
buildIdDelimiter = "#"
deploymentNameDelimiter = "|"
Copy link
Member

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.

Comment on lines +45 to +75
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())
}
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't exist at all.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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
Base automatically changed from shahab/transfer-versioning-info to versioning-3 November 25, 2024 19:57
…g-behaviors

# Conflicts:
#	common/worker_versioning/worker_versioning.go
#	service/history/workflow/util.go
service/matching/matching_engine.go Show resolved Hide resolved
service/matching/matching_engine_test.go Outdated Show resolved Hide resolved
service/matching/physical_task_queue_key.go Show resolved Hide resolved
service/matching/physical_task_queue_key.go Outdated Show resolved Hide resolved
service/matching/physical_task_queue_key.go Outdated Show resolved Hide resolved
service/matching/version_rule_helpers.go Outdated Show resolved Hide resolved
tests/versioning_3_test.go Outdated Show resolved Hide resolved
Comment on lines +45 to +75
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())
}
Copy link
Member

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?

tests/versioning_3_test.go Show resolved Hide resolved
@ShahabT ShahabT merged commit 5146f86 into versioning-3 Nov 26, 2024
4 of 6 checks passed
@ShahabT ShahabT deleted the shahab/routing-behaviors branch November 26, 2024 04:10
dnr pushed a commit that referenced this pull request Nov 26, 2024
## 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) -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants