From 85bb4e76ab8770df2d61a3970d951546414ea9ef Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Fri, 12 Aug 2022 08:54:22 -0700 Subject: [PATCH] Versioning metadata propagation between partitions (#3166) Ensures versioning metadata is propagated between different partitions of workflow and activity queues Does this both by sending explicit invalidations from the root WF queue to the others, and by enabling a periodic poller in non-root-wf partitions. --- api/matchingservice/v1/request_response.pb.go | 1811 ++++++++++++++--- api/matchingservice/v1/service.pb.go | 148 +- api/matchingservicemock/v1/service.pb.mock.go | 70 + client/matching/client_gen.go | 30 + client/matching/metric_client_gen.go | 28 + client/matching/retryable_client_gen.go | 30 + common/dynamicconfig/constants.go | 2 + common/metrics/defs.go | 14 +- host/versioning_test.go | 64 + .../matchingservice/v1/request_response.proto | 30 + .../api/matchingservice/v1/service.proto | 5 +- service/matching/config.go | 2 + service/matching/configs/quotas.go | 2 + service/matching/db.go | 102 +- service/matching/handler.go | 45 +- service/matching/matchingEngine.go | 55 + service/matching/matchingEngineInterfaces.go | 4 +- service/matching/matchingEngine_test.go | 49 +- service/matching/taskQueueManager.go | 224 +- service/matching/taskQueueManager_test.go | 410 +++- service/matching/taskqueue.go | 52 +- service/matching/taskqueue_test.go | 20 + service/matching/version_graph.go | 18 + 23 files changed, 2840 insertions(+), 375 deletions(-) diff --git a/api/matchingservice/v1/request_response.pb.go b/api/matchingservice/v1/request_response.pb.go index 533be941c54..eb4c2966939 100644 --- a/api/matchingservice/v1/request_response.pb.go +++ b/api/matchingservice/v1/request_response.pb.go @@ -50,6 +50,7 @@ import ( v16 "go.temporal.io/server/api/clock/v1" v15 "go.temporal.io/server/api/enums/v1" v13 "go.temporal.io/server/api/history/v1" + v18 "go.temporal.io/server/api/persistence/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -1519,6 +1520,261 @@ func (m *GetWorkerBuildIdOrderingResponse) GetResponse() *v1.GetWorkerBuildIdOrd return nil } +type InvalidateTaskQueueMetadataRequest struct { + NamespaceId string `protobuf:"bytes,1,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` + TaskQueue string `protobuf:"bytes,2,opt,name=task_queue,json=taskQueue,proto3" json:"task_queue,omitempty"` + TaskQueueType v17.TaskQueueType `protobuf:"varint,3,opt,name=task_queue_type,json=taskQueueType,proto3,enum=temporal.api.enums.v1.TaskQueueType" json:"task_queue_type,omitempty"` + // The task queue versioning data should be invalidated and replaced with this data, if set. + VersioningData *v18.VersioningData `protobuf:"bytes,4,opt,name=versioning_data,json=versioningData,proto3" json:"versioning_data,omitempty"` +} + +func (m *InvalidateTaskQueueMetadataRequest) Reset() { *m = InvalidateTaskQueueMetadataRequest{} } +func (*InvalidateTaskQueueMetadataRequest) ProtoMessage() {} +func (*InvalidateTaskQueueMetadataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a429a3813476c583, []int{22} +} +func (m *InvalidateTaskQueueMetadataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InvalidateTaskQueueMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InvalidateTaskQueueMetadataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InvalidateTaskQueueMetadataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InvalidateTaskQueueMetadataRequest.Merge(m, src) +} +func (m *InvalidateTaskQueueMetadataRequest) XXX_Size() int { + return m.Size() +} +func (m *InvalidateTaskQueueMetadataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InvalidateTaskQueueMetadataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_InvalidateTaskQueueMetadataRequest proto.InternalMessageInfo + +func (m *InvalidateTaskQueueMetadataRequest) GetNamespaceId() string { + if m != nil { + return m.NamespaceId + } + return "" +} + +func (m *InvalidateTaskQueueMetadataRequest) GetTaskQueue() string { + if m != nil { + return m.TaskQueue + } + return "" +} + +func (m *InvalidateTaskQueueMetadataRequest) GetTaskQueueType() v17.TaskQueueType { + if m != nil { + return m.TaskQueueType + } + return v17.TASK_QUEUE_TYPE_UNSPECIFIED +} + +func (m *InvalidateTaskQueueMetadataRequest) GetVersioningData() *v18.VersioningData { + if m != nil { + return m.VersioningData + } + return nil +} + +type InvalidateTaskQueueMetadataResponse struct { +} + +func (m *InvalidateTaskQueueMetadataResponse) Reset() { *m = InvalidateTaskQueueMetadataResponse{} } +func (*InvalidateTaskQueueMetadataResponse) ProtoMessage() {} +func (*InvalidateTaskQueueMetadataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a429a3813476c583, []int{23} +} +func (m *InvalidateTaskQueueMetadataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InvalidateTaskQueueMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InvalidateTaskQueueMetadataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InvalidateTaskQueueMetadataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InvalidateTaskQueueMetadataResponse.Merge(m, src) +} +func (m *InvalidateTaskQueueMetadataResponse) XXX_Size() int { + return m.Size() +} +func (m *InvalidateTaskQueueMetadataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InvalidateTaskQueueMetadataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_InvalidateTaskQueueMetadataResponse proto.InternalMessageInfo + +type GetTaskQueueMetadataRequest struct { + NamespaceId string `protobuf:"bytes,1,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` + // The task queue to fetch data from. Is always considered as a workflow queue, since root + // workflow queues own the metadata. + TaskQueue string `protobuf:"bytes,2,opt,name=task_queue,json=taskQueue,proto3" json:"task_queue,omitempty"` + // If set nonempty, the requester wants the latest versioning data. The value must be the hash + // (using farm hash Fingerprint64) of the latest versioning data. If the requester has no data, + // it can use any invalid value (ex: [0]). + // If the data is up to date, no value will be returned. + WantVersioningDataCurhash []byte `protobuf:"bytes,3,opt,name=want_versioning_data_curhash,json=wantVersioningDataCurhash,proto3" json:"want_versioning_data_curhash,omitempty"` +} + +func (m *GetTaskQueueMetadataRequest) Reset() { *m = GetTaskQueueMetadataRequest{} } +func (*GetTaskQueueMetadataRequest) ProtoMessage() {} +func (*GetTaskQueueMetadataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a429a3813476c583, []int{24} +} +func (m *GetTaskQueueMetadataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetTaskQueueMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetTaskQueueMetadataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetTaskQueueMetadataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTaskQueueMetadataRequest.Merge(m, src) +} +func (m *GetTaskQueueMetadataRequest) XXX_Size() int { + return m.Size() +} +func (m *GetTaskQueueMetadataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetTaskQueueMetadataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTaskQueueMetadataRequest proto.InternalMessageInfo + +func (m *GetTaskQueueMetadataRequest) GetNamespaceId() string { + if m != nil { + return m.NamespaceId + } + return "" +} + +func (m *GetTaskQueueMetadataRequest) GetTaskQueue() string { + if m != nil { + return m.TaskQueue + } + return "" +} + +func (m *GetTaskQueueMetadataRequest) GetWantVersioningDataCurhash() []byte { + if m != nil { + return m.WantVersioningDataCurhash + } + return nil +} + +type GetTaskQueueMetadataResponse struct { + // Types that are valid to be assigned to VersioningDataResp: + // *GetTaskQueueMetadataResponse_VersioningData + // *GetTaskQueueMetadataResponse_MatchedReqHash + VersioningDataResp isGetTaskQueueMetadataResponse_VersioningDataResp `protobuf_oneof:"versioning_data_resp"` +} + +func (m *GetTaskQueueMetadataResponse) Reset() { *m = GetTaskQueueMetadataResponse{} } +func (*GetTaskQueueMetadataResponse) ProtoMessage() {} +func (*GetTaskQueueMetadataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a429a3813476c583, []int{25} +} +func (m *GetTaskQueueMetadataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetTaskQueueMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetTaskQueueMetadataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetTaskQueueMetadataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTaskQueueMetadataResponse.Merge(m, src) +} +func (m *GetTaskQueueMetadataResponse) XXX_Size() int { + return m.Size() +} +func (m *GetTaskQueueMetadataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetTaskQueueMetadataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTaskQueueMetadataResponse proto.InternalMessageInfo + +type isGetTaskQueueMetadataResponse_VersioningDataResp interface { + isGetTaskQueueMetadataResponse_VersioningDataResp() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type GetTaskQueueMetadataResponse_VersioningData struct { + VersioningData *v18.VersioningData `protobuf:"bytes,1,opt,name=versioning_data,json=versioningData,proto3,oneof" json:"versioning_data,omitempty"` +} +type GetTaskQueueMetadataResponse_MatchedReqHash struct { + MatchedReqHash bool `protobuf:"varint,2,opt,name=matched_req_hash,json=matchedReqHash,proto3,oneof" json:"matched_req_hash,omitempty"` +} + +func (*GetTaskQueueMetadataResponse_VersioningData) isGetTaskQueueMetadataResponse_VersioningDataResp() { +} +func (*GetTaskQueueMetadataResponse_MatchedReqHash) isGetTaskQueueMetadataResponse_VersioningDataResp() { +} + +func (m *GetTaskQueueMetadataResponse) GetVersioningDataResp() isGetTaskQueueMetadataResponse_VersioningDataResp { + if m != nil { + return m.VersioningDataResp + } + return nil +} + +func (m *GetTaskQueueMetadataResponse) GetVersioningData() *v18.VersioningData { + if x, ok := m.GetVersioningDataResp().(*GetTaskQueueMetadataResponse_VersioningData); ok { + return x.VersioningData + } + return nil +} + +func (m *GetTaskQueueMetadataResponse) GetMatchedReqHash() bool { + if x, ok := m.GetVersioningDataResp().(*GetTaskQueueMetadataResponse_MatchedReqHash); ok { + return x.MatchedReqHash + } + return false +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*GetTaskQueueMetadataResponse) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*GetTaskQueueMetadataResponse_VersioningData)(nil), + (*GetTaskQueueMetadataResponse_MatchedReqHash)(nil), + } +} + func init() { proto.RegisterType((*PollWorkflowTaskQueueRequest)(nil), "temporal.server.api.matchingservice.v1.PollWorkflowTaskQueueRequest") proto.RegisterType((*PollWorkflowTaskQueueResponse)(nil), "temporal.server.api.matchingservice.v1.PollWorkflowTaskQueueResponse") @@ -1543,6 +1799,10 @@ func init() { proto.RegisterType((*UpdateWorkerBuildIdOrderingResponse)(nil), "temporal.server.api.matchingservice.v1.UpdateWorkerBuildIdOrderingResponse") proto.RegisterType((*GetWorkerBuildIdOrderingRequest)(nil), "temporal.server.api.matchingservice.v1.GetWorkerBuildIdOrderingRequest") proto.RegisterType((*GetWorkerBuildIdOrderingResponse)(nil), "temporal.server.api.matchingservice.v1.GetWorkerBuildIdOrderingResponse") + proto.RegisterType((*InvalidateTaskQueueMetadataRequest)(nil), "temporal.server.api.matchingservice.v1.InvalidateTaskQueueMetadataRequest") + proto.RegisterType((*InvalidateTaskQueueMetadataResponse)(nil), "temporal.server.api.matchingservice.v1.InvalidateTaskQueueMetadataResponse") + proto.RegisterType((*GetTaskQueueMetadataRequest)(nil), "temporal.server.api.matchingservice.v1.GetTaskQueueMetadataRequest") + proto.RegisterType((*GetTaskQueueMetadataResponse)(nil), "temporal.server.api.matchingservice.v1.GetTaskQueueMetadataResponse") } func init() { @@ -1550,123 +1810,134 @@ func init() { } var fileDescriptor_a429a3813476c583 = []byte{ - // 1852 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x6f, 0xdc, 0xc6, - 0x15, 0x17, 0x57, 0x9f, 0xfb, 0x76, 0x25, 0xaf, 0x98, 0x46, 0x5e, 0xc9, 0x36, 0x25, 0xaf, 0xf3, - 0x21, 0x07, 0xee, 0x0a, 0x56, 0x11, 0x23, 0x49, 0x1b, 0x24, 0xf2, 0xda, 0x70, 0xd4, 0x3a, 0x89, - 0x4c, 0xab, 0x69, 0x61, 0x34, 0x60, 0x46, 0xe4, 0x68, 0xc5, 0x2e, 0x97, 0x43, 0x71, 0x86, 0x52, - 0xd4, 0x53, 0x83, 0xa2, 0xc7, 0x02, 0x01, 0x7a, 0x69, 0xd1, 0x4b, 0x4f, 0x45, 0x7b, 0x2c, 0xd0, - 0x3f, 0xa2, 0x87, 0x1e, 0x7c, 0xcc, 0xad, 0xb5, 0x7c, 0x29, 0xd0, 0x8b, 0xfb, 0x1f, 0x14, 0xf3, - 0x41, 0x72, 0xc9, 0xe5, 0x6a, 0x57, 0x6b, 0xa3, 0xce, 0x4d, 0x7c, 0x1f, 0xbf, 0x79, 0xef, 0xcd, - 0xfb, 0x9a, 0x15, 0xbc, 0xcf, 0x70, 0x37, 0x20, 0x21, 0xf2, 0x36, 0x28, 0x0e, 0x8f, 0x70, 0xb8, - 0x81, 0x02, 0x77, 0xa3, 0x8b, 0x98, 0x7d, 0xe0, 0xfa, 0x6d, 0x4e, 0x72, 0x6d, 0xbc, 0x71, 0x74, - 0x73, 0x23, 0xc4, 0x87, 0x11, 0xa6, 0xcc, 0x0a, 0x31, 0x0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- 0x6a, 0x68, 0xff, 0x3a, 0x35, 0xb4, 0x7f, 0x9f, 0x1a, 0x13, 0xcf, 0x4e, 0x0d, 0xed, 0xeb, 0xa7, - 0xc6, 0xc4, 0xe3, 0xa7, 0xc6, 0xc4, 0x37, 0x4f, 0x8d, 0x89, 0x47, 0x3f, 0x68, 0x93, 0xd4, 0x08, - 0x97, 0x9c, 0xfd, 0x8f, 0xa7, 0xef, 0xe7, 0x48, 0x7b, 0x33, 0x62, 0xbf, 0xfc, 0xde, 0xff, 0x02, - 0x00, 0x00, 0xff, 0xff, 0xa1, 0x9b, 0x98, 0xf2, 0xb9, 0x1a, 0x00, 0x00, + // 2022 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4b, 0x73, 0xdb, 0xd6, + 0x15, 0x16, 0xa8, 0x27, 0x0f, 0x29, 0x89, 0x42, 0x12, 0x99, 0x92, 0x25, 0x48, 0xa6, 0xf3, 0x90, + 0x3d, 0x2e, 0x35, 0x56, 0x27, 0x9e, 0x24, 0x6d, 0xc6, 0x91, 0x68, 0x8f, 0xcd, 0xd6, 0x49, 0x64, + 0x58, 0x4d, 0x3b, 0x6e, 0x33, 0xc8, 0x15, 0x70, 0x45, 0xa2, 0x04, 0x01, 0x0a, 0xf7, 0x82, 0x8a, + 0xba, 0x6a, 0xa6, 0xd3, 0x65, 0x67, 0xd2, 0xe9, 0xa6, 0x9d, 0x6e, 0xba, 0xea, 0xb4, 0xcb, 0xce, + 0xf4, 0x0f, 0x74, 0xd7, 0x45, 0x17, 0x5e, 0x66, 0xd7, 0x5a, 0xde, 0x74, 0xa6, 0x9b, 0xf4, 0x1f, + 0x74, 0xee, 0x03, 0x00, 0x01, 0x82, 0x22, 0x45, 0xbb, 0x75, 0x77, 0xc4, 0x79, 0xdd, 0x73, 0xce, + 0xfd, 0xce, 0x03, 0x20, 0xbc, 0x4f, 0x71, 0xbb, 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fc, + 0x27, 0x4f, 0xb5, 0x89, 0xaf, 0x9e, 0x6a, 0x13, 0x5f, 0x3f, 0xd5, 0x94, 0x9f, 0x9e, 0x69, 0xca, + 0x1f, 0xce, 0x34, 0xe5, 0xaf, 0x67, 0x9a, 0xf2, 0xe4, 0x4c, 0x53, 0xfe, 0x71, 0xa6, 0x29, 0xff, + 0x3c, 0xd3, 0x26, 0xbe, 0x3e, 0xd3, 0x94, 0x2f, 0x9f, 0x69, 0x13, 0x4f, 0x9e, 0x69, 0x13, 0x5f, + 0x3d, 0xd3, 0x26, 0x1e, 0x7f, 0xbb, 0xe1, 0xc5, 0x11, 0xd8, 0xde, 0xf9, 0x7f, 0xa5, 0x7e, 0x2b, + 0x45, 0x3a, 0x9c, 0xe1, 0x6f, 0x40, 0xdf, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x34, 0x33, + 0x5a, 0x77, 0x8b, 0x1d, 0x00, 0x00, } func (this *PollWorkflowTaskQueueRequest) Equal(that interface{}) bool { @@ -2453,82 +2724,244 @@ func (this *GetWorkerBuildIdOrderingResponse) Equal(that interface{}) bool { } return true } -func (this *PollWorkflowTaskQueueRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&matchingservice.PollWorkflowTaskQueueRequest{") - s = append(s, "NamespaceId: "+fmt.Sprintf("%#v", this.NamespaceId)+",\n") - s = append(s, "PollerId: "+fmt.Sprintf("%#v", this.PollerId)+",\n") - if this.PollRequest != nil { - s = append(s, "PollRequest: "+fmt.Sprintf("%#v", this.PollRequest)+",\n") +func (this *InvalidateTaskQueueMetadataRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s = append(s, "ForwardedSource: "+fmt.Sprintf("%#v", this.ForwardedSource)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PollWorkflowTaskQueueResponse) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*InvalidateTaskQueueMetadataRequest) + if !ok { + that2, ok := that.(InvalidateTaskQueueMetadataRequest) + if ok { + that1 = &that2 + } else { + return false + } } - s := make([]string, 0, 20) - s = append(s, "&matchingservice.PollWorkflowTaskQueueResponse{") - s = append(s, "TaskToken: "+fmt.Sprintf("%#v", this.TaskToken)+",\n") - if this.WorkflowExecution != nil { - s = append(s, "WorkflowExecution: "+fmt.Sprintf("%#v", this.WorkflowExecution)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - if this.WorkflowType != nil { - s = append(s, "WorkflowType: "+fmt.Sprintf("%#v", this.WorkflowType)+",\n") + if this.NamespaceId != that1.NamespaceId { + return false } - s = append(s, "PreviousStartedEventId: "+fmt.Sprintf("%#v", this.PreviousStartedEventId)+",\n") - s = append(s, "StartedEventId: "+fmt.Sprintf("%#v", this.StartedEventId)+",\n") - s = append(s, "Attempt: "+fmt.Sprintf("%#v", this.Attempt)+",\n") - s = append(s, "NextEventId: "+fmt.Sprintf("%#v", this.NextEventId)+",\n") - s = append(s, "BacklogCountHint: "+fmt.Sprintf("%#v", this.BacklogCountHint)+",\n") - s = append(s, "StickyExecutionEnabled: "+fmt.Sprintf("%#v", this.StickyExecutionEnabled)+",\n") - if this.Query != nil { - s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") + if this.TaskQueue != that1.TaskQueue { + return false } - if this.TransientWorkflowTask != nil { - s = append(s, "TransientWorkflowTask: "+fmt.Sprintf("%#v", this.TransientWorkflowTask)+",\n") + if this.TaskQueueType != that1.TaskQueueType { + return false } - if this.WorkflowExecutionTaskQueue != nil { - s = append(s, "WorkflowExecutionTaskQueue: "+fmt.Sprintf("%#v", this.WorkflowExecutionTaskQueue)+",\n") + if !this.VersioningData.Equal(that1.VersioningData) { + return false } - s = append(s, "BranchToken: "+fmt.Sprintf("%#v", this.BranchToken)+",\n") - s = append(s, "ScheduledTime: "+fmt.Sprintf("%#v", this.ScheduledTime)+",\n") - s = append(s, "StartedTime: "+fmt.Sprintf("%#v", this.StartedTime)+",\n") - keysForQueries := make([]string, 0, len(this.Queries)) - for k, _ := range this.Queries { - keysForQueries = append(keysForQueries, k) + return true +} +func (this *InvalidateTaskQueueMetadataResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil } - github_com_gogo_protobuf_sortkeys.Strings(keysForQueries) - mapStringForQueries := "map[string]*v12.WorkflowQuery{" - for _, k := range keysForQueries { - mapStringForQueries += fmt.Sprintf("%#v: %#v,", k, this.Queries[k]) + + that1, ok := that.(*InvalidateTaskQueueMetadataResponse) + if !ok { + that2, ok := that.(InvalidateTaskQueueMetadataResponse) + if ok { + that1 = &that2 + } else { + return false + } } - mapStringForQueries += "}" - if this.Queries != nil { - s = append(s, "Queries: "+mapStringForQueries+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *PollActivityTaskQueueRequest) GoString() string { - if this == nil { - return "nil" +func (this *GetTaskQueueMetadataRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 8) - s = append(s, "&matchingservice.PollActivityTaskQueueRequest{") - s = append(s, "NamespaceId: "+fmt.Sprintf("%#v", this.NamespaceId)+",\n") - s = append(s, "PollerId: "+fmt.Sprintf("%#v", this.PollerId)+",\n") - if this.PollRequest != nil { - s = append(s, "PollRequest: "+fmt.Sprintf("%#v", this.PollRequest)+",\n") + + that1, ok := that.(*GetTaskQueueMetadataRequest) + if !ok { + that2, ok := that.(GetTaskQueueMetadataRequest) + if ok { + that1 = &that2 + } else { + return false + } } - s = append(s, "ForwardedSource: "+fmt.Sprintf("%#v", this.ForwardedSource)+",\n") - s = append(s, "}") - return strings.Join(s, "") + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.NamespaceId != that1.NamespaceId { + return false + } + if this.TaskQueue != that1.TaskQueue { + return false + } + if !bytes.Equal(this.WantVersioningDataCurhash, that1.WantVersioningDataCurhash) { + return false + } + return true +} +func (this *GetTaskQueueMetadataResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetTaskQueueMetadataResponse) + if !ok { + that2, ok := that.(GetTaskQueueMetadataResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.VersioningDataResp == nil { + if this.VersioningDataResp != nil { + return false + } + } else if this.VersioningDataResp == nil { + return false + } else if !this.VersioningDataResp.Equal(that1.VersioningDataResp) { + return false + } + return true +} +func (this *GetTaskQueueMetadataResponse_VersioningData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetTaskQueueMetadataResponse_VersioningData) + if !ok { + that2, ok := that.(GetTaskQueueMetadataResponse_VersioningData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.VersioningData.Equal(that1.VersioningData) { + return false + } + return true +} +func (this *GetTaskQueueMetadataResponse_MatchedReqHash) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetTaskQueueMetadataResponse_MatchedReqHash) + if !ok { + that2, ok := that.(GetTaskQueueMetadataResponse_MatchedReqHash) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.MatchedReqHash != that1.MatchedReqHash { + return false + } + return true +} +func (this *PollWorkflowTaskQueueRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&matchingservice.PollWorkflowTaskQueueRequest{") + s = append(s, "NamespaceId: "+fmt.Sprintf("%#v", this.NamespaceId)+",\n") + s = append(s, "PollerId: "+fmt.Sprintf("%#v", this.PollerId)+",\n") + if this.PollRequest != nil { + s = append(s, "PollRequest: "+fmt.Sprintf("%#v", this.PollRequest)+",\n") + } + s = append(s, "ForwardedSource: "+fmt.Sprintf("%#v", this.ForwardedSource)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PollWorkflowTaskQueueResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 20) + s = append(s, "&matchingservice.PollWorkflowTaskQueueResponse{") + s = append(s, "TaskToken: "+fmt.Sprintf("%#v", this.TaskToken)+",\n") + if this.WorkflowExecution != nil { + s = append(s, "WorkflowExecution: "+fmt.Sprintf("%#v", this.WorkflowExecution)+",\n") + } + if this.WorkflowType != nil { + s = append(s, "WorkflowType: "+fmt.Sprintf("%#v", this.WorkflowType)+",\n") + } + s = append(s, "PreviousStartedEventId: "+fmt.Sprintf("%#v", this.PreviousStartedEventId)+",\n") + s = append(s, "StartedEventId: "+fmt.Sprintf("%#v", this.StartedEventId)+",\n") + s = append(s, "Attempt: "+fmt.Sprintf("%#v", this.Attempt)+",\n") + s = append(s, "NextEventId: "+fmt.Sprintf("%#v", this.NextEventId)+",\n") + s = append(s, "BacklogCountHint: "+fmt.Sprintf("%#v", this.BacklogCountHint)+",\n") + s = append(s, "StickyExecutionEnabled: "+fmt.Sprintf("%#v", this.StickyExecutionEnabled)+",\n") + if this.Query != nil { + s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") + } + if this.TransientWorkflowTask != nil { + s = append(s, "TransientWorkflowTask: "+fmt.Sprintf("%#v", this.TransientWorkflowTask)+",\n") + } + if this.WorkflowExecutionTaskQueue != nil { + s = append(s, "WorkflowExecutionTaskQueue: "+fmt.Sprintf("%#v", this.WorkflowExecutionTaskQueue)+",\n") + } + s = append(s, "BranchToken: "+fmt.Sprintf("%#v", this.BranchToken)+",\n") + s = append(s, "ScheduledTime: "+fmt.Sprintf("%#v", this.ScheduledTime)+",\n") + s = append(s, "StartedTime: "+fmt.Sprintf("%#v", this.StartedTime)+",\n") + keysForQueries := make([]string, 0, len(this.Queries)) + for k, _ := range this.Queries { + keysForQueries = append(keysForQueries, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForQueries) + mapStringForQueries := "map[string]*v12.WorkflowQuery{" + for _, k := range keysForQueries { + mapStringForQueries += fmt.Sprintf("%#v: %#v,", k, this.Queries[k]) + } + mapStringForQueries += "}" + if this.Queries != nil { + s = append(s, "Queries: "+mapStringForQueries+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PollActivityTaskQueueRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&matchingservice.PollActivityTaskQueueRequest{") + s = append(s, "NamespaceId: "+fmt.Sprintf("%#v", this.NamespaceId)+",\n") + s = append(s, "PollerId: "+fmt.Sprintf("%#v", this.PollerId)+",\n") + if this.PollRequest != nil { + s = append(s, "PollRequest: "+fmt.Sprintf("%#v", this.PollRequest)+",\n") + } + s = append(s, "ForwardedSource: "+fmt.Sprintf("%#v", this.ForwardedSource)+",\n") + s = append(s, "}") + return strings.Join(s, "") } func (this *PollActivityTaskQueueResponse) GoString() string { if this == nil { @@ -2817,6 +3250,70 @@ func (this *GetWorkerBuildIdOrderingResponse) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func (this *InvalidateTaskQueueMetadataRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&matchingservice.InvalidateTaskQueueMetadataRequest{") + s = append(s, "NamespaceId: "+fmt.Sprintf("%#v", this.NamespaceId)+",\n") + s = append(s, "TaskQueue: "+fmt.Sprintf("%#v", this.TaskQueue)+",\n") + s = append(s, "TaskQueueType: "+fmt.Sprintf("%#v", this.TaskQueueType)+",\n") + if this.VersioningData != nil { + s = append(s, "VersioningData: "+fmt.Sprintf("%#v", this.VersioningData)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *InvalidateTaskQueueMetadataResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&matchingservice.InvalidateTaskQueueMetadataResponse{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetTaskQueueMetadataRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&matchingservice.GetTaskQueueMetadataRequest{") + s = append(s, "NamespaceId: "+fmt.Sprintf("%#v", this.NamespaceId)+",\n") + s = append(s, "TaskQueue: "+fmt.Sprintf("%#v", this.TaskQueue)+",\n") + s = append(s, "WantVersioningDataCurhash: "+fmt.Sprintf("%#v", this.WantVersioningDataCurhash)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetTaskQueueMetadataResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&matchingservice.GetTaskQueueMetadataResponse{") + if this.VersioningDataResp != nil { + s = append(s, "VersioningDataResp: "+fmt.Sprintf("%#v", this.VersioningDataResp)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetTaskQueueMetadataResponse_VersioningData) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&matchingservice.GetTaskQueueMetadataResponse_VersioningData{` + + `VersioningData:` + fmt.Sprintf("%#v", this.VersioningData) + `}`}, ", ") + return s +} +func (this *GetTaskQueueMetadataResponse_MatchedReqHash) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&matchingservice.GetTaskQueueMetadataResponse_MatchedReqHash{` + + `MatchedReqHash:` + fmt.Sprintf("%#v", this.MatchedReqHash) + `}`}, ", ") + return s +} func valueToGoStringRequestResponse(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -4136,43 +4633,234 @@ func (m *GetWorkerBuildIdOrderingResponse) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func encodeVarintRequestResponse(dAtA []byte, offset int, v uint64) int { - offset -= sovRequestResponse(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *InvalidateTaskQueueMetadataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *PollWorkflowTaskQueueRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *InvalidateTaskQueueMetadataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InvalidateTaskQueueMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.NamespaceId) - if l > 0 { - n += 1 + l + sovRequestResponse(uint64(l)) + if m.VersioningData != nil { + { + size, err := m.VersioningData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequestResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - l = len(m.PollerId) - if l > 0 { - n += 1 + l + sovRequestResponse(uint64(l)) + if m.TaskQueueType != 0 { + i = encodeVarintRequestResponse(dAtA, i, uint64(m.TaskQueueType)) + i-- + dAtA[i] = 0x18 } - if m.PollRequest != nil { - l = m.PollRequest.Size() - n += 1 + l + sovRequestResponse(uint64(l)) + if len(m.TaskQueue) > 0 { + i -= len(m.TaskQueue) + copy(dAtA[i:], m.TaskQueue) + i = encodeVarintRequestResponse(dAtA, i, uint64(len(m.TaskQueue))) + i-- + dAtA[i] = 0x12 } - l = len(m.ForwardedSource) - if l > 0 { - n += 1 + l + sovRequestResponse(uint64(l)) + if len(m.NamespaceId) > 0 { + i -= len(m.NamespaceId) + copy(dAtA[i:], m.NamespaceId) + i = encodeVarintRequestResponse(dAtA, i, uint64(len(m.NamespaceId))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *PollWorkflowTaskQueueResponse) Size() (n int) { +func (m *InvalidateTaskQueueMetadataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InvalidateTaskQueueMetadataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InvalidateTaskQueueMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetTaskQueueMetadataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetTaskQueueMetadataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTaskQueueMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WantVersioningDataCurhash) > 0 { + i -= len(m.WantVersioningDataCurhash) + copy(dAtA[i:], m.WantVersioningDataCurhash) + i = encodeVarintRequestResponse(dAtA, i, uint64(len(m.WantVersioningDataCurhash))) + i-- + dAtA[i] = 0x1a + } + if len(m.TaskQueue) > 0 { + i -= len(m.TaskQueue) + copy(dAtA[i:], m.TaskQueue) + i = encodeVarintRequestResponse(dAtA, i, uint64(len(m.TaskQueue))) + i-- + dAtA[i] = 0x12 + } + if len(m.NamespaceId) > 0 { + i -= len(m.NamespaceId) + copy(dAtA[i:], m.NamespaceId) + i = encodeVarintRequestResponse(dAtA, i, uint64(len(m.NamespaceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetTaskQueueMetadataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetTaskQueueMetadataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTaskQueueMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VersioningDataResp != nil { + { + size := m.VersioningDataResp.Size() + i -= size + if _, err := m.VersioningDataResp.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *GetTaskQueueMetadataResponse_VersioningData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTaskQueueMetadataResponse_VersioningData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.VersioningData != nil { + { + size, err := m.VersioningData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRequestResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *GetTaskQueueMetadataResponse_MatchedReqHash) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTaskQueueMetadataResponse_MatchedReqHash) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.MatchedReqHash { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func encodeVarintRequestResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovRequestResponse(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PollWorkflowTaskQueueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NamespaceId) + if l > 0 { + n += 1 + l + sovRequestResponse(uint64(l)) + } + l = len(m.PollerId) + if l > 0 { + n += 1 + l + sovRequestResponse(uint64(l)) + } + if m.PollRequest != nil { + l = m.PollRequest.Size() + n += 1 + l + sovRequestResponse(uint64(l)) + } + l = len(m.ForwardedSource) + if l > 0 { + n += 1 + l + sovRequestResponse(uint64(l)) + } + return n +} + +func (m *PollWorkflowTaskQueueResponse) Size() (n int) { if m == nil { return 0 } @@ -4684,6 +5372,94 @@ func (m *GetWorkerBuildIdOrderingResponse) Size() (n int) { return n } +func (m *InvalidateTaskQueueMetadataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NamespaceId) + if l > 0 { + n += 1 + l + sovRequestResponse(uint64(l)) + } + l = len(m.TaskQueue) + if l > 0 { + n += 1 + l + sovRequestResponse(uint64(l)) + } + if m.TaskQueueType != 0 { + n += 1 + sovRequestResponse(uint64(m.TaskQueueType)) + } + if m.VersioningData != nil { + l = m.VersioningData.Size() + n += 1 + l + sovRequestResponse(uint64(l)) + } + return n +} + +func (m *InvalidateTaskQueueMetadataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetTaskQueueMetadataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NamespaceId) + if l > 0 { + n += 1 + l + sovRequestResponse(uint64(l)) + } + l = len(m.TaskQueue) + if l > 0 { + n += 1 + l + sovRequestResponse(uint64(l)) + } + l = len(m.WantVersioningDataCurhash) + if l > 0 { + n += 1 + l + sovRequestResponse(uint64(l)) + } + return n +} + +func (m *GetTaskQueueMetadataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VersioningDataResp != nil { + n += m.VersioningDataResp.Size() + } + return n +} + +func (m *GetTaskQueueMetadataResponse_VersioningData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VersioningData != nil { + l = m.VersioningData.Size() + n += 1 + l + sovRequestResponse(uint64(l)) + } + return n +} +func (m *GetTaskQueueMetadataResponse_MatchedReqHash) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} + func sovRequestResponse(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4997,45 +5773,109 @@ func (this *GetWorkerBuildIdOrderingResponse) String() string { }, "") return s } -func valueToStringRequestResponse(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { +func (this *InvalidateTaskQueueMetadataRequest) String() string { + if this == nil { return "nil" } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + s := strings.Join([]string{`&InvalidateTaskQueueMetadataRequest{`, + `NamespaceId:` + fmt.Sprintf("%v", this.NamespaceId) + `,`, + `TaskQueue:` + fmt.Sprintf("%v", this.TaskQueue) + `,`, + `TaskQueueType:` + fmt.Sprintf("%v", this.TaskQueueType) + `,`, + `VersioningData:` + strings.Replace(fmt.Sprintf("%v", this.VersioningData), "VersioningData", "v18.VersioningData", 1) + `,`, + `}`, + }, "") + return s } -func (m *PollWorkflowTaskQueueRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRequestResponse - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PollWorkflowTaskQueueRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PollWorkflowTaskQueueRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { +func (this *InvalidateTaskQueueMetadataResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&InvalidateTaskQueueMetadataResponse{`, + `}`, + }, "") + return s +} +func (this *GetTaskQueueMetadataRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetTaskQueueMetadataRequest{`, + `NamespaceId:` + fmt.Sprintf("%v", this.NamespaceId) + `,`, + `TaskQueue:` + fmt.Sprintf("%v", this.TaskQueue) + `,`, + `WantVersioningDataCurhash:` + fmt.Sprintf("%v", this.WantVersioningDataCurhash) + `,`, + `}`, + }, "") + return s +} +func (this *GetTaskQueueMetadataResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetTaskQueueMetadataResponse{`, + `VersioningDataResp:` + fmt.Sprintf("%v", this.VersioningDataResp) + `,`, + `}`, + }, "") + return s +} +func (this *GetTaskQueueMetadataResponse_VersioningData) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetTaskQueueMetadataResponse_VersioningData{`, + `VersioningData:` + strings.Replace(fmt.Sprintf("%v", this.VersioningData), "VersioningData", "v18.VersioningData", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GetTaskQueueMetadataResponse_MatchedReqHash) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetTaskQueueMetadataResponse_MatchedReqHash{`, + `MatchedReqHash:` + fmt.Sprintf("%v", this.MatchedReqHash) + `,`, + `}`, + }, "") + return s +} +func valueToStringRequestResponse(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *PollWorkflowTaskQueueRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PollWorkflowTaskQueueRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PollWorkflowTaskQueueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NamespaceId", wireType) } var stringLen uint64 @@ -8981,6 +9821,491 @@ func (m *GetWorkerBuildIdOrderingResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *InvalidateTaskQueueMetadataRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InvalidateTaskQueueMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InvalidateTaskQueueMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NamespaceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequestResponse + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequestResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NamespaceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskQueue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequestResponse + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequestResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TaskQueue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskQueueType", wireType) + } + m.TaskQueueType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TaskQueueType |= v17.TaskQueueType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VersioningData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequestResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequestResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VersioningData == nil { + m.VersioningData = &v18.VersioningData{} + } + if err := m.VersioningData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequestResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRequestResponse + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRequestResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InvalidateTaskQueueMetadataResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InvalidateTaskQueueMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InvalidateTaskQueueMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRequestResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRequestResponse + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRequestResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetTaskQueueMetadataRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetTaskQueueMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetTaskQueueMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NamespaceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequestResponse + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequestResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NamespaceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskQueue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRequestResponse + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRequestResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TaskQueue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WantVersioningDataCurhash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRequestResponse + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRequestResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WantVersioningDataCurhash = append(m.WantVersioningDataCurhash[:0], dAtA[iNdEx:postIndex]...) + if m.WantVersioningDataCurhash == nil { + m.WantVersioningDataCurhash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRequestResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRequestResponse + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRequestResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetTaskQueueMetadataResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetTaskQueueMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetTaskQueueMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VersioningData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRequestResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRequestResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v18.VersioningData{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.VersioningDataResp = &GetTaskQueueMetadataResponse_VersioningData{v} + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MatchedReqHash", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRequestResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.VersioningDataResp = &GetTaskQueueMetadataResponse_MatchedReqHash{b} + default: + iNdEx = preIndex + skippy, err := skipRequestResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRequestResponse + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRequestResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipRequestResponse(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/api/matchingservice/v1/service.pb.go b/api/matchingservice/v1/service.pb.go index e4f240835b7..d80a788ea1e 100644 --- a/api/matchingservice/v1/service.pb.go +++ b/api/matchingservice/v1/service.pb.go @@ -54,40 +54,42 @@ func init() { } var fileDescriptor_1a5c83076e651916 = []byte{ - // 514 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x3d, 0x6f, 0xd4, 0x30, - 0x18, 0xc7, 0xe3, 0x85, 0xc1, 0x12, 0x54, 0x58, 0x42, 0x40, 0x91, 0x3c, 0x30, 0x30, 0x26, 0x2a, - 0xb0, 0xd1, 0x02, 0xd7, 0x16, 0xda, 0xf2, 0xa2, 0xb6, 0xbc, 0x08, 0x89, 0x05, 0xb9, 0xf1, 0xc3, - 0x61, 0x35, 0x17, 0x07, 0xdb, 0x39, 0xd4, 0x8d, 0x4f, 0x80, 0x18, 0x98, 0xf8, 0x00, 0x88, 0x01, - 0x09, 0x89, 0x09, 0xbe, 0x01, 0xe3, 0x8d, 0x1d, 0xb9, 0xdc, 0xc2, 0xd8, 0x8f, 0x50, 0x5d, 0x73, - 0x76, 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5, 0xc1, 0x41, - 0x97, 0xa2, 0x8f, 0x05, 0x45, 0xdf, 0x0b, 0x8a, 0xfe, 0x16, 0x14, 0x75, 0x0a, 0x8a, 0xfe, 0x15, - 0x14, 0xfd, 0x2f, 0x68, 0x70, 0x50, 0x50, 0xf4, 0xb9, 0x47, 0x83, 0x4e, 0x8f, 0x06, 0xfb, 0x3d, - 0x1a, 0xbc, 0x5e, 0x6c, 0xca, 0x63, 0x07, 0x21, 0x4f, 0xbf, 0xb6, 0xef, 0x8c, 0x2d, 0xed, 0x9c, - 0x3b, 0xba, 0xb6, 0x6f, 0x1d, 0x06, 0x00, 0x00, 0xff, 0xff, 0x03, 0xa6, 0x39, 0xf1, 0x55, 0x08, - 0x00, 0x00, + // 558 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x3d, 0x6f, 0x13, 0x31, + 0x18, 0xc7, 0xcf, 0x0b, 0x83, 0x25, 0x54, 0xf5, 0x04, 0x02, 0x8a, 0xe4, 0x81, 0x81, 0xf1, 0xa2, + 0x02, 0x1b, 0x2d, 0xd0, 0x26, 0x90, 0x06, 0xa8, 0xda, 0xf2, 0x22, 0x24, 0x16, 0xe4, 0xc6, 0x0f, + 0xc1, 0xea, 0xe5, 0x7c, 0xf8, 0x7c, 0x87, 0xba, 0xf1, 0x09, 0x10, 0x03, 0x53, 0x57, 0x24, 0xc4, + 0x80, 0x84, 0xc4, 0xc4, 0x47, 0x60, 0xcc, 0xd8, 0x91, 0x5c, 0x16, 0xc6, 0x7e, 0x04, 0x74, 0xbd, + 0xd8, 0xcd, 0xdb, 0x45, 0xce, 0x5d, 0xb7, 0xc4, 0xf1, 0xff, 0xf7, 0xfc, 0xfc, 0xc4, 0x8f, 0x64, + 0x7c, 0x47, 0x41, 0x37, 0x14, 0x92, 0xfa, 0xb5, 0x08, 0x64, 0x02, 0xb2, 0x46, 0x43, 0x5e, 0xeb,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 0xa1, 0x6c, 0xa3, 0x1a, + 0x44, 0x5b, 0x6e, 0xca, 0x5e, 0x9f, 0x38, 0xc7, 0x7d, 0xe2, 0x9c, 0xf4, 0x09, 0xfa, 0x98, 0x12, + 0xf4, 0x3d, 0x25, 0xe8, 0x4f, 0x4a, 0x50, 0x2f, 0x25, 0xe8, 0x6f, 0x4a, 0xd0, 0xbf, 0x94, 0x38, + 0x27, 0x29, 0x41, 0x9f, 0x07, 0xc4, 0xe9, 0x0d, 0x88, 0x73, 0x3c, 0x20, 0xce, 0xeb, 0xb5, 0x8e, + 0x38, 0xab, 0xcf, 0xc5, 0xfc, 0x77, 0xd1, 0xdd, 0x89, 0xa5, 0xfd, 0x0b, 0xa7, 0xef, 0xa2, 0xdb, + 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x28, 0x55, 0x84, 0x93, 0xb6, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -136,8 +138,11 @@ type MatchingServiceClient interface { // (-- api-linter: core::0134::method-signature=disabled // aip.dev/not-precedent: UpdateWorkerBuildIdOrdering RPC doesn't follow Google API format. --) UpdateWorkerBuildIdOrdering(ctx context.Context, in *UpdateWorkerBuildIdOrderingRequest, opts ...grpc.CallOption) (*UpdateWorkerBuildIdOrderingResponse, error) - // This could / maybe should just be part of `DescribeTaskQueue`, but is broken out here to show easily. GetWorkerBuildIdOrdering(ctx context.Context, in *GetWorkerBuildIdOrderingRequest, opts ...grpc.CallOption) (*GetWorkerBuildIdOrderingResponse, error) + // Tell a task queue that some metadata has changed. + InvalidateTaskQueueMetadata(ctx context.Context, in *InvalidateTaskQueueMetadataRequest, opts ...grpc.CallOption) (*InvalidateTaskQueueMetadataResponse, error) + // Fetch some metadata about a task queue. + GetTaskQueueMetadata(ctx context.Context, in *GetTaskQueueMetadataRequest, opts ...grpc.CallOption) (*GetTaskQueueMetadataResponse, error) } type matchingServiceClient struct { @@ -247,6 +252,24 @@ func (c *matchingServiceClient) GetWorkerBuildIdOrdering(ctx context.Context, in return out, nil } +func (c *matchingServiceClient) InvalidateTaskQueueMetadata(ctx context.Context, in *InvalidateTaskQueueMetadataRequest, opts ...grpc.CallOption) (*InvalidateTaskQueueMetadataResponse, error) { + out := new(InvalidateTaskQueueMetadataResponse) + err := c.cc.Invoke(ctx, "/temporal.server.api.matchingservice.v1.MatchingService/InvalidateTaskQueueMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *matchingServiceClient) GetTaskQueueMetadata(ctx context.Context, in *GetTaskQueueMetadataRequest, opts ...grpc.CallOption) (*GetTaskQueueMetadataResponse, error) { + out := new(GetTaskQueueMetadataResponse) + err := c.cc.Invoke(ctx, "/temporal.server.api.matchingservice.v1.MatchingService/GetTaskQueueMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MatchingServiceServer is the server API for MatchingService service. type MatchingServiceServer interface { // PollWorkflowTaskQueue is called by frontend to process WorkflowTask from a specific task queue. A @@ -283,8 +306,11 @@ type MatchingServiceServer interface { // (-- api-linter: core::0134::method-signature=disabled // aip.dev/not-precedent: UpdateWorkerBuildIdOrdering RPC doesn't follow Google API format. --) UpdateWorkerBuildIdOrdering(context.Context, *UpdateWorkerBuildIdOrderingRequest) (*UpdateWorkerBuildIdOrderingResponse, error) - // This could / maybe should just be part of `DescribeTaskQueue`, but is broken out here to show easily. GetWorkerBuildIdOrdering(context.Context, *GetWorkerBuildIdOrderingRequest) (*GetWorkerBuildIdOrderingResponse, error) + // Tell a task queue that some metadata has changed. + InvalidateTaskQueueMetadata(context.Context, *InvalidateTaskQueueMetadataRequest) (*InvalidateTaskQueueMetadataResponse, error) + // Fetch some metadata about a task queue. + GetTaskQueueMetadata(context.Context, *GetTaskQueueMetadataRequest) (*GetTaskQueueMetadataResponse, error) } // UnimplementedMatchingServiceServer can be embedded to have forward compatible implementations. @@ -324,6 +350,12 @@ func (*UnimplementedMatchingServiceServer) UpdateWorkerBuildIdOrdering(ctx conte func (*UnimplementedMatchingServiceServer) GetWorkerBuildIdOrdering(ctx context.Context, req *GetWorkerBuildIdOrderingRequest) (*GetWorkerBuildIdOrderingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetWorkerBuildIdOrdering not implemented") } +func (*UnimplementedMatchingServiceServer) InvalidateTaskQueueMetadata(ctx context.Context, req *InvalidateTaskQueueMetadataRequest) (*InvalidateTaskQueueMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidateTaskQueueMetadata not implemented") +} +func (*UnimplementedMatchingServiceServer) GetTaskQueueMetadata(ctx context.Context, req *GetTaskQueueMetadataRequest) (*GetTaskQueueMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTaskQueueMetadata not implemented") +} func RegisterMatchingServiceServer(s *grpc.Server, srv MatchingServiceServer) { s.RegisterService(&_MatchingService_serviceDesc, srv) @@ -527,6 +559,42 @@ func _MatchingService_GetWorkerBuildIdOrdering_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } +func _MatchingService_InvalidateTaskQueueMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidateTaskQueueMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MatchingServiceServer).InvalidateTaskQueueMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/temporal.server.api.matchingservice.v1.MatchingService/InvalidateTaskQueueMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MatchingServiceServer).InvalidateTaskQueueMetadata(ctx, req.(*InvalidateTaskQueueMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MatchingService_GetTaskQueueMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTaskQueueMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MatchingServiceServer).GetTaskQueueMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/temporal.server.api.matchingservice.v1.MatchingService/GetTaskQueueMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MatchingServiceServer).GetTaskQueueMetadata(ctx, req.(*GetTaskQueueMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _MatchingService_serviceDesc = grpc.ServiceDesc{ ServiceName: "temporal.server.api.matchingservice.v1.MatchingService", HandlerType: (*MatchingServiceServer)(nil), @@ -575,6 +643,14 @@ var _MatchingService_serviceDesc = grpc.ServiceDesc{ MethodName: "GetWorkerBuildIdOrdering", Handler: _MatchingService_GetWorkerBuildIdOrdering_Handler, }, + { + MethodName: "InvalidateTaskQueueMetadata", + Handler: _MatchingService_InvalidateTaskQueueMetadata_Handler, + }, + { + MethodName: "GetTaskQueueMetadata", + Handler: _MatchingService_GetTaskQueueMetadata_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "temporal/server/api/matchingservice/v1/service.proto", diff --git a/api/matchingservicemock/v1/service.pb.mock.go b/api/matchingservicemock/v1/service.pb.mock.go index 3d1d99b7522..a6e4292634a 100644 --- a/api/matchingservicemock/v1/service.pb.mock.go +++ b/api/matchingservicemock/v1/service.pb.mock.go @@ -140,6 +140,26 @@ func (mr *MockMatchingServiceClientMockRecorder) DescribeTaskQueue(ctx, in inter return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTaskQueue", reflect.TypeOf((*MockMatchingServiceClient)(nil).DescribeTaskQueue), varargs...) } +// GetTaskQueueMetadata mocks base method. +func (m *MockMatchingServiceClient) GetTaskQueueMetadata(ctx context.Context, in *matchingservice.GetTaskQueueMetadataRequest, opts ...grpc.CallOption) (*matchingservice.GetTaskQueueMetadataResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetTaskQueueMetadata", varargs...) + ret0, _ := ret[0].(*matchingservice.GetTaskQueueMetadataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTaskQueueMetadata indicates an expected call of GetTaskQueueMetadata. +func (mr *MockMatchingServiceClientMockRecorder) GetTaskQueueMetadata(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTaskQueueMetadata", reflect.TypeOf((*MockMatchingServiceClient)(nil).GetTaskQueueMetadata), varargs...) +} + // GetWorkerBuildIdOrdering mocks base method. func (m *MockMatchingServiceClient) GetWorkerBuildIdOrdering(ctx context.Context, in *matchingservice.GetWorkerBuildIdOrderingRequest, opts ...grpc.CallOption) (*matchingservice.GetWorkerBuildIdOrderingResponse, error) { m.ctrl.T.Helper() @@ -160,6 +180,26 @@ func (mr *MockMatchingServiceClientMockRecorder) GetWorkerBuildIdOrdering(ctx, i return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkerBuildIdOrdering", reflect.TypeOf((*MockMatchingServiceClient)(nil).GetWorkerBuildIdOrdering), varargs...) } +// InvalidateTaskQueueMetadata mocks base method. +func (m *MockMatchingServiceClient) InvalidateTaskQueueMetadata(ctx context.Context, in *matchingservice.InvalidateTaskQueueMetadataRequest, opts ...grpc.CallOption) (*matchingservice.InvalidateTaskQueueMetadataResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InvalidateTaskQueueMetadata", varargs...) + ret0, _ := ret[0].(*matchingservice.InvalidateTaskQueueMetadataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InvalidateTaskQueueMetadata indicates an expected call of InvalidateTaskQueueMetadata. +func (mr *MockMatchingServiceClientMockRecorder) InvalidateTaskQueueMetadata(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InvalidateTaskQueueMetadata", reflect.TypeOf((*MockMatchingServiceClient)(nil).InvalidateTaskQueueMetadata), varargs...) +} + // ListTaskQueuePartitions mocks base method. func (m *MockMatchingServiceClient) ListTaskQueuePartitions(ctx context.Context, in *matchingservice.ListTaskQueuePartitionsRequest, opts ...grpc.CallOption) (*matchingservice.ListTaskQueuePartitionsResponse, error) { m.ctrl.T.Helper() @@ -363,6 +403,21 @@ func (mr *MockMatchingServiceServerMockRecorder) DescribeTaskQueue(arg0, arg1 in return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTaskQueue", reflect.TypeOf((*MockMatchingServiceServer)(nil).DescribeTaskQueue), arg0, arg1) } +// GetTaskQueueMetadata mocks base method. +func (m *MockMatchingServiceServer) GetTaskQueueMetadata(arg0 context.Context, arg1 *matchingservice.GetTaskQueueMetadataRequest) (*matchingservice.GetTaskQueueMetadataResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTaskQueueMetadata", arg0, arg1) + ret0, _ := ret[0].(*matchingservice.GetTaskQueueMetadataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTaskQueueMetadata indicates an expected call of GetTaskQueueMetadata. +func (mr *MockMatchingServiceServerMockRecorder) GetTaskQueueMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTaskQueueMetadata", reflect.TypeOf((*MockMatchingServiceServer)(nil).GetTaskQueueMetadata), arg0, arg1) +} + // GetWorkerBuildIdOrdering mocks base method. func (m *MockMatchingServiceServer) GetWorkerBuildIdOrdering(arg0 context.Context, arg1 *matchingservice.GetWorkerBuildIdOrderingRequest) (*matchingservice.GetWorkerBuildIdOrderingResponse, error) { m.ctrl.T.Helper() @@ -378,6 +433,21 @@ func (mr *MockMatchingServiceServerMockRecorder) GetWorkerBuildIdOrdering(arg0, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkerBuildIdOrdering", reflect.TypeOf((*MockMatchingServiceServer)(nil).GetWorkerBuildIdOrdering), arg0, arg1) } +// InvalidateTaskQueueMetadata mocks base method. +func (m *MockMatchingServiceServer) InvalidateTaskQueueMetadata(arg0 context.Context, arg1 *matchingservice.InvalidateTaskQueueMetadataRequest) (*matchingservice.InvalidateTaskQueueMetadataResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InvalidateTaskQueueMetadata", arg0, arg1) + ret0, _ := ret[0].(*matchingservice.InvalidateTaskQueueMetadataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InvalidateTaskQueueMetadata indicates an expected call of InvalidateTaskQueueMetadata. +func (mr *MockMatchingServiceServerMockRecorder) InvalidateTaskQueueMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InvalidateTaskQueueMetadata", reflect.TypeOf((*MockMatchingServiceServer)(nil).InvalidateTaskQueueMetadata), arg0, arg1) +} + // ListTaskQueuePartitions mocks base method. func (m *MockMatchingServiceServer) ListTaskQueuePartitions(arg0 context.Context, arg1 *matchingservice.ListTaskQueuePartitionsRequest) (*matchingservice.ListTaskQueuePartitionsResponse, error) { m.ctrl.T.Helper() diff --git a/client/matching/client_gen.go b/client/matching/client_gen.go index 3431e727c43..58b3dd385f4 100644 --- a/client/matching/client_gen.go +++ b/client/matching/client_gen.go @@ -63,6 +63,21 @@ func (c *clientImpl) DescribeTaskQueue( return client.DescribeTaskQueue(ctx, request, opts...) } +func (c *clientImpl) GetTaskQueueMetadata( + ctx context.Context, + request *matchingservice.GetTaskQueueMetadataRequest, + opts ...grpc.CallOption, +) (*matchingservice.GetTaskQueueMetadataResponse, error) { + + client, err := c.getClientForTaskqueue(request.GetTaskQueue()) + if err != nil { + return nil, err + } + ctx, cancel := c.createContext(ctx) + defer cancel() + return client.GetTaskQueueMetadata(ctx, request, opts...) +} + func (c *clientImpl) GetWorkerBuildIdOrdering( ctx context.Context, request *matchingservice.GetWorkerBuildIdOrderingRequest, @@ -78,6 +93,21 @@ func (c *clientImpl) GetWorkerBuildIdOrdering( return client.GetWorkerBuildIdOrdering(ctx, request, opts...) } +func (c *clientImpl) InvalidateTaskQueueMetadata( + ctx context.Context, + request *matchingservice.InvalidateTaskQueueMetadataRequest, + opts ...grpc.CallOption, +) (*matchingservice.InvalidateTaskQueueMetadataResponse, error) { + + client, err := c.getClientForTaskqueue(request.GetTaskQueue()) + if err != nil { + return nil, err + } + ctx, cancel := c.createContext(ctx) + defer cancel() + return client.InvalidateTaskQueueMetadata(ctx, request, opts...) +} + func (c *clientImpl) ListTaskQueuePartitions( ctx context.Context, request *matchingservice.ListTaskQueuePartitionsRequest, diff --git a/client/matching/metric_client_gen.go b/client/matching/metric_client_gen.go index dc98b53537f..1f98db74960 100644 --- a/client/matching/metric_client_gen.go +++ b/client/matching/metric_client_gen.go @@ -63,6 +63,20 @@ func (c *metricClient) DescribeTaskQueue( return c.client.DescribeTaskQueue(ctx, request, opts...) } +func (c *metricClient) GetTaskQueueMetadata( + ctx context.Context, + request *matchingservice.GetTaskQueueMetadataRequest, + opts ...grpc.CallOption, +) (_ *matchingservice.GetTaskQueueMetadataResponse, retError error) { + + scope, stopwatch := c.startMetricsRecording(metrics.MatchingClientGetTaskQueueMetadataScope) + defer func() { + c.finishMetricsRecording(scope, stopwatch, retError) + }() + + return c.client.GetTaskQueueMetadata(ctx, request, opts...) +} + func (c *metricClient) GetWorkerBuildIdOrdering( ctx context.Context, request *matchingservice.GetWorkerBuildIdOrderingRequest, @@ -77,6 +91,20 @@ func (c *metricClient) GetWorkerBuildIdOrdering( return c.client.GetWorkerBuildIdOrdering(ctx, request, opts...) } +func (c *metricClient) InvalidateTaskQueueMetadata( + ctx context.Context, + request *matchingservice.InvalidateTaskQueueMetadataRequest, + opts ...grpc.CallOption, +) (_ *matchingservice.InvalidateTaskQueueMetadataResponse, retError error) { + + scope, stopwatch := c.startMetricsRecording(metrics.MatchingClientInvalidateTaskQueueMetadataScope) + defer func() { + c.finishMetricsRecording(scope, stopwatch, retError) + }() + + return c.client.InvalidateTaskQueueMetadata(ctx, request, opts...) +} + func (c *metricClient) ListTaskQueuePartitions( ctx context.Context, request *matchingservice.ListTaskQueuePartitionsRequest, diff --git a/client/matching/retryable_client_gen.go b/client/matching/retryable_client_gen.go index d9f142397e6..b3ef96a8ccf 100644 --- a/client/matching/retryable_client_gen.go +++ b/client/matching/retryable_client_gen.go @@ -95,6 +95,21 @@ func (c *retryableClient) DescribeTaskQueue( return resp, err } +func (c *retryableClient) GetTaskQueueMetadata( + ctx context.Context, + request *matchingservice.GetTaskQueueMetadataRequest, + opts ...grpc.CallOption, +) (*matchingservice.GetTaskQueueMetadataResponse, error) { + var resp *matchingservice.GetTaskQueueMetadataResponse + op := func(ctx context.Context) error { + var err error + resp, err = c.client.GetTaskQueueMetadata(ctx, request, opts...) + return err + } + err := backoff.ThrottleRetryContext(ctx, op, c.policy, c.isRetryable) + return resp, err +} + func (c *retryableClient) GetWorkerBuildIdOrdering( ctx context.Context, request *matchingservice.GetWorkerBuildIdOrderingRequest, @@ -110,6 +125,21 @@ func (c *retryableClient) GetWorkerBuildIdOrdering( return resp, err } +func (c *retryableClient) InvalidateTaskQueueMetadata( + ctx context.Context, + request *matchingservice.InvalidateTaskQueueMetadataRequest, + opts ...grpc.CallOption, +) (*matchingservice.InvalidateTaskQueueMetadataResponse, error) { + var resp *matchingservice.InvalidateTaskQueueMetadataResponse + op := func(ctx context.Context) error { + var err error + resp, err = c.client.InvalidateTaskQueueMetadata(ctx, request, opts...) + return err + } + err := backoff.ThrottleRetryContext(ctx, op, c.policy, c.isRetryable) + return resp, err +} + func (c *retryableClient) ListTaskQueuePartitions( ctx context.Context, request *matchingservice.ListTaskQueuePartitionsRequest, diff --git a/common/dynamicconfig/constants.go b/common/dynamicconfig/constants.go index b0854e7791e..cb0a4539556 100644 --- a/common/dynamicconfig/constants.go +++ b/common/dynamicconfig/constants.go @@ -285,6 +285,8 @@ const ( MatchingForwarderMaxChildrenPerNode = "matching.forwarderMaxChildrenPerNode" // MatchingShutdownDrainDuration is the duration of traffic drain during shutdown MatchingShutdownDrainDuration = "matching.shutdownDrainDuration" + // MatchingMetadataPollFrequency is how often non-root partitions will poll the root partition for fresh metadata + MatchingMetadataPollFrequency = "matching.metadataPollFrequency" // key for history diff --git a/common/metrics/defs.go b/common/metrics/defs.go index 7a2e66c01c6..a55151029bc 100644 --- a/common/metrics/defs.go +++ b/common/metrics/defs.go @@ -450,8 +450,12 @@ const ( MatchingClientListTaskQueuePartitionsScope // MatchingClientUpdateWorkerBuildIdOrderingScope tracks RPC calls to matching service MatchingClientUpdateWorkerBuildIdOrderingScope - // MatchingGetBuildIdOrdering tracks RPC calls to matching service + // MatchingGetWorkerBuildIdOrderingScope tracks RPC calls to matching service MatchingClientGetWorkerBuildIdOrderingScope + // MatchingClientInvalidateTaskQueueMetadataScope tracks RPC calls to matching service + MatchingClientInvalidateTaskQueueMetadataScope + // MatchingClientGetTaskQueueMetadataScope tracks RPC calls to matching service + MatchingClientGetTaskQueueMetadataScope // FrontendClientDeprecateNamespaceScope tracks RPC calls to frontend service FrontendClientDeprecateNamespaceScope // FrontendClientDescribeNamespaceScope tracks RPC calls to frontend service @@ -1250,6 +1254,10 @@ const ( MatchingUpdateWorkerBuildIdOrderingScope // MatchingGetWorkerBuildIdOrderingScope tracks GetWorkerBuildIdOrdering API calls received by service MatchingGetWorkerBuildIdOrderingScope + // MatchingInvalidateTaskQueueMetadataScope tracks GetWorkerBuildIdOrdering API calls received by service + MatchingInvalidateTaskQueueMetadataScope + // MatchingGetTaskQueueMetadataScope tracks GetWorkerBuildIdOrdering API calls received by service + MatchingGetTaskQueueMetadataScope NumMatchingScopes ) @@ -1491,6 +1499,8 @@ var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{ MatchingClientListTaskQueuePartitionsScope: {operation: "MatchingClientListTaskQueuePartitions", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}}, MatchingClientUpdateWorkerBuildIdOrderingScope: {operation: "MatchingClientUpdateWorkerBuildIdOrdering", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}}, MatchingClientGetWorkerBuildIdOrderingScope: {operation: "MatchingClientGetWorkerBuildIdOrdering", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}}, + MatchingClientInvalidateTaskQueueMetadataScope: {operation: "MatchingClientInvalidateTaskQueueMetadata", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}}, + MatchingClientGetTaskQueueMetadataScope: {operation: "MatchingClientGetTaskQueueMetadata", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}}, FrontendClientDeprecateNamespaceScope: {operation: "FrontendClientDeprecateNamespace", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}}, FrontendClientDescribeNamespaceScope: {operation: "FrontendClientDescribeNamespace", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}}, @@ -1887,6 +1897,8 @@ var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{ MatchingListTaskQueuePartitionsScope: {operation: "ListTaskQueuePartitions"}, MatchingUpdateWorkerBuildIdOrderingScope: {operation: "UpdateWorkerBuildIdOrdering"}, MatchingGetWorkerBuildIdOrderingScope: {operation: "GetWorkerBuildIdOrdering"}, + MatchingInvalidateTaskQueueMetadataScope: {operation: "InvalidateTaskQueueMetadata"}, + MatchingGetTaskQueueMetadataScope: {operation: "GetTaskQueueMetadata"}, }, // Worker Scope Names Worker: { diff --git a/host/versioning_test.go b/host/versioning_test.go index 453cd51da9c..4cdfab81daa 100644 --- a/host/versioning_test.go +++ b/host/versioning_test.go @@ -31,6 +31,8 @@ import ( "testing" "time" + "go.temporal.io/server/service/matching" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -210,3 +212,65 @@ func (s *versioningIntegSuite) TestVersioningStateNotDestroyedByOtherUpdates() { s.NotNil(res2) s.Equal("foo", res2.CurrentDefault.GetVersion().GetWorkerBuildId()) } + +func (s *versioningIntegSuite) TestVersioningChangesPropagatedToSubPartitions() { + ctx := NewContext() + tq := "integration-versioning-sub-partitions" + + res, err := s.engine.UpdateWorkerBuildIdOrdering(ctx, &workflowservice.UpdateWorkerBuildIdOrderingRequest{ + Namespace: s.namespace, + TaskQueue: tq, + VersionId: &taskqueuepb.VersionId{WorkerBuildId: "foo"}, + BecomeDefault: true, + }) + s.NoError(err) + s.NotNil(res) + + res2, err := s.engine.GetWorkerBuildIdOrdering(ctx, &workflowservice.GetWorkerBuildIdOrderingRequest{ + Namespace: s.namespace, + TaskQueue: tq, + }) + s.NoError(err) + s.NotNil(res2) + s.Equal("foo", res2.CurrentDefault.GetVersion().GetWorkerBuildId()) + + // Verify partitions have data + partCount, err := s.testCluster.GetHost().dynamicClient.GetIntValue( + dynamicconfig.MatchingNumTaskqueueReadPartitions, nil, 0) + s.Greater(partCount, 1, "This test makes no sense unless there are >1 partitions") + s.NoError(err) + + for i := 1; i < partCount; i++ { + subPartName, err := matching.NewTaskQueueNameWithPartition(tq, i) + s.NoError(err) + res, err := s.engine.GetWorkerBuildIdOrdering(ctx, &workflowservice.GetWorkerBuildIdOrderingRequest{ + Namespace: s.namespace, + TaskQueue: subPartName.String(), + }) + s.NoError(err) + s.NotNil(res) + s.Equal("foo", res.CurrentDefault.GetVersion().GetWorkerBuildId()) + } + + // Make a modification, verify it propagates to partitions + res, err = s.engine.UpdateWorkerBuildIdOrdering(ctx, &workflowservice.UpdateWorkerBuildIdOrderingRequest{ + Namespace: s.namespace, + TaskQueue: tq, + VersionId: &taskqueuepb.VersionId{WorkerBuildId: "foo-2"}, + BecomeDefault: true, + }) + s.NoError(err) + s.NotNil(res) + + for i := 1; i < partCount; i++ { + subPartName, err := matching.NewTaskQueueNameWithPartition(tq, i) + s.NoError(err) + res, err := s.engine.GetWorkerBuildIdOrdering(ctx, &workflowservice.GetWorkerBuildIdOrderingRequest{ + Namespace: s.namespace, + TaskQueue: subPartName.String(), + }) + s.NoError(err) + s.NotNil(res) + s.Equal("foo-2", res.CurrentDefault.GetVersion().GetWorkerBuildId()) + } +} diff --git a/proto/internal/temporal/server/api/matchingservice/v1/request_response.proto b/proto/internal/temporal/server/api/matchingservice/v1/request_response.proto index b04b35d6c13..ce481dc08e0 100644 --- a/proto/internal/temporal/server/api/matchingservice/v1/request_response.proto +++ b/proto/internal/temporal/server/api/matchingservice/v1/request_response.proto @@ -36,6 +36,7 @@ import "temporal/api/query/v1/message.proto"; import "temporal/server/api/clock/v1/message.proto"; import "temporal/server/api/enums/v1/task.proto"; import "temporal/server/api/history/v1/message.proto"; +import "temporal/server/api/persistence/v1/tasks.proto"; import "temporal/api/workflowservice/v1/request_response.proto"; @@ -200,3 +201,32 @@ message GetWorkerBuildIdOrderingResponse { temporal.api.workflowservice.v1.GetWorkerBuildIdOrderingResponse response = 1; } +message InvalidateTaskQueueMetadataRequest { + string namespace_id = 1; + string task_queue = 2; + temporal.api.enums.v1.TaskQueueType task_queue_type = 3; + // The task queue versioning data should be invalidated and replaced with this data, if set. + temporal.server.api.persistence.v1.VersioningData versioning_data = 4; +} +message InvalidateTaskQueueMetadataResponse {} + +message GetTaskQueueMetadataRequest { + string namespace_id = 1; + // The task queue to fetch data from. Is always considered as a workflow queue, since root + // workflow queues own the metadata. + string task_queue = 2; + // If set nonempty, the requester wants the latest versioning data. The value must be the hash + // (using farm hash Fingerprint64) of the latest versioning data. If the requester has no data, + // it can use any invalid value (ex: [0]). + // If the data is up to date, no value will be returned. + bytes want_versioning_data_curhash = 3; +} +message GetTaskQueueMetadataResponse { + oneof versioning_data_resp { + // The latest versioning data, if the request's hash did not match. May be null if no + // versioning data exists. + temporal.server.api.persistence.v1.VersioningData versioning_data = 1; + // If the request's hash matched, this variant is set (and will be true). + bool matched_req_hash = 2; + } +} diff --git a/proto/internal/temporal/server/api/matchingservice/v1/service.proto b/proto/internal/temporal/server/api/matchingservice/v1/service.proto index 2ee87645ef9..31df5424592 100644 --- a/proto/internal/temporal/server/api/matchingservice/v1/service.proto +++ b/proto/internal/temporal/server/api/matchingservice/v1/service.proto @@ -84,6 +84,9 @@ service MatchingService { // (-- api-linter: core::0134::method-signature=disabled // aip.dev/not-precedent: UpdateWorkerBuildIdOrdering RPC doesn't follow Google API format. --) rpc UpdateWorkerBuildIdOrdering (UpdateWorkerBuildIdOrderingRequest) returns (UpdateWorkerBuildIdOrderingResponse) {} - // This could / maybe should just be part of `DescribeTaskQueue`, but is broken out here to show easily. rpc GetWorkerBuildIdOrdering (GetWorkerBuildIdOrderingRequest) returns (GetWorkerBuildIdOrderingResponse) {} + // Tell a task queue that some metadata has changed. + rpc InvalidateTaskQueueMetadata (InvalidateTaskQueueMetadataRequest) returns (InvalidateTaskQueueMetadataResponse) {} + // Fetch some metadata about a task queue. + rpc GetTaskQueueMetadata (GetTaskQueueMetadataRequest) returns (GetTaskQueueMetadataResponse) {} } diff --git a/service/matching/config.go b/service/matching/config.go index a8373c91bc0..2e3bfe5548a 100644 --- a/service/matching/config.go +++ b/service/matching/config.go @@ -56,6 +56,7 @@ type ( ForwarderMaxRatePerSecond dynamicconfig.IntPropertyFnWithTaskQueueInfoFilters ForwarderMaxChildrenPerNode dynamicconfig.IntPropertyFnWithTaskQueueInfoFilters MaxVersionGraphSize dynamicconfig.IntPropertyFn + MetadataPollFrequency dynamicconfig.DurationPropertyFn // Time to hold a poll request before returning an empty response if there are no tasks LongPollExpirationInterval dynamicconfig.DurationPropertyFnWithTaskQueueInfoFilters @@ -131,6 +132,7 @@ func NewConfig(dc *dynamicconfig.Collection) *Config { ForwarderMaxChildrenPerNode: dc.GetIntPropertyFilteredByTaskQueueInfo(dynamicconfig.MatchingForwarderMaxChildrenPerNode, 20), ShutdownDrainDuration: dc.GetDurationProperty(dynamicconfig.MatchingShutdownDrainDuration, 0), MaxVersionGraphSize: dc.GetIntProperty(dynamicconfig.VersionGraphNodeLimit, 1000), + MetadataPollFrequency: dc.GetDurationProperty(dynamicconfig.MatchingMetadataPollFrequency, 5*time.Minute), AdminNamespaceToPartitionDispatchRate: dc.GetFloatPropertyFilteredByNamespace(dynamicconfig.AdminMatchingNamespaceToPartitionDispatchRate, 10000), AdminNamespaceTaskqueueToPartitionDispatchRate: dc.GetFloatPropertyFilteredByTaskQueueInfo(dynamicconfig.AdminMatchingNamespaceTaskqueueToPartitionDispatchRate, 1000), diff --git a/service/matching/configs/quotas.go b/service/matching/configs/quotas.go index b6c9b7e5925..1741766d813 100644 --- a/service/matching/configs/quotas.go +++ b/service/matching/configs/quotas.go @@ -41,6 +41,8 @@ var ( "RespondQueryTaskCompleted": 0, "GetWorkerBuildIdOrdering": 0, "UpdateWorkerBuildIdOrdering": 0, + "InvalidateTaskQueueMetadata": 0, + "GetTaskQueueMetadata": 0, } APIPrioritiesOrdered = []int{0} diff --git a/service/matching/db.go b/service/matching/db.go index 1a9235f60b8..f4ad40f885d 100644 --- a/service/matching/db.go +++ b/service/matching/db.go @@ -26,6 +26,7 @@ package matching import ( "context" + "errors" "fmt" "sync" "time" @@ -50,9 +51,8 @@ type ( taskQueueDB struct { sync.Mutex namespaceID namespace.ID - taskQueueName string + taskQueue *taskQueueID taskQueueKind enumspb.TaskQueueKind - taskType enumspb.TaskQueueType rangeID int64 ackLevel int64 versioningData *persistencespb.VersioningData @@ -65,22 +65,26 @@ type ( } ) +var ( + errVersioningDataNotPresentOnPartition = errors.New("versioning data is only present on root workflow partition") + errVersioningDataNoMutateNonRoot = errors.New("can only mutate versioning data on root workflow task queue") +) + // newTaskQueueDB returns an instance of an object that represents // persistence view of a taskQueue. All mutations / reads to taskQueues // wrt persistence go through this object. // // This class will serialize writes to persistence that do condition updates. There are // two reasons for doing this: -// - To work around known Cassandra issue where concurrent LWT to the same partition cause timeout errors -// - To provide the guarantee that there is only writer who updates taskQueue in persistence at any given point in time -// This guarantee makes some of the other code simpler and there is no impact to perf because updates to taskqueue are -// spread out and happen in background routines -func newTaskQueueDB(store persistence.TaskManager, namespaceID namespace.ID, name string, taskType enumspb.TaskQueueType, kind enumspb.TaskQueueKind, logger log.Logger) *taskQueueDB { +// - To work around known Cassandra issue where concurrent LWT to the same partition cause timeout errors +// - To provide the guarantee that there is only writer who updates taskQueue in persistence at any given point in time +// This guarantee makes some of the other code simpler and there is no impact to perf because updates to taskqueue are +// spread out and happen in background routines +func newTaskQueueDB(store persistence.TaskManager, namespaceID namespace.ID, taskQueue *taskQueueID, kind enumspb.TaskQueueKind, logger log.Logger) *taskQueueDB { return &taskQueueDB{ namespaceID: namespaceID, - taskQueueName: name, + taskQueue: taskQueue, taskQueueKind: kind, - taskType: taskType, store: store, logger: logger, } @@ -118,15 +122,15 @@ func (db *taskQueueDB) takeOverTaskQueueLocked( ) error { response, err := db.store.GetTaskQueue(ctx, &persistence.GetTaskQueueRequest{ NamespaceID: db.namespaceID.String(), - TaskQueue: db.taskQueueName, - TaskType: db.taskType, + TaskQueue: db.taskQueue.name, + TaskType: db.taskQueue.taskType, }) switch err.(type) { case nil: response.TaskQueueInfo.Kind = db.taskQueueKind response.TaskQueueInfo.ExpiryTime = db.expiryTime() response.TaskQueueInfo.LastUpdateTime = timestamp.TimeNowPtrUtc() - _, err := db.store.UpdateTaskQueue(ctx, &persistence.UpdateTaskQueueRequest{ + _, err := db.updateTaskQueue(ctx, &persistence.UpdateTaskQueueRequest{ RangeID: response.RangeID + 1, TaskQueueInfo: response.TaskQueueInfo, PrevRangeID: response.RangeID, @@ -158,7 +162,7 @@ func (db *taskQueueDB) renewTaskQueueLocked( ctx context.Context, rangeID int64, ) error { - if _, err := db.store.UpdateTaskQueue(ctx, &persistence.UpdateTaskQueueRequest{ + if _, err := db.updateTaskQueue(ctx, &persistence.UpdateTaskQueueRequest{ RangeID: rangeID, TaskQueueInfo: db.cachedQueueInfo(), PrevRangeID: db.rangeID, @@ -179,7 +183,7 @@ func (db *taskQueueDB) UpdateState( defer db.Unlock() queueInfo := db.cachedQueueInfo() queueInfo.AckLevel = ackLevel - _, err := db.store.UpdateTaskQueue(ctx, &persistence.UpdateTaskQueueRequest{ + _, err := db.updateTaskQueue(ctx, &persistence.UpdateTaskQueueRequest{ RangeID: db.rangeID, TaskQueueInfo: queueInfo, PrevRangeID: db.rangeID, @@ -217,8 +221,8 @@ func (db *taskQueueDB) GetTasks( ) (*persistence.GetTasksResponse, error) { return db.store.GetTasks(ctx, &persistence.GetTasksRequest{ NamespaceID: db.namespaceID.String(), - TaskQueue: db.taskQueueName, - TaskType: db.taskType, + TaskQueue: db.taskQueue.name, + TaskType: db.taskQueue.taskType, PageSize: batchSize, InclusiveMinTaskID: inclusiveMinTaskID, ExclusiveMaxTaskID: exclusiveMaxTaskID, @@ -233,8 +237,8 @@ func (db *taskQueueDB) CompleteTask( err := db.store.CompleteTask(ctx, &persistence.CompleteTaskRequest{ TaskQueue: &persistence.TaskQueueKey{ NamespaceID: db.namespaceID.String(), - TaskQueueName: db.taskQueueName, - TaskQueueType: db.taskType, + TaskQueueName: db.taskQueue.name, + TaskQueueType: db.taskQueue.taskType, }, TaskID: taskID, }) @@ -243,8 +247,8 @@ func (db *taskQueueDB) CompleteTask( tag.StoreOperationCompleteTask, tag.Error(err), tag.TaskID(taskID), - tag.WorkflowTaskQueueType(db.taskType), - tag.WorkflowTaskQueueName(db.taskQueueName)) + tag.WorkflowTaskQueueType(db.taskQueue.taskType), + tag.WorkflowTaskQueueName(db.taskQueue.name)) } return err } @@ -259,8 +263,8 @@ func (db *taskQueueDB) CompleteTasksLessThan( ) (int, error) { n, err := db.store.CompleteTasksLessThan(ctx, &persistence.CompleteTasksLessThanRequest{ NamespaceID: db.namespaceID.String(), - TaskQueueName: db.taskQueueName, - TaskType: db.taskType, + TaskQueueName: db.taskQueue.name, + TaskType: db.taskQueue.taskType, ExclusiveMaxTaskID: exclusiveMaxTaskID, Limit: limit, }) @@ -269,8 +273,8 @@ func (db *taskQueueDB) CompleteTasksLessThan( tag.StoreOperationCompleteTasksLessThan, tag.Error(err), tag.TaskID(exclusiveMaxTaskID), - tag.WorkflowTaskQueueType(db.taskType), - tag.WorkflowTaskQueueName(db.taskQueueName)) + tag.WorkflowTaskQueueType(db.taskQueue.taskType), + tag.WorkflowTaskQueueName(db.taskQueue.name)) } return n, err } @@ -293,10 +297,14 @@ func (db *taskQueueDB) getVersioningDataLocked( return db.versioningData, nil } + if !db.taskQueue.IsRoot() || db.taskQueue.taskType != enumspb.TASK_QUEUE_TYPE_WORKFLOW { + return nil, errVersioningDataNotPresentOnPartition + } + tqInfo, err := db.store.GetTaskQueue(ctx, &persistence.GetTaskQueueRequest{ NamespaceID: db.namespaceID.String(), - TaskQueue: db.taskQueueName, - TaskType: db.taskType, + TaskQueue: db.taskQueue.name, + TaskType: db.taskQueue.taskType, }) if err != nil { return nil, err @@ -308,26 +316,31 @@ func (db *taskQueueDB) getVersioningDataLocked( // MutateVersioningData allows callers to update versioning data for this task queue. The pointer passed to the // mutating function is guaranteed to be non-nil. -func (db *taskQueueDB) MutateVersioningData(ctx context.Context, mutator func(*persistencespb.VersioningData) error) error { +// +// On success returns a pointer to the updated data (which must not be mutated). +func (db *taskQueueDB) MutateVersioningData(ctx context.Context, mutator func(*persistencespb.VersioningData) error) (*persistencespb.VersioningData, error) { + if !db.taskQueue.IsRoot() || db.taskQueue.taskType != enumspb.TASK_QUEUE_TYPE_WORKFLOW { + return nil, errVersioningDataNoMutateNonRoot + } db.Lock() defer db.Unlock() verDat, err := db.getVersioningDataLocked(ctx) if err != nil { - return err + return nil, err } if verDat == nil { verDat = &persistencespb.VersioningData{} } if err := mutator(verDat); err != nil { - return err + return nil, err } queueInfo := db.cachedQueueInfo() queueInfo.VersioningData = verDat - _, err = db.store.UpdateTaskQueue(ctx, &persistence.UpdateTaskQueueRequest{ + _, err = db.updateTaskQueue(ctx, &persistence.UpdateTaskQueueRequest{ RangeID: db.rangeID, TaskQueueInfo: queueInfo, PrevRangeID: db.rangeID, @@ -335,7 +348,30 @@ func (db *taskQueueDB) MutateVersioningData(ctx context.Context, mutator func(*p if err == nil { db.versioningData = verDat } - return err + return verDat, err +} + +func (db *taskQueueDB) setVersioningDataForNonRootPartition(verDat *persistencespb.VersioningData) { + db.Lock() + defer db.Unlock() + db.versioningData = verDat +} + +// Use this rather than calling UpdateTaskQueue directly on the store +func (db *taskQueueDB) updateTaskQueue( + ctx context.Context, + request *persistence.UpdateTaskQueueRequest, +) (*persistence.UpdateTaskQueueResponse, error) { + reqToPersist := request + // Only the root task queue stores versioning information + if !db.taskQueue.IsRoot() { + tqInfoSansVerDat := *request.TaskQueueInfo + tqInfoSansVerDat.VersioningData = nil + reqClone := *request + reqClone.TaskQueueInfo = &tqInfoSansVerDat + reqToPersist = &reqClone + } + return db.store.UpdateTaskQueue(ctx, reqToPersist) } func (db *taskQueueDB) expiryTime() *time.Time { @@ -352,8 +388,8 @@ func (db *taskQueueDB) expiryTime() *time.Time { func (db *taskQueueDB) cachedQueueInfo() *persistencespb.TaskQueueInfo { return &persistencespb.TaskQueueInfo{ NamespaceId: db.namespaceID.String(), - Name: db.taskQueueName, - TaskType: db.taskType, + Name: db.taskQueue.name, + TaskType: db.taskQueue.taskType, Kind: db.taskQueueKind, AckLevel: db.ackLevel, VersioningData: db.versioningData, diff --git a/service/matching/handler.go b/service/matching/handler.go index f71a66a8b8f..43ed8ba0e20 100644 --- a/service/matching/handler.go +++ b/service/matching/handler.go @@ -367,11 +367,10 @@ func (h *Handler) UpdateWorkerBuildIdOrdering( metrics.MatchingUpdateWorkerBuildIdOrderingScope, ) - response, err := h.engine.UpdateWorkerBuildIdOrdering(hCtx, request) - return response, err + return h.engine.UpdateWorkerBuildIdOrdering(hCtx, request) } -// UpdateWorkerBuildIdOrdering allows changing the worker versioning graph for a task queue +// GetWorkerBuildIdOrdering fetches the worker versioning graph for a task queue func (h *Handler) GetWorkerBuildIdOrdering( ctx context.Context, request *matchingservice.GetWorkerBuildIdOrderingRequest, @@ -387,8 +386,44 @@ func (h *Handler) GetWorkerBuildIdOrdering( metrics.MatchingGetWorkerBuildIdOrderingScope, ) - response, err := h.engine.GetWorkerBuildIdOrdering(hCtx, request) - return response, err + return h.engine.GetWorkerBuildIdOrdering(hCtx, request) +} + +// InvalidateTaskQueueMetadata notifies a task queue that some data has changed, and should be invalidated/refreshed +func (h *Handler) InvalidateTaskQueueMetadata( + ctx context.Context, + request *matchingservice.InvalidateTaskQueueMetadataRequest, +) (_ *matchingservice.InvalidateTaskQueueMetadataResponse, retError error) { + defer log.CapturePanic(h.logger, &retError) + hCtx := h.newHandlerContext( + ctx, + namespace.ID(request.GetNamespaceId()), + &taskqueuepb.TaskQueue{ + Name: request.GetTaskQueue(), + Kind: enumspb.TASK_QUEUE_KIND_NORMAL, + }, + metrics.MatchingInvalidateTaskQueueMetadataScope, + ) + + return h.engine.InvalidateTaskQueueMetadata(hCtx, request) +} + +func (h *Handler) GetTaskQueueMetadata( + ctx context.Context, + request *matchingservice.GetTaskQueueMetadataRequest, +) (_ *matchingservice.GetTaskQueueMetadataResponse, retError error) { + defer log.CapturePanic(h.logger, &retError) + hCtx := h.newHandlerContext( + ctx, + namespace.ID(request.GetNamespaceId()), + &taskqueuepb.TaskQueue{ + Name: request.GetTaskQueue(), + Kind: enumspb.TASK_QUEUE_KIND_NORMAL, + }, + metrics.MatchingGetTaskQueueMetadataScope, + ) + + return h.engine.GetTaskQueueMetadata(hCtx, request) } func (h *Handler) namespaceName(id namespace.ID) namespace.Name { diff --git a/service/matching/matchingEngine.go b/service/matching/matchingEngine.go index c724289e652..11607adcc78 100644 --- a/service/matching/matchingEngine.go +++ b/service/matching/matchingEngine.go @@ -743,6 +743,61 @@ func (e *matchingEngineImpl) GetWorkerBuildIdOrdering( }, nil } +func (e *matchingEngineImpl) InvalidateTaskQueueMetadata( + hCtx *handlerContext, + req *matchingservice.InvalidateTaskQueueMetadataRequest, +) (*matchingservice.InvalidateTaskQueueMetadataResponse, error) { + taskQueue, err := newTaskQueueID(namespace.ID(req.GetNamespaceId()), req.GetTaskQueue(), req.GetTaskQueueType()) + if err != nil { + return nil, err + } + tqMgr, err := e.getTaskQueueManager(hCtx, taskQueue, enumspb.TASK_QUEUE_KIND_NORMAL, false) + if tqMgr == nil && err == nil { + // Task queue is not currently loaded, so nothing to do here + return &matchingservice.InvalidateTaskQueueMetadataResponse{}, nil + } + if err != nil { + return nil, err + } + err = tqMgr.InvalidateMetadata(req) + if err != nil { + return nil, err + } + return &matchingservice.InvalidateTaskQueueMetadataResponse{}, nil +} + +func (e *matchingEngineImpl) GetTaskQueueMetadata( + hCtx *handlerContext, + req *matchingservice.GetTaskQueueMetadataRequest, +) (*matchingservice.GetTaskQueueMetadataResponse, error) { + namespaceID := namespace.ID(req.GetNamespaceId()) + taskQueueName := req.GetTaskQueue() + taskQueue, err := newTaskQueueID(namespaceID, taskQueueName, enumspb.TASK_QUEUE_TYPE_WORKFLOW) + if err != nil { + return nil, err + } + tqMgr, err := e.getTaskQueueManager(hCtx, taskQueue, enumspb.TASK_QUEUE_KIND_NORMAL, true) + if err != nil { + return nil, err + } + resp := &matchingservice.GetTaskQueueMetadataResponse{} + verDatHash := req.GetWantVersioningDataCurhash() + // This isn't != nil, because gogoproto will round-trip serialize an empty byte array in a request + // into a nil field. + if len(verDatHash) > 0 { + vDat, err := tqMgr.GetVersioningData(hCtx) + if err != nil { + return nil, err + } + if !bytes.Equal(HashVersioningData(vDat), verDatHash) { + resp.VersioningDataResp = &matchingservice.GetTaskQueueMetadataResponse_VersioningData{ + VersioningData: vDat, + } + } + } + return resp, nil +} + func (e *matchingEngineImpl) getHostInfo(partitionKey string) (string, error) { host, err := e.keyResolver.Lookup(partitionKey) if err != nil { diff --git a/service/matching/matchingEngineInterfaces.go b/service/matching/matchingEngineInterfaces.go index eaa1fa5e3ef..2e8f8273e99 100644 --- a/service/matching/matchingEngineInterfaces.go +++ b/service/matching/matchingEngineInterfaces.go @@ -29,7 +29,7 @@ import ( ) type ( - // Engine exposes interfaces for clients to poll for activity and workflow tasks. + // Engine exposes interfaces for clients to interact with the matching engine Engine interface { Stop() AddWorkflowTask(hCtx *handlerContext, addRequest *matchingservice.AddWorkflowTaskRequest) (syncMatch bool, err error) @@ -43,5 +43,7 @@ type ( ListTaskQueuePartitions(hCtx *handlerContext, request *matchingservice.ListTaskQueuePartitionsRequest) (*matchingservice.ListTaskQueuePartitionsResponse, error) UpdateWorkerBuildIdOrdering(ctx *handlerContext, request *matchingservice.UpdateWorkerBuildIdOrderingRequest) (*matchingservice.UpdateWorkerBuildIdOrderingResponse, error) GetWorkerBuildIdOrdering(ctx *handlerContext, request *matchingservice.GetWorkerBuildIdOrderingRequest) (*matchingservice.GetWorkerBuildIdOrderingResponse, error) + InvalidateTaskQueueMetadata(ctx *handlerContext, request *matchingservice.InvalidateTaskQueueMetadataRequest) (*matchingservice.InvalidateTaskQueueMetadataResponse, error) + GetTaskQueueMetadata(ctx *handlerContext, request *matchingservice.GetTaskQueueMetadataRequest) (*matchingservice.GetTaskQueueMetadataResponse, error) } ) diff --git a/service/matching/matchingEngine_test.go b/service/matching/matchingEngine_test.go index 6061089430b..bfd41ce14ac 100644 --- a/service/matching/matchingEngine_test.go +++ b/service/matching/matchingEngine_test.go @@ -51,6 +51,7 @@ import ( "go.temporal.io/server/api/historyservice/v1" "go.temporal.io/server/api/historyservicemock/v1" "go.temporal.io/server/api/matchingservice/v1" + "go.temporal.io/server/api/matchingservicemock/v1" persistencespb "go.temporal.io/server/api/persistence/v1" tokenspb "go.temporal.io/server/api/token/v1" "go.temporal.io/server/common" @@ -74,6 +75,7 @@ type ( suite.Suite controller *gomock.Controller mockHistoryClient *historyservicemock.MockHistoryServiceClient + mockMatchingClient *matchingservicemock.MockMatchingServiceClient mockNamespaceCache *namespace.MockRegistry matchingEngine *matchingEngineImpl @@ -106,6 +108,9 @@ func (s *matchingEngineSuite) SetupTest() { defer s.Unlock() s.controller = gomock.NewController(s.T()) s.mockHistoryClient = historyservicemock.NewMockHistoryServiceClient(s.controller) + s.mockMatchingClient = matchingservicemock.NewMockMatchingServiceClient(s.controller) + s.mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(&matchingservice.GetTaskQueueMetadataResponse{}, nil).AnyTimes() s.taskManager = newTestTaskManager(s.logger) s.mockNamespaceCache = namespace.NewMockRegistry(s.controller) ns := namespace.NewLocalNamespaceForTest(&persistencespb.NamespaceInfo{Name: matchingTestNamespace}, nil, "") @@ -131,12 +136,12 @@ func (s *matchingEngineSuite) TearDownTest() { func (s *matchingEngineSuite) newMatchingEngine( config *Config, taskMgr persistence.TaskManager, ) *matchingEngineImpl { - return newMatchingEngine(config, taskMgr, s.mockHistoryClient, s.logger, s.mockNamespaceCache) + return newMatchingEngine(config, taskMgr, s.mockHistoryClient, s.logger, s.mockNamespaceCache, s.mockMatchingClient) } func newMatchingEngine( config *Config, taskMgr persistence.TaskManager, mockHistoryClient historyservice.HistoryServiceClient, - logger log.Logger, mockNamespaceCache namespace.Registry, + logger log.Logger, mockNamespaceCache namespace.Registry, mockMatchingClient matchingservice.MatchingServiceClient, ) *matchingEngineImpl { return &matchingEngineImpl{ taskManager: taskMgr, @@ -145,6 +150,7 @@ func newMatchingEngine( taskQueueCount: make(map[taskQueueCounterKey]int), logger: logger, metricsClient: metrics.NoopClient, + matchingClient: mockMatchingClient, tokenSerializer: common.NewProtoTaskTokenSerializer(), config: config, namespaceRegistry: mockNamespaceCache, @@ -1848,6 +1854,7 @@ func (s *matchingEngineSuite) TestTaskExpiryAndCompletion() { } func (s *matchingEngineSuite) TestGetVersioningData() { + s.mockMatchingClient.EXPECT().InvalidateTaskQueueMetadata(gomock.Any(), gomock.Any()).Return(nil, nil).AnyTimes() namespaceID := namespace.ID(uuid.New()) tq := "tupac" @@ -1959,6 +1966,44 @@ func (s *matchingEngineSuite) TestGetVersioningData() { s.Equal(mkVerId("99.5"), lastNode.GetVersion()) } +func (s *matchingEngineSuite) TestActivityQueueMetadataInvalidate() { + // Overwrite the matching mock - we expect one and only one fetch call here, after the activity queue is invalidated + mockMatch := matchingservicemock.NewMockMatchingServiceClient(s.controller) + mockMatch.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(&matchingservice.GetTaskQueueMetadataResponse{}, nil). + Times(1) + s.matchingEngine.matchingClient = mockMatch + + namespaceID := namespace.ID(uuid.New()) + tq := "tupac" + + res, err := s.matchingEngine.GetWorkerBuildIdOrdering(s.handlerContext, &matchingservice.GetWorkerBuildIdOrderingRequest{ + NamespaceId: namespaceID.String(), + Request: &workflowservice.GetWorkerBuildIdOrderingRequest{ + Namespace: namespaceID.String(), + TaskQueue: tq, + MaxDepth: 0, + }, + }) + s.NoError(err) + s.NotNil(res) + + // Force the activity queue to be loaded (invalidate won't load it - so we have to load it for invalidate to care + // about fetching) + actTqId := newTestTaskQueueID(namespaceID, tq, enumspb.TASK_QUEUE_TYPE_ACTIVITY) + ttqm, err := s.matchingEngine.getTaskQueueManager(context.Background(), actTqId, enumspb.TASK_QUEUE_KIND_NORMAL, true) + s.NoError(err) + s.NotNil(ttqm) + + _, err = s.matchingEngine.InvalidateTaskQueueMetadata(s.handlerContext, &matchingservice.InvalidateTaskQueueMetadataRequest{ + NamespaceId: namespaceID.String(), + TaskQueue: tq, + TaskQueueType: enumspb.TASK_QUEUE_TYPE_ACTIVITY, + VersioningData: &persistencespb.VersioningData{CurrentDefault: mkVerIdNode("hi")}, + }) + s.NoError(err) +} + func (s *matchingEngineSuite) setupRecordActivityTaskStartedMock(tlName string) { activityTypeName := "activity1" activityID := "activityId1" diff --git a/service/matching/taskQueueManager.go b/service/matching/taskQueueManager.go index 4a799f794cc..2ca37380379 100644 --- a/service/matching/taskQueueManager.go +++ b/service/matching/taskQueueManager.go @@ -33,6 +33,8 @@ import ( "sync/atomic" "time" + uberatomic "go.uber.org/atomic" + commonpb "go.temporal.io/api/common/v1" enumspb "go.temporal.io/api/enums/v1" "go.temporal.io/api/serviceerror" @@ -40,20 +42,20 @@ import ( enumsspb "go.temporal.io/server/api/enums/v1" "go.temporal.io/server/api/matchingservice/v1" + persistencespb "go.temporal.io/server/api/persistence/v1" + "go.temporal.io/server/common" + "go.temporal.io/server/common/backoff" "go.temporal.io/server/common/clock" "go.temporal.io/server/common/cluster" + "go.temporal.io/server/common/dynamicconfig" "go.temporal.io/server/common/future" "go.temporal.io/server/common/headers" - "go.temporal.io/server/common/util" - - persistencespb "go.temporal.io/server/api/persistence/v1" - "go.temporal.io/server/common" - "go.temporal.io/server/common/backoff" "go.temporal.io/server/common/log" "go.temporal.io/server/common/log/tag" "go.temporal.io/server/common/metrics" "go.temporal.io/server/common/namespace" "go.temporal.io/server/common/persistence" + "go.temporal.io/server/common/util" ) const ( @@ -118,6 +120,8 @@ type ( GetVersioningData(ctx context.Context) (*persistencespb.VersioningData, error) // MutateVersioningData allows callers to update versioning data for this task queue MutateVersioningData(ctx context.Context, mutator func(*persistencespb.VersioningData) error) error + // InvalidateMetadata allows callers to invalidate cached data on this task queue + InvalidateMetadata(request *matchingservice.InvalidateTaskQueueMetadataRequest) error CancelPoller(pollerID string) GetAllPollerInfo() []*taskqueuepb.PollerInfo HasPollerAfter(accessTime time.Time) bool @@ -143,6 +147,7 @@ type ( matcher *TaskMatcher // for matching a task producer with a poller namespaceRegistry namespace.Registry logger log.Logger + matchingClient matchingservice.MatchingServiceClient metricsClient metrics.Client namespace namespace.Name metricScope metrics.Scope // namespace/taskqueue tagged metric scope @@ -158,6 +163,18 @@ type ( signalFatalProblem func(taskQueueManager) clusterMeta cluster.Metadata initializedError *future.FutureImpl[struct{}] + // metadataInitialFetch is fulfilled once versioning data is fetched from the root partition. If this TQ is + // the root partition, it is fulfilled as soon as it is fetched from db. + metadataInitialFetch *future.FutureImpl[struct{}] + metadataPoller metadataPoller + } + + metadataPoller struct { + // Ensures that we launch the goroutine for polling for updates only one time + running *uberatomic.Bool + pollIntervalCfgFn dynamicconfig.DurationPropertyFn + stopChan chan struct{} + tqMgr *taskQueueManagerImpl } ) @@ -187,7 +204,7 @@ func newTaskQueueManager( taskQueueConfig := newTaskQueueConfig(taskQueue, config, nsName) - db := newTaskQueueDB(e.taskManager, taskQueue.namespaceID, taskQueue.name, taskQueue.taskType, taskQueueKind, e.logger) + db := newTaskQueueDB(e.taskManager, taskQueue.namespaceID, taskQueue, taskQueueKind, e.logger) logger := log.With(e.logger, tag.WorkflowTaskQueueName(taskQueue.name), tag.WorkflowTaskQueueType(taskQueue.taskType), @@ -199,24 +216,32 @@ func newTaskQueueManager( taskQueueKind, ).Tagged(metrics.TaskQueueTypeTag(taskQueue.taskType)) tlMgr := &taskQueueManagerImpl{ - status: common.DaemonStatusInitialized, - namespaceRegistry: e.namespaceRegistry, - metricsClient: e.metricsClient, - taskQueueID: taskQueue, - taskQueueKind: taskQueueKind, - logger: logger, - db: db, - taskAckManager: newAckManager(e.logger), - taskGC: newTaskGC(db, taskQueueConfig), - config: taskQueueConfig, - pollerHistory: newPollerHistory(), - outstandingPollsMap: make(map[string]context.CancelFunc), - signalFatalProblem: e.unloadTaskQueue, - clusterMeta: clusterMeta, - namespace: nsName, - metricScope: metricsScope, - initializedError: future.NewFuture[struct{}](), + status: common.DaemonStatusInitialized, + namespaceRegistry: e.namespaceRegistry, + matchingClient: e.matchingClient, + metricsClient: e.metricsClient, + taskQueueID: taskQueue, + taskQueueKind: taskQueueKind, + logger: logger, + db: db, + taskAckManager: newAckManager(e.logger), + taskGC: newTaskGC(db, taskQueueConfig), + config: taskQueueConfig, + pollerHistory: newPollerHistory(), + outstandingPollsMap: make(map[string]context.CancelFunc), + signalFatalProblem: e.unloadTaskQueue, + clusterMeta: clusterMeta, + namespace: nsName, + metricScope: metricsScope, + initializedError: future.NewFuture[struct{}](), + metadataInitialFetch: future.NewFuture[struct{}](), + metadataPoller: metadataPoller{ + running: uberatomic.NewBool(false), + pollIntervalCfgFn: e.config.MetadataPollFrequency, + stopChan: make(chan struct{}), + }, } + tlMgr.metadataPoller.tqMgr = tlMgr tlMgr.liveness = newLiveness( clock.NewRealTimeSource(), @@ -265,6 +290,7 @@ func (c *taskQueueManagerImpl) Start() { c.liveness.Start() c.taskWriter.Start() c.taskReader.Start() + go c.fetchMetadataFromRootPartitionOnInit(context.TODO()) c.logger.Info("", tag.LifeCycleStarted) c.metricScope.IncCounter(metrics.TaskQueueStartedCounter) } @@ -288,6 +314,7 @@ func (c *taskQueueManagerImpl) Stop() { c.db.UpdateState(ctx, ackLevel) c.taskGC.RunNow(ctx, ackLevel) } + c.metadataPoller.Stop() c.liveness.Stop() c.taskWriter.Stop() c.taskReader.Stop() @@ -297,6 +324,12 @@ func (c *taskQueueManagerImpl) Stop() { func (c *taskQueueManagerImpl) WaitUntilInitialized(ctx context.Context) error { _, err := c.initializedError.Get(ctx) + if err != nil { + return err + } + // We don't really care if the initial fetch worked or not, anything that *requires* a bit of metadata should fail + // that operation if it's never fetched OK. If the initial fetch errored, the metadataPoller will have been started. + _, _ = c.metadataInitialFetch.Get(ctx) return err } @@ -432,14 +465,67 @@ func (c *taskQueueManagerImpl) DispatchQueryTask( return c.matcher.OfferQuery(ctx, task) } +// GetVersioningData returns the versioning data for the task queue if any. If this task queue is a sub-partition and +// has no cached data, it will explicitly attempt a fetch from the root partition. func (c *taskQueueManagerImpl) GetVersioningData(ctx context.Context) (*persistencespb.VersioningData, error) { - return c.db.GetVersioningData(ctx) + vd, err := c.db.GetVersioningData(ctx) + if errors.Is(err, errVersioningDataNotPresentOnPartition) { + // If this is a non-root-partition with no versioning data, this call is indicating we might expect to find + // some. Since we may not have started the poller, we want to explicitly attempt to fetch now, because + // it's possible some was added to the root partition, but it failed to invalidate this partition. + return c.fetchMetadataFromRootPartition(ctx) + } + return vd, err } func (c *taskQueueManagerImpl) MutateVersioningData(ctx context.Context, mutator func(*persistencespb.VersioningData) error) error { - err := c.db.MutateVersioningData(ctx, mutator) + newDat, err := c.db.MutateVersioningData(ctx, mutator) c.signalIfFatal(err) - return err + if err != nil { + return err + } + // We will have errored already if this was not the root workflow partition. + // Now notify partitions that they should fetch changed data from us + numParts := util.Max(c.config.NumReadPartitions(), c.config.NumWritePartitions()) + wg := &sync.WaitGroup{} + for i := 0; i < numParts; i++ { + for _, tqt := range []enumspb.TaskQueueType{enumspb.TASK_QUEUE_TYPE_WORKFLOW, enumspb.TASK_QUEUE_TYPE_ACTIVITY} { + if i == 0 && tqt == enumspb.TASK_QUEUE_TYPE_WORKFLOW { + continue // Root workflow partition owns the data, skip it. + } + wg.Add(1) + go func(i int, tqt enumspb.TaskQueueType) { + tq := c.taskQueueID.mkName(i) + _, err := c.matchingClient.InvalidateTaskQueueMetadata(ctx, + &matchingservice.InvalidateTaskQueueMetadataRequest{ + NamespaceId: c.taskQueueID.namespaceID.String(), + TaskQueue: tq, + TaskQueueType: tqt, + VersioningData: newDat, + }) + if err != nil { + c.logger.Warn("Failed to notify sub-partition of invalidated versioning data", + tag.WorkflowTaskQueueName(tq), tag.Error(err)) + } + wg.Done() + }(i, tqt) + } + } + wg.Wait() + return nil +} + +func (c *taskQueueManagerImpl) InvalidateMetadata(request *matchingservice.InvalidateTaskQueueMetadataRequest) error { + if request.GetVersioningData() != nil { + if c.taskQueueID.IsRoot() && c.taskQueueID.taskType == enumspb.TASK_QUEUE_TYPE_WORKFLOW { + // Should never happen. Root partitions do not get their versioning data invalidated. + c.logger.Warn("A root workflow partition was told to invalidate its versioning data, this should not happen") + return nil + } + c.db.setVersioningDataForNonRootPartition(request.GetVersioningData()) + c.metadataPoller.StartIfUnstarted() + } + return nil } // GetAllPollerInfo returns all pollers that polled from this taskqueue in last few minutes @@ -636,3 +722,89 @@ func newIOContext() (context.Context, context.CancelFunc) { return ctx, cancel } + +func (c *taskQueueManagerImpl) fetchMetadataFromRootPartitionOnInit(ctx context.Context) { + if c.metadataInitialFetch.Ready() { + return + } + _, err := c.fetchMetadataFromRootPartition(ctx) + c.metadataInitialFetch.Set(struct{}{}, err) +} + +// fetchMetadataFromRootPartition fetches metadata from root partition iff this partition is not a root partition. +// Returns the fetched data, if fetching was necessary and successful. +func (c *taskQueueManagerImpl) fetchMetadataFromRootPartition(ctx context.Context) (*persistencespb.VersioningData, error) { + // Nothing to do if we are the root partition of a workflow queue, since we should own the data. + // (for versioning - any later added metadata may need to not abort so early) + if c.taskQueueID.IsRoot() && c.taskQueueID.taskType == enumspb.TASK_QUEUE_TYPE_WORKFLOW { + return nil, nil + } + + curDat, err := c.db.GetVersioningData(ctx) + if err != nil && !errors.Is(err, errVersioningDataNotPresentOnPartition) { + return nil, err + } + curHash := HashVersioningData(curDat) + + rootTqName := c.taskQueueID.GetRoot() + if len(curHash) == 0 { + // if we have no data, make sure we send a sigil value, so it's known we desire versioning data + curHash = []byte{0} + } + res, err := c.matchingClient.GetTaskQueueMetadata(ctx, &matchingservice.GetTaskQueueMetadataRequest{ + NamespaceId: c.taskQueueID.namespaceID.String(), + TaskQueue: rootTqName, + WantVersioningDataCurhash: curHash, + }) + // If the root partition returns nil here, then that means our data matched, and we don't need to update. + // If it's nil because it never existed, then we'd never have any data. + // It can't be nil due to removing versions, as that would result in a non-nil container with + // nil inner fields. + if !res.GetMatchedReqHash() { + c.db.setVersioningDataForNonRootPartition(res.GetVersioningData()) + } + // We want to start the poller as long as the root partition has any kind of data (or fetching hasn't worked) + if res.GetMatchedReqHash() || res.GetVersioningData() != nil || err != nil { + c.metadataPoller.StartIfUnstarted() + } + if err != nil { + return nil, err + } + return res.GetVersioningData(), nil +} + +// StartIfUnstarted starts the poller if it's not already started. The passed in function is called repeatedly +// and if it returns true, the poller will shut down, at which point it may be started again. +func (mp *metadataPoller) StartIfUnstarted() { + if mp.running.Load() { + return + } + go mp.pollLoop() +} + +func (mp *metadataPoller) pollLoop() { + mp.running.Store(true) + defer mp.running.Store(false) + ticker := time.NewTicker(mp.pollIntervalCfgFn()) + defer ticker.Stop() + + for { + select { + case <-mp.stopChan: + return + case <-ticker.C: + // In case the interval has changed + ticker.Reset(mp.pollIntervalCfgFn()) + dat, err := mp.tqMgr.fetchMetadataFromRootPartition(context.TODO()) + if dat == nil && err == nil { + // Can stop polling since there is no versioning data. Loop will be restarted if we + // are told to invalidate the data, or we attempt to fetch it via GetVersioningData. + return + } + } + } +} + +func (mp *metadataPoller) Stop() { + close(mp.stopChan) +} diff --git a/service/matching/taskQueueManager_test.go b/service/matching/taskQueueManager_test.go index 192c9b6f35c..3f324b5c1f0 100644 --- a/service/matching/taskQueueManager_test.go +++ b/service/matching/taskQueueManager_test.go @@ -27,11 +27,15 @@ package matching import ( "context" "errors" + "fmt" "math" "sync/atomic" "testing" "time" + "go.temporal.io/server/api/matchingservice/v1" + "go.temporal.io/server/api/matchingservicemock/v1" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -52,6 +56,23 @@ import ( var rpsInf = math.Inf(1) +const defaultNamespaceId = namespace.ID("deadbeef-0000-4567-890a-bcdef0123456") +const defaultRootTqID = "tq" + +type tqmTestOpts struct { + config *Config + tqId *taskQueueID + matchingClientMock *matchingservicemock.MockMatchingServiceClient +} + +func defaultTqmTestOpts(controller *gomock.Controller) *tqmTestOpts { + return &tqmTestOpts{ + config: defaultTestConfig(), + tqId: defaultTqId(), + matchingClientMock: matchingservicemock.NewMockMatchingServiceClient(controller), + } +} + func TestDeliverBufferTasks(t *testing.T) { controller := gomock.NewController(t) defer controller.Finish() @@ -285,30 +306,34 @@ func runOneShotPoller(ctx context.Context, tqm taskQueueManager) (*goro.Handle, return handle, out } +func defaultTqId() *taskQueueID { + return newTestTaskQueueID(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_WORKFLOW) +} + func mustCreateTestTaskQueueManager( t *testing.T, controller *gomock.Controller, opts ...taskQueueManagerOpt, ) *taskQueueManagerImpl { t.Helper() - return mustCreateTestTaskQueueManagerWithConfig(t, controller, defaultTestConfig(), opts...) + return mustCreateTestTaskQueueManagerWithConfig(t, controller, defaultTqmTestOpts(controller), opts...) } func mustCreateTestTaskQueueManagerWithConfig( t *testing.T, controller *gomock.Controller, - cfg *Config, + testOpts *tqmTestOpts, opts ...taskQueueManagerOpt, ) *taskQueueManagerImpl { t.Helper() - tqm, err := createTestTaskQueueManagerWithConfig(controller, cfg, opts...) + tqm, err := createTestTaskQueueManagerWithConfig(controller, testOpts, opts...) require.NoError(t, err) return tqm } func createTestTaskQueueManagerWithConfig( controller *gomock.Controller, - cfg *Config, + testOpts *tqmTestOpts, opts ...taskQueueManagerOpt, ) (*taskQueueManagerImpl, error) { logger := log.NewTestLogger() @@ -316,16 +341,13 @@ func createTestTaskQueueManagerWithConfig( mockNamespaceCache := namespace.NewMockRegistry(controller) mockNamespaceCache.EXPECT().GetNamespaceByID(gomock.Any()).Return(&namespace.Namespace{}, nil).AnyTimes() cmeta := cluster.NewMetadataForTest(cluster.NewTestClusterMetadataConfig(false, true)) - me := newMatchingEngine(cfg, tm, nil, logger, mockNamespaceCache) - tl := "tq" - dID := namespace.ID("deadbeef-0000-4567-890a-bcdef0123456") - tlID := newTestTaskQueueID(dID, tl, enumspb.TASK_QUEUE_TYPE_ACTIVITY) + me := newMatchingEngine(testOpts.config, tm, nil, logger, mockNamespaceCache, testOpts.matchingClientMock) tlKind := enumspb.TASK_QUEUE_KIND_NORMAL - tlMgr, err := newTaskQueueManager(me, tlID, tlKind, cfg, cmeta, opts...) + tlMgr, err := newTaskQueueManager(me, testOpts.tqId, tlKind, testOpts.config, cmeta, opts...) if err != nil { return nil, err } - me.taskQueues[*tlID] = tlMgr + me.taskQueues[*testOpts.tqId] = tlMgr return tlMgr.(*taskQueueManagerImpl), nil } @@ -403,15 +425,17 @@ func TestCheckIdleTaskQueue(t *testing.T) { cfg := NewConfig(dynamicconfig.NewNoopCollection()) cfg.IdleTaskqueueCheckInterval = dynamicconfig.GetDurationPropertyFnFilteredByTaskQueueInfo(2 * time.Second) + tqCfg := defaultTqmTestOpts(controller) + tqCfg.config = cfg // Idle - tlm := mustCreateTestTaskQueueManagerWithConfig(t, controller, cfg) + tlm := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg) tlm.Start() time.Sleep(1 * time.Second) require.Equal(t, common.DaemonStatusStarted, atomic.LoadInt32(&tlm.status)) // Active poll-er - tlm = mustCreateTestTaskQueueManagerWithConfig(t, controller, cfg) + tlm = mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg) tlm.Start() tlm.pollerHistory.updatePollerInfo(pollerIdentity("test-poll"), nil) require.Equal(t, 1, len(tlm.GetAllPollerInfo())) @@ -421,7 +445,7 @@ func TestCheckIdleTaskQueue(t *testing.T) { require.Equal(t, common.DaemonStatusStopped, atomic.LoadInt32(&tlm.status)) // Active adding task - tlm = mustCreateTestTaskQueueManagerWithConfig(t, controller, cfg) + tlm = mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg) tlm.Start() require.Equal(t, 0, len(tlm.GetAllPollerInfo())) tlm.taskReader.Signal() @@ -438,7 +462,7 @@ func TestAddTaskStandby(t *testing.T) { tlm := mustCreateTestTaskQueueManagerWithConfig( t, controller, - NewConfig(dynamicconfig.NewNoopCollection()), + defaultTqmTestOpts(controller), func(tqm *taskQueueManagerImpl) { // we need to override the mockNamespaceCache to return a passive namespace mockNamespaceCache := namespace.NewMockRegistry(controller) @@ -475,3 +499,361 @@ func TestAddTaskStandby(t *testing.T) { require.Equal(t, errRemoteSyncMatchFailed, err) // should not persist the task require.False(t, syncMatch) } + +func TestTaskQueueSubParitionFetchesVersioningInfoFromRootPartitionOnInit(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + ctx := context.Background() + subTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_WORKFLOW, 1) + require.NoError(t, err) + tqCfg := defaultTqmTestOpts(controller) + tqCfg.tqId = subTqId + + data := &persistencespb.VersioningData{ + CurrentDefault: mkVerIdNode("0"), + } + asResp := &matchingservice.GetTaskQueueMetadataResponse{ + VersioningDataResp: &matchingservice.GetTaskQueueMetadataResponse_VersioningData{ + VersioningData: data, + }, + } + + subTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg, + func(tqm *taskQueueManagerImpl) { + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), + gomock.Eq(&matchingservice.GetTaskQueueMetadataRequest{ + NamespaceId: defaultNamespaceId.String(), + TaskQueue: defaultRootTqID, + // Nonsense value since it has nothing on startup + WantVersioningDataCurhash: []byte{0}, + })). + Return(asResp, nil) + tqm.matchingClient = mockMatchingClient + }) + subTq.Start() + require.NoError(t, subTq.WaitUntilInitialized(ctx)) + verDat, err := subTq.GetVersioningData(ctx) + require.NoError(t, err) + require.Equal(t, data, verDat) + subTq.Stop() +} + +func TestTaskQueueSubParitionSendsCurrentHashOfVersioningDataWhenFetching(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + ctx := context.Background() + subTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_WORKFLOW, 1) + require.NoError(t, err) + tqCfg := defaultTqmTestOpts(controller) + tqCfg.tqId = subTqId + + data := &persistencespb.VersioningData{ + CurrentDefault: mkVerIdNode("0"), + } + asResp := &matchingservice.GetTaskQueueMetadataResponse{ + VersioningDataResp: &matchingservice.GetTaskQueueMetadataResponse_VersioningData{ + VersioningData: data, + }, + } + dataHash := HashVersioningData(data) + + subTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg, + func(tqm *taskQueueManagerImpl) { + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), + gomock.Eq(&matchingservice.GetTaskQueueMetadataRequest{ + NamespaceId: defaultNamespaceId.String(), + TaskQueue: defaultRootTqID, + WantVersioningDataCurhash: dataHash, + })). + Return(asResp, nil) + tqm.matchingClient = mockMatchingClient + }) + // Cram some versioning data in there so it will have something to hash when fetching + subTq.db.versioningData = data + // Don't start it. Just explicitly call fetching function. + res, err := subTq.fetchMetadataFromRootPartition(ctx) + require.NotNil(t, res) + require.NoError(t, err) +} + +type invalidateMatcher struct { + matchesTaskQType enumspb.TaskQueueType +} + +func (m invalidateMatcher) Matches(x interface{}) bool { + v, ok := x.(*matchingservice.InvalidateTaskQueueMetadataRequest) + return ok && v.GetTaskQueueType() == m.matchesTaskQType +} +func (m invalidateMatcher) String() string { + return fmt.Sprintf("%#v", m) +} + +func TestTaskQueueRootPartitionNotifiesChildrenOfInvalidation(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + ctx := context.Background() + + rootTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, defaultTqmTestOpts(controller), + func(tqm *taskQueueManagerImpl) { + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + mockMatchingClient.EXPECT().InvalidateTaskQueueMetadata( + gomock.Any(), invalidateMatcher{matchesTaskQType: enumspb.TASK_QUEUE_TYPE_WORKFLOW}). + Return(&matchingservice.InvalidateTaskQueueMetadataResponse{}, nil). + Times(tqm.config.NumReadPartitions() - 1) + mockMatchingClient.EXPECT().InvalidateTaskQueueMetadata( + gomock.Any(), invalidateMatcher{matchesTaskQType: enumspb.TASK_QUEUE_TYPE_ACTIVITY}). + Return(&matchingservice.InvalidateTaskQueueMetadataResponse{}, nil). + // Not minus 1 here because root activity partition gets invalidated + Times(tqm.config.NumReadPartitions()) + tqm.matchingClient = mockMatchingClient + }) + + rootTq.Start() + require.NoError(t, rootTq.WaitUntilInitialized(ctx)) + // Make a change, mock verifies children are invalidated + require.NoError(t, rootTq.MutateVersioningData(ctx, func(vd *persistencespb.VersioningData) error { + *vd = persistencespb.VersioningData{ + CurrentDefault: mkVerIdNode("0"), + } + return nil + })) + rootTq.Stop() +} + +func TestTaskQueueSubPartitionPollsPeriodically(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + ctx := context.Background() + subTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_WORKFLOW, 1) + require.NoError(t, err) + tqCfg := defaultTqmTestOpts(controller) + tqCfg.tqId = subTqId + tqCfg.config.MetadataPollFrequency = func(opts ...dynamicconfig.FilterOption) time.Duration { + return time.Millisecond * 10 + } + + asResp := &matchingservice.GetTaskQueueMetadataResponse{ + VersioningDataResp: &matchingservice.GetTaskQueueMetadataResponse_VersioningData{ + VersioningData: &persistencespb.VersioningData{ + CurrentDefault: mkVerIdNode("0"), + }, + }, + } + + subTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg, + func(tqm *taskQueueManagerImpl) { + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(asResp, nil).MinTimes(3) + tqm.matchingClient = mockMatchingClient + }) + res, err := subTq.fetchMetadataFromRootPartition(ctx) + require.NotNil(t, res) + require.NoError(t, err) + // Wait a bit to make sure we poll a few times + time.Sleep(time.Millisecond * 25) + subTq.Stop() +} + +func TestTaskQueueSubPartitionDoesNotPollIfNoDataThenPollsWhenInvalidated(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + ctx := context.Background() + subTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_WORKFLOW, 1) + require.NoError(t, err) + tqCfg := defaultTqmTestOpts(controller) + tqCfg.tqId = subTqId + tqCfg.config.MetadataPollFrequency = func(opts ...dynamicconfig.FilterOption) time.Duration { + return time.Millisecond * 10 + } + + nilDatResp := &matchingservice.GetTaskQueueMetadataResponse{ + VersioningDataResp: &matchingservice.GetTaskQueueMetadataResponse_VersioningData{ + VersioningData: nil, + }, + } + verDat := &persistencespb.VersioningData{ + CurrentDefault: mkVerIdNode("0"), + } + hasDatResp := &matchingservice.GetTaskQueueMetadataResponse{ + VersioningDataResp: &matchingservice.GetTaskQueueMetadataResponse_VersioningData{ + VersioningData: verDat, + }, + } + + subTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg, + func(tqm *taskQueueManagerImpl) { + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(nilDatResp, nil).Times(2) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(hasDatResp, nil).MinTimes(1) + tqm.matchingClient = mockMatchingClient + }) + res, err := subTq.fetchMetadataFromRootPartition(ctx) + require.Nil(t, res) + require.NoError(t, err) + // Wait a bit to make sure we *don't* end up polling (if we do, mock will fail with >2 fetches) + time.Sleep(time.Millisecond * 25) + // Explicitly try to get versioning data. Since we don't have any cached, it'll explicitly fetch. + vDat, err := subTq.GetVersioningData(ctx) + require.NoError(t, err) + require.Nil(t, vDat) + // Now invalidate, the poll loop should be started, so we'll see at least one more mock call + err = subTq.InvalidateMetadata(&matchingservice.InvalidateTaskQueueMetadataRequest{ + VersioningData: verDat, + }) + require.NoError(t, err) + time.Sleep(time.Millisecond * 20) +} + +func TestTaskQueueManagerWaitInitFailThenPass(t *testing.T) { + controller := gomock.NewController(t) + ctx := context.Background() + + subTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_WORKFLOW, 1) + require.NoError(t, err) + tqCfg := defaultTqmTestOpts(controller) + tqCfg.tqId = subTqId + tqCfg.config.MetadataPollFrequency = func(opts ...dynamicconfig.FilterOption) time.Duration { + return time.Millisecond * 10 + } + + data := &persistencespb.VersioningData{ + CurrentDefault: mkVerIdNode("0"), + } + asResp := &matchingservice.GetTaskQueueMetadataResponse{ + VersioningDataResp: &matchingservice.GetTaskQueueMetadataResponse_VersioningData{ + VersioningData: data, + }, + } + + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + tq := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg, + func(tqm *taskQueueManagerImpl) { + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(nil, errors.New("some error")).Times(1) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(asResp, nil).Times(1) + tqm.matchingClient = mockMatchingClient + }) + + tq.Start() + // This does not error even if initial metadata fetch fails (and it does, here) + require.NoError(t, tq.WaitUntilInitialized(ctx)) + // Wait long enough for poller retry to happen + time.Sleep(time.Millisecond * 15) + // Need to make sure both calls have happened *before* calling to get data, as it would make a call if the second + // call hasn't happened yet. + controller.Finish() + // Get the data and see it's set + dat, err := tq.GetVersioningData(ctx) + require.NoError(t, err) + require.Equal(t, data, dat) + tq.Stop() +} + +func TestFetchingVersioningDataErrorsIfNeverFetchedFromRootSuccessfully(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + ctx := context.Background() + subTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_WORKFLOW, 1) + require.NoError(t, err) + tqCfg := defaultTqmTestOpts(controller) + tqCfg.tqId = subTqId + tqCfg.config.MetadataPollFrequency = func(opts ...dynamicconfig.FilterOption) time.Duration { + return time.Millisecond * 10 + } + + subTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg, + func(tqm *taskQueueManagerImpl) { + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(nil, errors.New("fetching broken!")).AnyTimes() + tqm.matchingClient = mockMatchingClient + }) + subTq.Start() + require.NoError(t, subTq.WaitUntilInitialized(ctx)) + for i := 0; i < 10; i++ { + _, err := subTq.GetVersioningData(ctx) + require.Error(t, err) + time.Sleep(time.Millisecond * 2) + } +} + +func TestActivityQueueGetsVersioningDataFromWorkflowQueue(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + ctx := context.Background() + + data := &persistencespb.VersioningData{ + CurrentDefault: mkVerIdNode("0"), + } + asResp := &matchingservice.GetTaskQueueMetadataResponse{ + VersioningDataResp: &matchingservice.GetTaskQueueMetadataResponse_VersioningData{ + VersioningData: data, + }, + } + + tqCfg := defaultTqmTestOpts(controller) + tqCfg.tqId.taskType = enumspb.TASK_QUEUE_TYPE_ACTIVITY + actTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg, + func(tqm *taskQueueManagerImpl) { + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(asResp, nil).Times(1) + tqm.matchingClient = mockMatchingClient + }) + actTq.Start() + require.NoError(t, actTq.WaitUntilInitialized(ctx)) + + subTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_ACTIVITY, 1) + require.NoError(t, err) + tqCfg = defaultTqmTestOpts(controller) + tqCfg.tqId = subTqId + actTqPart := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg, + func(tqm *taskQueueManagerImpl) { + mockMatchingClient := matchingservicemock.NewMockMatchingServiceClient(controller) + mockMatchingClient.EXPECT().GetTaskQueueMetadata(gomock.Any(), gomock.Any()). + Return(asResp, nil).Times(1) + tqm.matchingClient = mockMatchingClient + }) + actTqPart.Start() + require.NoError(t, actTqPart.WaitUntilInitialized(ctx)) + + verDat, err := actTq.GetVersioningData(ctx) + require.NoError(t, err) + require.Equal(t, data, verDat) + verDat, err = actTqPart.GetVersioningData(ctx) + require.NoError(t, err) + require.Equal(t, data, verDat) + + actTq.Stop() + actTqPart.Stop() +} + +func TestMutateOnNonRootFails(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + ctx := context.Background() + + subTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_WORKFLOW, 1) + require.NoError(t, err) + tqCfg := defaultTqmTestOpts(controller) + tqCfg.tqId = subTqId + subTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, tqCfg) + err = subTq.MutateVersioningData(ctx, func(data *persistencespb.VersioningData) error { return nil }) + require.Error(t, err) + require.ErrorIs(t, err, errVersioningDataNoMutateNonRoot) + + actTqId, err := newTaskQueueIDWithPartition(defaultNamespaceId, defaultRootTqID, enumspb.TASK_QUEUE_TYPE_ACTIVITY, 0) + require.NoError(t, err) + actTqCfg := defaultTqmTestOpts(controller) + actTqCfg.tqId = actTqId + actTq := mustCreateTestTaskQueueManagerWithConfig(t, controller, actTqCfg) + err = actTq.MutateVersioningData(ctx, func(data *persistencespb.VersioningData) error { return nil }) + require.Error(t, err) + require.ErrorIs(t, err, errVersioningDataNoMutateNonRoot) +} diff --git a/service/matching/taskqueue.go b/service/matching/taskqueue.go index f5edc16ecb0..6de052f3af6 100644 --- a/service/matching/taskqueue.go +++ b/service/matching/taskqueue.go @@ -35,15 +35,18 @@ import ( "go.temporal.io/server/common/namespace" ) +// TODO: This file ought to be moved into common. Frontend is duplicating this name mangling scheme +// and if it ever changes, it's likely to break. + type ( // taskQueueID is the key that uniquely identifies a task queue taskQueueID struct { - qualifiedTaskQueueName + QualifiedTaskQueueName namespaceID namespace.ID taskType enumspb.TaskQueueType } - // qualifiedTaskQueueName refers to the fully qualified task queue name - qualifiedTaskQueueName struct { + // QualifiedTaskQueueName refers to the fully qualified task queue name + QualifiedTaskQueueName struct { name string // internal name of the tasks list baseName string // original name of the task queue as specified by user partition int // partitionID of task queue @@ -72,24 +75,37 @@ const ( // // Returns error if the given name is non-compliant with the required format // for task queue names -func newTaskQueueName(name string) (qualifiedTaskQueueName, error) { - tn := qualifiedTaskQueueName{ +func newTaskQueueName(name string) (QualifiedTaskQueueName, error) { + tn := QualifiedTaskQueueName{ name: name, baseName: name, } if err := tn.init(); err != nil { - return qualifiedTaskQueueName{}, err + return QualifiedTaskQueueName{}, err } return tn, nil } +// NewTaskQueueNameWithPartition can be used to create root and non-root taskqueue names easily without needing to +// manually craft the correct string. See newTaskQueueName for more details. +func NewTaskQueueNameWithPartition(baseName string, partition int) (QualifiedTaskQueueName, error) { + tqName, err := newTaskQueueName(baseName) + if partition == 0 { + return tqName, err + } + partName := tqName.mkName(partition) + tqName.partition = partition + tqName.name = partName + return tqName, err +} + // IsRoot returns true if this task queue is a root partition -func (tn *qualifiedTaskQueueName) IsRoot() bool { +func (tn *QualifiedTaskQueueName) IsRoot() bool { return tn.partition == 0 } // GetRoot returns the root name for a task queue -func (tn *qualifiedTaskQueueName) GetRoot() string { +func (tn *QualifiedTaskQueueName) GetRoot() string { return tn.baseName } @@ -97,7 +113,7 @@ func (tn *qualifiedTaskQueueName) GetRoot() string { // input: // degree: Number of children at each level of the tree // Returns empty string if this task queue is the root -func (tn *qualifiedTaskQueueName) Parent(degree int) string { +func (tn *QualifiedTaskQueueName) Parent(degree int) string { if tn.IsRoot() || degree == 0 { return "" } @@ -105,14 +121,14 @@ func (tn *qualifiedTaskQueueName) Parent(degree int) string { return tn.mkName(pid) } -func (tn *qualifiedTaskQueueName) mkName(partition int) string { +func (tn *QualifiedTaskQueueName) mkName(partition int) string { if partition == 0 { return tn.baseName } return fmt.Sprintf("%v%v/%v", taskQueuePartitionPrefix, tn.baseName, partition) } -func (tn *qualifiedTaskQueueName) init() error { +func (tn *QualifiedTaskQueueName) init() error { if !strings.HasPrefix(tn.name, taskQueuePartitionPrefix) { return nil } @@ -132,14 +148,24 @@ func (tn *qualifiedTaskQueueName) init() error { return nil } +func (tn *QualifiedTaskQueueName) String() string { + return tn.mkName(tn.partition) +} + // newTaskQueueID returns taskQueueID which uniquely identfies as task queue func newTaskQueueID(namespaceID namespace.ID, taskQueueName string, taskType enumspb.TaskQueueType) (*taskQueueID, error) { - name, err := newTaskQueueName(taskQueueName) + return newTaskQueueIDWithPartition(namespaceID, taskQueueName, taskType, 0) +} + +func newTaskQueueIDWithPartition( + namespaceID namespace.ID, taskQueueName string, taskType enumspb.TaskQueueType, partition int, +) (*taskQueueID, error) { + name, err := NewTaskQueueNameWithPartition(taskQueueName, partition) if err != nil { return nil, err } return &taskQueueID{ - qualifiedTaskQueueName: name, + QualifiedTaskQueueName: name, namespaceID: namespaceID, taskType: taskType, }, nil diff --git a/service/matching/taskqueue_test.go b/service/matching/taskqueue_test.go index c81a182a5e9..075b74d1a30 100644 --- a/service/matching/taskqueue_test.go +++ b/service/matching/taskqueue_test.go @@ -119,3 +119,23 @@ func TestInvalidTaskqueueNames(t *testing.T) { }) } } + +func TestTaskQueueCreateNameWIthPartition(t *testing.T) { + testCases := []struct { + name string + part int + output string + }{ + {"foo", 0, "foo"}, + {"foo", 1, "/_sys/foo/1"}, + {"foo", 2, "/_sys/foo/2"}, + } + + for _, tc := range testCases { + t.Run(tc.name+"#"+strconv.Itoa(tc.part), func(t *testing.T) { + tn, err := NewTaskQueueNameWithPartition(tc.name, tc.part) + require.NoError(t, err) + require.Equal(t, tc.output, tn.name) + }) + } +} diff --git a/service/matching/version_graph.go b/service/matching/version_graph.go index b47e5a02080..4ee1d929ca3 100644 --- a/service/matching/version_graph.go +++ b/service/matching/version_graph.go @@ -25,8 +25,11 @@ package matching import ( + "encoding/binary" "fmt" + "github.com/dgryski/go-farm" + "github.com/gogo/protobuf/proto" "go.temporal.io/api/serviceerror" taskqueuepb "go.temporal.io/api/taskqueue/v1" @@ -38,6 +41,21 @@ func ToBuildIdOrderingResponse(g *persistence.VersioningData, maxDepth int) *wor return depthLimiter(g, maxDepth, true) } +// HashVersioningData returns a farm.Fingerprint64 hash of the versioning data as bytes. If the data is nonexistent or +// invalid, returns nil. +func HashVersioningData(data *persistence.VersioningData) []byte { + if data == nil || data.GetCurrentDefault() == nil { + return nil + } + asBytes, err := data.Marshal() + if err != nil { + return nil + } + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, farm.Fingerprint64(asBytes)) + return b +} + func depthLimiter(g *persistence.VersioningData, maxDepth int, noMutate bool) *workflowservice.GetWorkerBuildIdOrderingResponse { curDefault := g.GetCurrentDefault() compatLeaves := g.GetCompatibleLeaves()