Skip to content

Commit

Permalink
Remove namespace field from ScheduleActivityTaskCommandAttributes mes…
Browse files Browse the repository at this point in the history
…sage (#2753)
  • Loading branch information
alexshtin committed Apr 23, 2022
1 parent fa39d14 commit 58103d7
Show file tree
Hide file tree
Showing 28 changed files with 64 additions and 99 deletions.
11 changes: 6 additions & 5 deletions api/matchingservice/v1/request_response.pb.go

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

9 changes: 5 additions & 4 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: 2 additions & 3 deletions common/persistence/persistence-tests/executionManagerTest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,6 @@ func (s *ExecutionManagerSuite) TestTransferTasksThroughUpdate() {
task2 := tasks2[0]
s.Equal(&tasks.ActivityTask{
WorkflowKey: workflowKey,
TargetNamespaceID: namespaceID,
VisibilityTimestamp: task2.GetVisibilityTime(),
TaskID: task2.GetTaskID(),
TaskQueue: "queue1",
Expand Down Expand Up @@ -2224,7 +2223,7 @@ func (s *ExecutionManagerSuite) TestTransferTasksComplete() {
now := time.Now().UTC()

taskSlice := []tasks.Task{
&tasks.ActivityTask{workflowKey, now, currentTransferID + 10001, namespaceID, taskqueue, scheduleID, 111},
&tasks.ActivityTask{workflowKey, now, currentTransferID + 10001, taskqueue, scheduleID, 111},
&tasks.WorkflowTask{workflowKey, now, currentTransferID + 10002, taskqueue, scheduleID, 222},
&tasks.CloseExecutionTask{workflowKey, now, currentTransferID + 10003, 333},
&tasks.CancelExecutionTask{workflowKey, now, currentTransferID + 10004, targetNamespaceID, targetWorkflowID, targetRunID, true, scheduleID, 444},
Expand Down Expand Up @@ -2328,7 +2327,7 @@ func (s *ExecutionManagerSuite) TestTransferTasksRangeComplete() {
currentTransferID := s.GetTransferReadLevel()
now := time.Now().UTC()
taskSlice := []tasks.Task{
&tasks.ActivityTask{workflowKey, now, currentTransferID + 10001, namespaceID, taskqueue, scheduleID, 111},
&tasks.ActivityTask{workflowKey, now, currentTransferID + 10001, taskqueue, scheduleID, 111},
&tasks.WorkflowTask{workflowKey, now, currentTransferID + 10002, taskqueue, scheduleID, 222},
&tasks.CloseExecutionTask{workflowKey, now, currentTransferID + 10003, 333},
&tasks.CancelExecutionTask{workflowKey, now, currentTransferID + 10004, targetNamespaceID, targetWorkflowID, targetRunID, true, scheduleID, 444},
Expand Down
18 changes: 8 additions & 10 deletions common/persistence/persistence-tests/persistenceTestBase.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,10 @@ func (s *TestBase) CreateWorkflowExecutionManyTasks(ctx context.Context, namespa
for _, activityScheduleID := range activityScheduleIDs {
transferTasks = append(transferTasks,
&tasks.ActivityTask{
WorkflowKey: workflowKey,
TaskID: s.GetNextSequenceNumber(),
TargetNamespaceID: namespaceID,
TaskQueue: taskQueue,
ScheduleID: activityScheduleID,
WorkflowKey: workflowKey,
TaskID: s.GetNextSequenceNumber(),
TaskQueue: taskQueue,
ScheduleID: activityScheduleID,
})
}

Expand Down Expand Up @@ -759,11 +758,10 @@ func (s *TestBase) UpdateWorkflowExecutionWithReplication(ctx context.Context, u

for _, activityScheduleID := range activityScheduleIDs {
transferTasks = append(transferTasks, &tasks.ActivityTask{
WorkflowKey: workflowKey,
TaskID: s.GetNextSequenceNumber(),
TargetNamespaceID: updatedInfo.NamespaceId,
TaskQueue: updatedInfo.TaskQueue,
ScheduleID: activityScheduleID})
WorkflowKey: workflowKey,
TaskID: s.GetNextSequenceNumber(),
TaskQueue: updatedInfo.TaskQueue,
ScheduleID: activityScheduleID})
}
_, err := s.ExecutionManager.UpdateWorkflowExecution(ctx, &persistence.UpdateWorkflowExecutionRequest{
ShardID: s.ShardInfo.GetShardId(),
Expand Down
3 changes: 1 addition & 2 deletions common/persistence/serialization/task_serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (s *TaskSerializer) transferActivityTaskToProto(
WorkflowId: activityTask.WorkflowKey.WorkflowID,
RunId: activityTask.WorkflowKey.RunID,
TaskType: enumsspb.TASK_TYPE_TRANSFER_ACTIVITY_TASK,
TargetNamespaceId: activityTask.TargetNamespaceID,
TargetNamespaceId: activityTask.WorkflowKey.NamespaceID,
TargetWorkflowId: "",
TargetRunId: "",
TargetChildWorkflowOnly: false,
Expand All @@ -327,7 +327,6 @@ func (s *TaskSerializer) transferActivityTaskFromProto(
),
VisibilityTimestamp: *activityTask.VisibilityTime,
TaskID: activityTask.TaskId,
TargetNamespaceID: activityTask.TargetNamespaceId,
TaskQueue: activityTask.TaskQueue,
ScheduleID: activityTask.ScheduleId,
Version: activityTask.Version,
Expand Down
2 changes: 1 addition & 1 deletion common/persistence/serialization/task_serializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
enumspb "go.temporal.io/api/enums/v1"

enumsspb "go.temporal.io/server/api/enums/v1"
"go.temporal.io/server/common/definition"
"go.temporal.io/server/common/shuffle"
Expand Down Expand Up @@ -94,7 +95,6 @@ func (s *taskSerializerSuite) TestTransferActivityTask() {
WorkflowKey: s.workflowKey,
VisibilityTimestamp: time.Unix(0, rand.Int63()).UTC(),
TaskID: rand.Int63(),
TargetNamespaceID: uuid.New().String(),
TaskQueue: shuffle.String("random task queue name"),
ScheduleID: rand.Int63(),
Version: rand.Int63(),
Expand Down
1 change: 0 additions & 1 deletion common/testing/history_event_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ func InitializeHistoryEventGenerator(
historyEvent.Attributes = &historypb.HistoryEvent_ActivityTaskScheduledEventAttributes{ActivityTaskScheduledEventAttributes: &historypb.ActivityTaskScheduledEventAttributes{
ActivityId: uuid.New(),
ActivityType: &commonpb.ActivityType{Name: "activity"},
Namespace: namespace,
TaskQueue: &taskqueuepb.TaskQueue{
Name: taskQueue,
Kind: enumspb.TASK_QUEUE_KIND_NORMAL,
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ require (
go.opentelemetry.io/otel/metric v0.29.0
go.opentelemetry.io/otel/sdk v1.6.3
go.opentelemetry.io/otel/sdk/metric v0.29.0
go.temporal.io/api v1.7.1-0.20220421224243-d3e741a1fbe3
go.temporal.io/sdk v1.14.0
go.temporal.io/api v1.7.1-0.20220422210026-a8393024cc6b
go.temporal.io/sdk v1.14.1-0.20220422211740-4e64c51b6b07
go.temporal.io/version v0.3.0
go.uber.org/atomic v1.9.0
go.uber.org/fx v1.17.1
Expand All @@ -47,7 +47,7 @@ require (
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
golang.org/x/time v0.0.0-20220411224347-583f2d630306
google.golang.org/api v0.74.0
google.golang.org/grpc v1.45.0
google.golang.org/grpc v1.46.0
google.golang.org/grpc/examples v0.0.0-20220412212246-3bf6719fc8ab
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/validator.v2 v2.0.1
Expand Down Expand Up @@ -103,13 +103,13 @@ require (
go.uber.org/dig v1.14.1 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220420153159-1850ba15e1be // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 // indirect
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3 // indirect
google.golang.org/genproto v0.0.0-20220422154200-b37d22cd5731 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
Expand Down

0 comments on commit 58103d7

Please sign in to comment.