diff --git a/api/ateapi/v1/ateapi.pb.go b/api/ateapi/v1/ateapi.pb.go index 00fe41c471..39c411118e 100644 --- a/api/ateapi/v1/ateapi.pb.go +++ b/api/ateapi/v1/ateapi.pb.go @@ -5104,7 +5104,11 @@ type SuspendActorRequest struct { // options controls how SuspendActor persists the actor's snapshot. // // +k8s:optional - Options *SuspendOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` + Options *SuspendOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` + // Act only if the actor still matches these guards. + // + // +k8s:optional + Preconditions *Preconditions `protobuf:"bytes,3,opt,name=preconditions,proto3" json:"preconditions,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -5153,6 +5157,13 @@ func (x *SuspendActorRequest) GetOptions() *SuspendOptions { return nil } +func (x *SuspendActorRequest) GetPreconditions() *Preconditions { + if x != nil { + return x.Preconditions + } + return nil +} + type SuspendActorResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Actor *Actor `protobuf:"bytes,1,opt,name=actor,proto3" json:"actor,omitempty"` @@ -5252,7 +5263,11 @@ type ResumeActorRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // +k8s:required // +k8s:subfield(atespace)=+k8s:required - Actor *ObjectRef `protobuf:"bytes,1,opt,name=actor,proto3" json:"actor,omitempty"` + Actor *ObjectRef `protobuf:"bytes,1,opt,name=actor,proto3" json:"actor,omitempty"` + // Act only if the actor still matches these guards. + // + // +k8s:optional + Preconditions *Preconditions `protobuf:"bytes,2,opt,name=preconditions,proto3" json:"preconditions,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -5294,6 +5309,13 @@ func (x *ResumeActorRequest) GetActor() *ObjectRef { return nil } +func (x *ResumeActorRequest) GetPreconditions() *Preconditions { + if x != nil { + return x.Preconditions + } + return nil +} + type ResumeActorResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Actor *Actor `protobuf:"bytes,1,opt,name=actor,proto3" json:"actor,omitempty"` @@ -5354,7 +5376,11 @@ type RevertActorRequest struct { // actor to revert. // +k8s:required // +k8s:subfield(atespace)=+k8s:required - Actor *ObjectRef `protobuf:"bytes,1,opt,name=actor,proto3" json:"actor,omitempty"` + Actor *ObjectRef `protobuf:"bytes,1,opt,name=actor,proto3" json:"actor,omitempty"` + // Act only if the actor still matches these guards. + // + // +k8s:optional + Preconditions *Preconditions `protobuf:"bytes,2,opt,name=preconditions,proto3" json:"preconditions,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -5396,6 +5422,13 @@ func (x *RevertActorRequest) GetActor() *ObjectRef { return nil } +func (x *RevertActorRequest) GetPreconditions() *Preconditions { + if x != nil { + return x.Preconditions + } + return nil +} + // RevertActorResponse holds the reverted Actor. type RevertActorResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -6308,6 +6341,71 @@ func (x *DeleteOptions) GetUid() string { return "" } +// Preconditions are the optional guards a custom method request may carry. +// A guard that does not match the resource fails the request with `ABORTED`. +type Preconditions struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Act only if the resource is still at this version, that is, unchanged + // since the caller read it. Zero skips the check. + // + // +k8s:optional + // +k8s:minimum=1 + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // Act only if the resource still has this uid, that is, it is the one + // the caller read and not a later one created under the same name. Empty + // skips the check. + // + // +k8s:optional + // +k8s:format=k8s-uuid + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Preconditions) Reset() { + *x = Preconditions{} + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[84] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Preconditions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Preconditions) ProtoMessage() {} + +func (x *Preconditions) ProtoReflect() protoreflect.Message { + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[84] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Preconditions.ProtoReflect.Descriptor instead. +func (*Preconditions) Descriptor() ([]byte, []int) { + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{84} +} + +func (x *Preconditions) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *Preconditions) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + // ListOptions are the pagination controls a List request may carry. type ListOptions struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -6330,7 +6428,7 @@ type ListOptions struct { func (x *ListOptions) Reset() { *x = ListOptions{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[84] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6342,7 +6440,7 @@ func (x *ListOptions) String() string { func (*ListOptions) ProtoMessage() {} func (x *ListOptions) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[84] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[85] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6355,7 +6453,7 @@ func (x *ListOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use ListOptions.ProtoReflect.Descriptor instead. func (*ListOptions) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{84} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{85} } func (x *ListOptions) GetPageSize() int32 { @@ -6391,7 +6489,7 @@ type ListWorkerActorAssignmentsRequest struct { func (x *ListWorkerActorAssignmentsRequest) Reset() { *x = ListWorkerActorAssignmentsRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[85] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6403,7 +6501,7 @@ func (x *ListWorkerActorAssignmentsRequest) String() string { func (*ListWorkerActorAssignmentsRequest) ProtoMessage() {} func (x *ListWorkerActorAssignmentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[85] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[86] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6416,7 +6514,7 @@ func (x *ListWorkerActorAssignmentsRequest) ProtoReflect() protoreflect.Message // Deprecated: Use ListWorkerActorAssignmentsRequest.ProtoReflect.Descriptor instead. func (*ListWorkerActorAssignmentsRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{85} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{86} } func (x *ListWorkerActorAssignmentsRequest) GetWorker() *ObjectRef { @@ -6446,7 +6544,7 @@ type ListWorkerActorAssignmentsResponse struct { func (x *ListWorkerActorAssignmentsResponse) Reset() { *x = ListWorkerActorAssignmentsResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[86] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6458,7 +6556,7 @@ func (x *ListWorkerActorAssignmentsResponse) String() string { func (*ListWorkerActorAssignmentsResponse) ProtoMessage() {} func (x *ListWorkerActorAssignmentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[86] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[87] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6471,7 +6569,7 @@ func (x *ListWorkerActorAssignmentsResponse) ProtoReflect() protoreflect.Message // Deprecated: Use ListWorkerActorAssignmentsResponse.ProtoReflect.Descriptor instead. func (*ListWorkerActorAssignmentsResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{86} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{87} } func (x *ListWorkerActorAssignmentsResponse) GetActorAssignments() []*ActorAssignment { @@ -6500,7 +6598,7 @@ type ListWorkersRequest struct { func (x *ListWorkersRequest) Reset() { *x = ListWorkersRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[87] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6512,7 +6610,7 @@ func (x *ListWorkersRequest) String() string { func (*ListWorkersRequest) ProtoMessage() {} func (x *ListWorkersRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[87] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[88] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6525,7 +6623,7 @@ func (x *ListWorkersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkersRequest.ProtoReflect.Descriptor instead. func (*ListWorkersRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{87} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{88} } func (x *ListWorkersRequest) GetOptions() *ListOptions { @@ -6547,7 +6645,7 @@ type ListWorkersResponse struct { func (x *ListWorkersResponse) Reset() { *x = ListWorkersResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[88] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6559,7 +6657,7 @@ func (x *ListWorkersResponse) String() string { func (*ListWorkersResponse) ProtoMessage() {} func (x *ListWorkersResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[88] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[89] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6572,7 +6670,7 @@ func (x *ListWorkersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkersResponse.ProtoReflect.Descriptor instead. func (*ListWorkersResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{88} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{89} } func (x *ListWorkersResponse) GetWorkers() []*Worker { @@ -6602,7 +6700,7 @@ type GetWorkerRequest struct { func (x *GetWorkerRequest) Reset() { *x = GetWorkerRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[89] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6614,7 +6712,7 @@ func (x *GetWorkerRequest) String() string { func (*GetWorkerRequest) ProtoMessage() {} func (x *GetWorkerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[89] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[90] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6627,7 +6725,7 @@ func (x *GetWorkerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWorkerRequest.ProtoReflect.Descriptor instead. func (*GetWorkerRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{89} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{90} } func (x *GetWorkerRequest) GetWorker() *ObjectRef { @@ -6649,7 +6747,7 @@ type CreateWorkerRequest struct { func (x *CreateWorkerRequest) Reset() { *x = CreateWorkerRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[90] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6661,7 +6759,7 @@ func (x *CreateWorkerRequest) String() string { func (*CreateWorkerRequest) ProtoMessage() {} func (x *CreateWorkerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[90] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[91] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6674,7 +6772,7 @@ func (x *CreateWorkerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWorkerRequest.ProtoReflect.Descriptor instead. func (*CreateWorkerRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{90} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{91} } func (x *CreateWorkerRequest) GetWorker() *Worker { @@ -6709,7 +6807,7 @@ type UpdateWorkerRequest struct { func (x *UpdateWorkerRequest) Reset() { *x = UpdateWorkerRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[91] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[92] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6721,7 +6819,7 @@ func (x *UpdateWorkerRequest) String() string { func (*UpdateWorkerRequest) ProtoMessage() {} func (x *UpdateWorkerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[91] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[92] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6734,7 +6832,7 @@ func (x *UpdateWorkerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateWorkerRequest.ProtoReflect.Descriptor instead. func (*UpdateWorkerRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{91} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{92} } func (x *UpdateWorkerRequest) GetWorker() *Worker { @@ -6761,7 +6859,7 @@ type DeleteWorkerRequest struct { func (x *DeleteWorkerRequest) Reset() { *x = DeleteWorkerRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[92] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6773,7 +6871,7 @@ func (x *DeleteWorkerRequest) String() string { func (*DeleteWorkerRequest) ProtoMessage() {} func (x *DeleteWorkerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[92] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[93] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6786,7 +6884,7 @@ func (x *DeleteWorkerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteWorkerRequest.ProtoReflect.Descriptor instead. func (*DeleteWorkerRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{92} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{93} } func (x *DeleteWorkerRequest) GetWorker() *ObjectRef { @@ -6809,14 +6907,18 @@ type DrainWorkerRequest struct { // // +k8s:required // +k8s:beta(since: "0.0")=+k8s:subfield(atespace)=+k8s:forbidden # TODO: get rid of beta prefix - Worker *ObjectRef `protobuf:"bytes,1,opt,name=worker,proto3" json:"worker,omitempty"` + Worker *ObjectRef `protobuf:"bytes,1,opt,name=worker,proto3" json:"worker,omitempty"` + // Act only if the Worker still matches these guards. + // + // +k8s:optional + Preconditions *Preconditions `protobuf:"bytes,2,opt,name=preconditions,proto3" json:"preconditions,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *DrainWorkerRequest) Reset() { *x = DrainWorkerRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[93] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6828,7 +6930,7 @@ func (x *DrainWorkerRequest) String() string { func (*DrainWorkerRequest) ProtoMessage() {} func (x *DrainWorkerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[93] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[94] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6841,7 +6943,7 @@ func (x *DrainWorkerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DrainWorkerRequest.ProtoReflect.Descriptor instead. func (*DrainWorkerRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{93} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{94} } func (x *DrainWorkerRequest) GetWorker() *ObjectRef { @@ -6851,6 +6953,13 @@ func (x *DrainWorkerRequest) GetWorker() *ObjectRef { return nil } +func (x *DrainWorkerRequest) GetPreconditions() *Preconditions { + if x != nil { + return x.Preconditions + } + return nil +} + // DrainWorkerResponse holds the drained Worker. type DrainWorkerResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -6862,7 +6971,7 @@ type DrainWorkerResponse struct { func (x *DrainWorkerResponse) Reset() { *x = DrainWorkerResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[94] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[95] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6874,7 +6983,7 @@ func (x *DrainWorkerResponse) String() string { func (*DrainWorkerResponse) ProtoMessage() {} func (x *DrainWorkerResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[94] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[95] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6887,7 +6996,7 @@ func (x *DrainWorkerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DrainWorkerResponse.ProtoReflect.Descriptor instead. func (*DrainWorkerResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{94} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{95} } func (x *DrainWorkerResponse) GetWorker() *Worker { @@ -6904,14 +7013,18 @@ type MarkWorkerAvailableRequest struct { // // +k8s:required // +k8s:beta(since: "0.0")=+k8s:subfield(atespace)=+k8s:forbidden # TODO: get rid of beta prefix - Worker *ObjectRef `protobuf:"bytes,1,opt,name=worker,proto3" json:"worker,omitempty"` + Worker *ObjectRef `protobuf:"bytes,1,opt,name=worker,proto3" json:"worker,omitempty"` + // Act only if the Worker still matches these guards. + // + // +k8s:optional + Preconditions *Preconditions `protobuf:"bytes,2,opt,name=preconditions,proto3" json:"preconditions,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *MarkWorkerAvailableRequest) Reset() { *x = MarkWorkerAvailableRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[95] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[96] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6923,7 +7036,7 @@ func (x *MarkWorkerAvailableRequest) String() string { func (*MarkWorkerAvailableRequest) ProtoMessage() {} func (x *MarkWorkerAvailableRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[95] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[96] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6936,7 +7049,7 @@ func (x *MarkWorkerAvailableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkWorkerAvailableRequest.ProtoReflect.Descriptor instead. func (*MarkWorkerAvailableRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{95} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{96} } func (x *MarkWorkerAvailableRequest) GetWorker() *ObjectRef { @@ -6946,6 +7059,13 @@ func (x *MarkWorkerAvailableRequest) GetWorker() *ObjectRef { return nil } +func (x *MarkWorkerAvailableRequest) GetPreconditions() *Preconditions { + if x != nil { + return x.Preconditions + } + return nil +} + // MarkWorkerAvailableResponse holds the Worker marked ACTIVE. type MarkWorkerAvailableResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -6957,7 +7077,7 @@ type MarkWorkerAvailableResponse struct { func (x *MarkWorkerAvailableResponse) Reset() { *x = MarkWorkerAvailableResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[96] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[97] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6969,7 +7089,7 @@ func (x *MarkWorkerAvailableResponse) String() string { func (*MarkWorkerAvailableResponse) ProtoMessage() {} func (x *MarkWorkerAvailableResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[96] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[97] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6982,7 +7102,7 @@ func (x *MarkWorkerAvailableResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkWorkerAvailableResponse.ProtoReflect.Descriptor instead. func (*MarkWorkerAvailableResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{96} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{97} } func (x *MarkWorkerAvailableResponse) GetWorker() *Worker { @@ -6999,14 +7119,18 @@ type MarkWorkerUnavailableRequest struct { // // +k8s:required // +k8s:beta(since: "0.0")=+k8s:subfield(atespace)=+k8s:forbidden # TODO: get rid of beta prefix - Worker *ObjectRef `protobuf:"bytes,1,opt,name=worker,proto3" json:"worker,omitempty"` + Worker *ObjectRef `protobuf:"bytes,1,opt,name=worker,proto3" json:"worker,omitempty"` + // Act only if the Worker still matches these guards. + // + // +k8s:optional + Preconditions *Preconditions `protobuf:"bytes,2,opt,name=preconditions,proto3" json:"preconditions,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *MarkWorkerUnavailableRequest) Reset() { *x = MarkWorkerUnavailableRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[97] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[98] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7018,7 +7142,7 @@ func (x *MarkWorkerUnavailableRequest) String() string { func (*MarkWorkerUnavailableRequest) ProtoMessage() {} func (x *MarkWorkerUnavailableRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[97] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[98] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7031,7 +7155,7 @@ func (x *MarkWorkerUnavailableRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkWorkerUnavailableRequest.ProtoReflect.Descriptor instead. func (*MarkWorkerUnavailableRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{97} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{98} } func (x *MarkWorkerUnavailableRequest) GetWorker() *ObjectRef { @@ -7041,6 +7165,13 @@ func (x *MarkWorkerUnavailableRequest) GetWorker() *ObjectRef { return nil } +func (x *MarkWorkerUnavailableRequest) GetPreconditions() *Preconditions { + if x != nil { + return x.Preconditions + } + return nil +} + // MarkWorkerUnavailableResponse holds the Worker marked UNAVAILABLE. type MarkWorkerUnavailableResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -7052,7 +7183,7 @@ type MarkWorkerUnavailableResponse struct { func (x *MarkWorkerUnavailableResponse) Reset() { *x = MarkWorkerUnavailableResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[98] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[99] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7064,7 +7195,7 @@ func (x *MarkWorkerUnavailableResponse) String() string { func (*MarkWorkerUnavailableResponse) ProtoMessage() {} func (x *MarkWorkerUnavailableResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[98] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[99] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7077,7 +7208,7 @@ func (x *MarkWorkerUnavailableResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkWorkerUnavailableResponse.ProtoReflect.Descriptor instead. func (*MarkWorkerUnavailableResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{98} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{99} } func (x *MarkWorkerUnavailableResponse) GetWorker() *Worker { @@ -7106,7 +7237,7 @@ type ListActorsRequest struct { func (x *ListActorsRequest) Reset() { *x = ListActorsRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[99] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[100] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7118,7 +7249,7 @@ func (x *ListActorsRequest) String() string { func (*ListActorsRequest) ProtoMessage() {} func (x *ListActorsRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[99] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[100] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7131,7 +7262,7 @@ func (x *ListActorsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListActorsRequest.ProtoReflect.Descriptor instead. func (*ListActorsRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{99} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{100} } func (x *ListActorsRequest) GetAtespace() string { @@ -7160,7 +7291,7 @@ type ListActorsResponse struct { func (x *ListActorsResponse) Reset() { *x = ListActorsResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[100] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[101] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7172,7 +7303,7 @@ func (x *ListActorsResponse) String() string { func (*ListActorsResponse) ProtoMessage() {} func (x *ListActorsResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[100] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[101] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7185,7 +7316,7 @@ func (x *ListActorsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListActorsResponse.ProtoReflect.Descriptor instead. func (*ListActorsResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{100} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{101} } func (x *ListActorsResponse) GetActors() []*Actor { @@ -7273,7 +7404,7 @@ type Worker struct { func (x *Worker) Reset() { *x = Worker{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[101] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[102] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7285,7 +7416,7 @@ func (x *Worker) String() string { func (*Worker) ProtoMessage() {} func (x *Worker) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[101] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[102] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7298,7 +7429,7 @@ func (x *Worker) ProtoReflect() protoreflect.Message { // Deprecated: Use Worker.ProtoReflect.Descriptor instead. func (*Worker) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{101} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{102} } func (x *Worker) GetMetadata() *ResourceMetadata { @@ -7440,7 +7571,7 @@ type WorkerStatus struct { func (x *WorkerStatus) Reset() { *x = WorkerStatus{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[102] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[103] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7452,7 +7583,7 @@ func (x *WorkerStatus) String() string { func (*WorkerStatus) ProtoMessage() {} func (x *WorkerStatus) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[102] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[103] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7465,7 +7596,7 @@ func (x *WorkerStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkerStatus.ProtoReflect.Descriptor instead. func (*WorkerStatus) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{102} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{103} } func (x *WorkerStatus) GetState() WorkerState { @@ -7553,7 +7684,7 @@ type WorkerSandboxClass struct { func (x *WorkerSandboxClass) Reset() { *x = WorkerSandboxClass{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[103] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7565,7 +7696,7 @@ func (x *WorkerSandboxClass) String() string { func (*WorkerSandboxClass) ProtoMessage() {} func (x *WorkerSandboxClass) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[103] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[104] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7578,7 +7709,7 @@ func (x *WorkerSandboxClass) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkerSandboxClass.ProtoReflect.Descriptor instead. func (*WorkerSandboxClass) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{103} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{104} } func (x *WorkerSandboxClass) GetSandboxClass() string { @@ -7630,7 +7761,7 @@ type WorkerSandboxRuntime struct { func (x *WorkerSandboxRuntime) Reset() { *x = WorkerSandboxRuntime{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[104] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[105] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7642,7 +7773,7 @@ func (x *WorkerSandboxRuntime) String() string { func (*WorkerSandboxRuntime) ProtoMessage() {} func (x *WorkerSandboxRuntime) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[104] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[105] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7655,7 +7786,7 @@ func (x *WorkerSandboxRuntime) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkerSandboxRuntime.ProtoReflect.Descriptor instead. func (*WorkerSandboxRuntime) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{104} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{105} } func (x *WorkerSandboxRuntime) GetVersion() *VersionedSandboxCompat { @@ -7696,7 +7827,7 @@ type RuntimeOverhead struct { func (x *RuntimeOverhead) Reset() { *x = RuntimeOverhead{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[105] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[106] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7708,7 +7839,7 @@ func (x *RuntimeOverhead) String() string { func (*RuntimeOverhead) ProtoMessage() {} func (x *RuntimeOverhead) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[105] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[106] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7721,7 +7852,7 @@ func (x *RuntimeOverhead) ProtoReflect() protoreflect.Message { // Deprecated: Use RuntimeOverhead.ProtoReflect.Descriptor instead. func (*RuntimeOverhead) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{105} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{106} } func (x *RuntimeOverhead) GetMemoryBytes() int64 { @@ -7760,7 +7891,7 @@ type ActorSandboxRuntime struct { func (x *ActorSandboxRuntime) Reset() { *x = ActorSandboxRuntime{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[106] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7772,7 +7903,7 @@ func (x *ActorSandboxRuntime) String() string { func (*ActorSandboxRuntime) ProtoMessage() {} func (x *ActorSandboxRuntime) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[106] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[107] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7785,7 +7916,7 @@ func (x *ActorSandboxRuntime) ProtoReflect() protoreflect.Message { // Deprecated: Use ActorSandboxRuntime.ProtoReflect.Descriptor instead. func (*ActorSandboxRuntime) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{106} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{107} } func (x *ActorSandboxRuntime) GetSandboxClass() string { @@ -7836,7 +7967,7 @@ type VersionedSandboxCompat struct { func (x *VersionedSandboxCompat) Reset() { *x = VersionedSandboxCompat{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[107] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[108] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7848,7 +7979,7 @@ func (x *VersionedSandboxCompat) String() string { func (*VersionedSandboxCompat) ProtoMessage() {} func (x *VersionedSandboxCompat) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[107] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[108] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7861,7 +7992,7 @@ func (x *VersionedSandboxCompat) ProtoReflect() protoreflect.Message { // Deprecated: Use VersionedSandboxCompat.ProtoReflect.Descriptor instead. func (*VersionedSandboxCompat) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{107} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{108} } func (x *VersionedSandboxCompat) GetSchemaVersion() string { @@ -7897,7 +8028,7 @@ type AttributeEntry struct { func (x *AttributeEntry) Reset() { *x = AttributeEntry{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[108] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[109] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7909,7 +8040,7 @@ func (x *AttributeEntry) String() string { func (*AttributeEntry) ProtoMessage() {} func (x *AttributeEntry) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[108] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[109] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7922,7 +8053,7 @@ func (x *AttributeEntry) ProtoReflect() protoreflect.Message { // Deprecated: Use AttributeEntry.ProtoReflect.Descriptor instead. func (*AttributeEntry) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{108} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{109} } func (x *AttributeEntry) GetKey() string { @@ -7969,7 +8100,7 @@ type WorkerResources struct { func (x *WorkerResources) Reset() { *x = WorkerResources{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[109] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[110] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7981,7 +8112,7 @@ func (x *WorkerResources) String() string { func (*WorkerResources) ProtoMessage() {} func (x *WorkerResources) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[109] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[110] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7994,7 +8125,7 @@ func (x *WorkerResources) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkerResources.ProtoReflect.Descriptor instead. func (*WorkerResources) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{109} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{110} } func (x *WorkerResources) GetCpuMillicores() int64 { @@ -8050,7 +8181,7 @@ type ActorAssignment struct { func (x *ActorAssignment) Reset() { *x = ActorAssignment{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[110] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[111] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8062,7 +8193,7 @@ func (x *ActorAssignment) String() string { func (*ActorAssignment) ProtoMessage() {} func (x *ActorAssignment) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[110] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[111] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8075,7 +8206,7 @@ func (x *ActorAssignment) ProtoReflect() protoreflect.Message { // Deprecated: Use ActorAssignment.ProtoReflect.Descriptor instead. func (*ActorAssignment) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{110} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{111} } func (x *ActorAssignment) GetMetadata() *ResourceMetadata { @@ -8120,7 +8251,7 @@ type AcquireWorkerEpochRequest struct { func (x *AcquireWorkerEpochRequest) Reset() { *x = AcquireWorkerEpochRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[111] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[112] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8132,7 +8263,7 @@ func (x *AcquireWorkerEpochRequest) String() string { func (*AcquireWorkerEpochRequest) ProtoMessage() {} func (x *AcquireWorkerEpochRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[111] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[112] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8145,7 +8276,7 @@ func (x *AcquireWorkerEpochRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AcquireWorkerEpochRequest.ProtoReflect.Descriptor instead. func (*AcquireWorkerEpochRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{111} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{112} } func (x *AcquireWorkerEpochRequest) GetWorker() *ObjectRef { @@ -8165,7 +8296,7 @@ type AcquireWorkerEpochResponse struct { func (x *AcquireWorkerEpochResponse) Reset() { *x = AcquireWorkerEpochResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[112] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[113] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8177,7 +8308,7 @@ func (x *AcquireWorkerEpochResponse) String() string { func (*AcquireWorkerEpochResponse) ProtoMessage() {} func (x *AcquireWorkerEpochResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[112] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[113] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8190,7 +8321,7 @@ func (x *AcquireWorkerEpochResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AcquireWorkerEpochResponse.ProtoReflect.Descriptor instead. func (*AcquireWorkerEpochResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{112} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{113} } func (x *AcquireWorkerEpochResponse) GetEpoch() int64 { @@ -8233,7 +8364,7 @@ type RegisterWorkerRequest struct { func (x *RegisterWorkerRequest) Reset() { *x = RegisterWorkerRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[113] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[114] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8245,7 +8376,7 @@ func (x *RegisterWorkerRequest) String() string { func (*RegisterWorkerRequest) ProtoMessage() {} func (x *RegisterWorkerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[113] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[114] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8258,7 +8389,7 @@ func (x *RegisterWorkerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterWorkerRequest.ProtoReflect.Descriptor instead. func (*RegisterWorkerRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{113} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{114} } func (x *RegisterWorkerRequest) GetWorker() *ObjectRef { @@ -8299,7 +8430,7 @@ type RegisterWorkerResponse struct { func (x *RegisterWorkerResponse) Reset() { *x = RegisterWorkerResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[114] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[115] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8311,7 +8442,7 @@ func (x *RegisterWorkerResponse) String() string { func (*RegisterWorkerResponse) ProtoMessage() {} func (x *RegisterWorkerResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[114] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[115] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8324,7 +8455,7 @@ func (x *RegisterWorkerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterWorkerResponse.ProtoReflect.Descriptor instead. func (*RegisterWorkerResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{114} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{115} } func (x *RegisterWorkerResponse) GetWorker() *Worker { @@ -8364,7 +8495,7 @@ type SetWorkerSandboxRuntimesRequest struct { func (x *SetWorkerSandboxRuntimesRequest) Reset() { *x = SetWorkerSandboxRuntimesRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[115] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[116] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8376,7 +8507,7 @@ func (x *SetWorkerSandboxRuntimesRequest) String() string { func (*SetWorkerSandboxRuntimesRequest) ProtoMessage() {} func (x *SetWorkerSandboxRuntimesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[115] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[116] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8389,7 +8520,7 @@ func (x *SetWorkerSandboxRuntimesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetWorkerSandboxRuntimesRequest.ProtoReflect.Descriptor instead. func (*SetWorkerSandboxRuntimesRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{115} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{116} } func (x *SetWorkerSandboxRuntimesRequest) GetWorker() *ObjectRef { @@ -8423,7 +8554,7 @@ type SetWorkerSandboxRuntimesResponse struct { func (x *SetWorkerSandboxRuntimesResponse) Reset() { *x = SetWorkerSandboxRuntimesResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[116] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[117] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8435,7 +8566,7 @@ func (x *SetWorkerSandboxRuntimesResponse) String() string { func (*SetWorkerSandboxRuntimesResponse) ProtoMessage() {} func (x *SetWorkerSandboxRuntimesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[116] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[117] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8448,7 +8579,7 @@ func (x *SetWorkerSandboxRuntimesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetWorkerSandboxRuntimesResponse.ProtoReflect.Descriptor instead. func (*SetWorkerSandboxRuntimesResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{116} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{117} } func (x *SetWorkerSandboxRuntimesResponse) GetWorker() *Worker { @@ -8495,7 +8626,7 @@ type MintWorkerActorCertificateRequest struct { func (x *MintWorkerActorCertificateRequest) Reset() { *x = MintWorkerActorCertificateRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[117] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[118] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8507,7 +8638,7 @@ func (x *MintWorkerActorCertificateRequest) String() string { func (*MintWorkerActorCertificateRequest) ProtoMessage() {} func (x *MintWorkerActorCertificateRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[117] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[118] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8520,7 +8651,7 @@ func (x *MintWorkerActorCertificateRequest) ProtoReflect() protoreflect.Message // Deprecated: Use MintWorkerActorCertificateRequest.ProtoReflect.Descriptor instead. func (*MintWorkerActorCertificateRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{117} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{118} } func (x *MintWorkerActorCertificateRequest) GetActor() *ObjectRef { @@ -8564,7 +8695,7 @@ type MintWorkerActorCertificateResponse struct { func (x *MintWorkerActorCertificateResponse) Reset() { *x = MintWorkerActorCertificateResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[118] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[119] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8576,7 +8707,7 @@ func (x *MintWorkerActorCertificateResponse) String() string { func (*MintWorkerActorCertificateResponse) ProtoMessage() {} func (x *MintWorkerActorCertificateResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[118] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[119] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8589,7 +8720,7 @@ func (x *MintWorkerActorCertificateResponse) ProtoReflect() protoreflect.Message // Deprecated: Use MintWorkerActorCertificateResponse.ProtoReflect.Descriptor instead. func (*MintWorkerActorCertificateResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{118} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{119} } func (x *MintWorkerActorCertificateResponse) GetActorCertificates() [][]byte { @@ -8630,7 +8761,7 @@ type MintWorkerActorJwtRequest struct { func (x *MintWorkerActorJwtRequest) Reset() { *x = MintWorkerActorJwtRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[119] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[120] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8642,7 +8773,7 @@ func (x *MintWorkerActorJwtRequest) String() string { func (*MintWorkerActorJwtRequest) ProtoMessage() {} func (x *MintWorkerActorJwtRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[119] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[120] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8655,7 +8786,7 @@ func (x *MintWorkerActorJwtRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MintWorkerActorJwtRequest.ProtoReflect.Descriptor instead. func (*MintWorkerActorJwtRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{119} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{120} } func (x *MintWorkerActorJwtRequest) GetActor() *ObjectRef { @@ -8703,7 +8834,7 @@ type MintWorkerActorJwtResponse struct { func (x *MintWorkerActorJwtResponse) Reset() { *x = MintWorkerActorJwtResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[120] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[121] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8715,7 +8846,7 @@ func (x *MintWorkerActorJwtResponse) String() string { func (*MintWorkerActorJwtResponse) ProtoMessage() {} func (x *MintWorkerActorJwtResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[120] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[121] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8728,7 +8859,7 @@ func (x *MintWorkerActorJwtResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MintWorkerActorJwtResponse.ProtoReflect.Descriptor instead. func (*MintWorkerActorJwtResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{120} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{121} } func (x *MintWorkerActorJwtResponse) GetActorJwt() string { @@ -8779,7 +8910,7 @@ type RequestActorSuspendRequest struct { func (x *RequestActorSuspendRequest) Reset() { *x = RequestActorSuspendRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[121] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[122] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8791,7 +8922,7 @@ func (x *RequestActorSuspendRequest) String() string { func (*RequestActorSuspendRequest) ProtoMessage() {} func (x *RequestActorSuspendRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[121] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[122] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8804,7 +8935,7 @@ func (x *RequestActorSuspendRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestActorSuspendRequest.ProtoReflect.Descriptor instead. func (*RequestActorSuspendRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{121} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{122} } func (x *RequestActorSuspendRequest) GetWorker() *ObjectRef { @@ -8838,7 +8969,7 @@ type RequestActorSuspendResponse struct { func (x *RequestActorSuspendResponse) Reset() { *x = RequestActorSuspendResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[122] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[123] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8850,7 +8981,7 @@ func (x *RequestActorSuspendResponse) String() string { func (*RequestActorSuspendResponse) ProtoMessage() {} func (x *RequestActorSuspendResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[122] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[123] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8863,7 +8994,7 @@ func (x *RequestActorSuspendResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestActorSuspendResponse.ProtoReflect.Descriptor instead. func (*RequestActorSuspendResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{122} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{123} } func (x *RequestActorSuspendResponse) GetActor() *Actor { @@ -8903,7 +9034,7 @@ type ReportActorCrashedRequest struct { func (x *ReportActorCrashedRequest) Reset() { *x = ReportActorCrashedRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[123] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[124] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8915,7 +9046,7 @@ func (x *ReportActorCrashedRequest) String() string { func (*ReportActorCrashedRequest) ProtoMessage() {} func (x *ReportActorCrashedRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[123] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[124] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8928,7 +9059,7 @@ func (x *ReportActorCrashedRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportActorCrashedRequest.ProtoReflect.Descriptor instead. func (*ReportActorCrashedRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{123} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{124} } func (x *ReportActorCrashedRequest) GetWorker() *ObjectRef { @@ -8969,7 +9100,7 @@ type ReportActorCrashedResponse struct { func (x *ReportActorCrashedResponse) Reset() { *x = ReportActorCrashedResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[124] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[125] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8981,7 +9112,7 @@ func (x *ReportActorCrashedResponse) String() string { func (*ReportActorCrashedResponse) ProtoMessage() {} func (x *ReportActorCrashedResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[124] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[125] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8994,7 +9125,7 @@ func (x *ReportActorCrashedResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportActorCrashedResponse.ProtoReflect.Descriptor instead. func (*ReportActorCrashedResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{124} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{125} } func (x *ReportActorCrashedResponse) GetActor() *Actor { @@ -9025,7 +9156,7 @@ type ReportActorSnapshotStateRequest struct { func (x *ReportActorSnapshotStateRequest) Reset() { *x = ReportActorSnapshotStateRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[125] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[126] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9037,7 +9168,7 @@ func (x *ReportActorSnapshotStateRequest) String() string { func (*ReportActorSnapshotStateRequest) ProtoMessage() {} func (x *ReportActorSnapshotStateRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[125] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[126] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9050,7 +9181,7 @@ func (x *ReportActorSnapshotStateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportActorSnapshotStateRequest.ProtoReflect.Descriptor instead. func (*ReportActorSnapshotStateRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{125} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{126} } func (x *ReportActorSnapshotStateRequest) GetActor() *ObjectRef { @@ -9082,7 +9213,7 @@ type ReportActorSnapshotStateResponse struct { func (x *ReportActorSnapshotStateResponse) Reset() { *x = ReportActorSnapshotStateResponse{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[126] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[127] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9094,7 +9225,7 @@ func (x *ReportActorSnapshotStateResponse) String() string { func (*ReportActorSnapshotStateResponse) ProtoMessage() {} func (x *ReportActorSnapshotStateResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[126] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[127] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9107,7 +9238,7 @@ func (x *ReportActorSnapshotStateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportActorSnapshotStateResponse.ProtoReflect.Descriptor instead. func (*ReportActorSnapshotStateResponse) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{126} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{127} } // ActorSnapshotState is what atelet holds for one Actor on its node. It @@ -9141,7 +9272,7 @@ type ActorSnapshotState struct { func (x *ActorSnapshotState) Reset() { *x = ActorSnapshotState{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[127] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[128] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9153,7 +9284,7 @@ func (x *ActorSnapshotState) String() string { func (*ActorSnapshotState) ProtoMessage() {} func (x *ActorSnapshotState) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[127] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[128] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9166,7 +9297,7 @@ func (x *ActorSnapshotState) ProtoReflect() protoreflect.Message { // Deprecated: Use ActorSnapshotState.ProtoReflect.Descriptor instead. func (*ActorSnapshotState) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{127} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{128} } func (x *ActorSnapshotState) GetLatestLocal() *SnapshotReport { @@ -9238,7 +9369,7 @@ type SnapshotReport struct { func (x *SnapshotReport) Reset() { *x = SnapshotReport{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[128] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[129] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9250,7 +9381,7 @@ func (x *SnapshotReport) String() string { func (*SnapshotReport) ProtoMessage() {} func (x *SnapshotReport) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[128] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[129] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9263,7 +9394,7 @@ func (x *SnapshotReport) ProtoReflect() protoreflect.Message { // Deprecated: Use SnapshotReport.ProtoReflect.Descriptor instead. func (*SnapshotReport) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{128} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{129} } func (x *SnapshotReport) GetUuid() string { @@ -9333,7 +9464,7 @@ type AccessPolicy struct { func (x *AccessPolicy) Reset() { *x = AccessPolicy{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[129] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[130] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9345,7 +9476,7 @@ func (x *AccessPolicy) String() string { func (*AccessPolicy) ProtoMessage() {} func (x *AccessPolicy) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[129] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[130] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9358,7 +9489,7 @@ func (x *AccessPolicy) ProtoReflect() protoreflect.Message { // Deprecated: Use AccessPolicy.ProtoReflect.Descriptor instead. func (*AccessPolicy) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{129} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{130} } func (x *AccessPolicy) GetMetadata() *ResourceMetadata { @@ -9400,7 +9531,7 @@ type Binding struct { func (x *Binding) Reset() { *x = Binding{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[130] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[131] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9412,7 +9543,7 @@ func (x *Binding) String() string { func (*Binding) ProtoMessage() {} func (x *Binding) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[130] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[131] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9425,7 +9556,7 @@ func (x *Binding) ProtoReflect() protoreflect.Message { // Deprecated: Use Binding.ProtoReflect.Descriptor instead. func (*Binding) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{130} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{131} } func (x *Binding) GetRole() string { @@ -9457,7 +9588,7 @@ type GetGlobalAccessPolicyRequest struct { func (x *GetGlobalAccessPolicyRequest) Reset() { *x = GetGlobalAccessPolicyRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[131] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[132] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9469,7 +9600,7 @@ func (x *GetGlobalAccessPolicyRequest) String() string { func (*GetGlobalAccessPolicyRequest) ProtoMessage() {} func (x *GetGlobalAccessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[131] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[132] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9482,7 +9613,7 @@ func (x *GetGlobalAccessPolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGlobalAccessPolicyRequest.ProtoReflect.Descriptor instead. func (*GetGlobalAccessPolicyRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{131} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{132} } func (x *GetGlobalAccessPolicyRequest) GetName() string { @@ -9506,7 +9637,7 @@ type CreateGlobalAccessPolicyRequest struct { func (x *CreateGlobalAccessPolicyRequest) Reset() { *x = CreateGlobalAccessPolicyRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[132] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[133] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9518,7 +9649,7 @@ func (x *CreateGlobalAccessPolicyRequest) String() string { func (*CreateGlobalAccessPolicyRequest) ProtoMessage() {} func (x *CreateGlobalAccessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[132] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[133] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9531,7 +9662,7 @@ func (x *CreateGlobalAccessPolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateGlobalAccessPolicyRequest.ProtoReflect.Descriptor instead. func (*CreateGlobalAccessPolicyRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{132} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{133} } func (x *CreateGlobalAccessPolicyRequest) GetAccessPolicy() *AccessPolicy { @@ -9555,7 +9686,7 @@ type UpdateGlobalAccessPolicyRequest struct { func (x *UpdateGlobalAccessPolicyRequest) Reset() { *x = UpdateGlobalAccessPolicyRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[133] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[134] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9567,7 +9698,7 @@ func (x *UpdateGlobalAccessPolicyRequest) String() string { func (*UpdateGlobalAccessPolicyRequest) ProtoMessage() {} func (x *UpdateGlobalAccessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[133] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[134] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9580,7 +9711,7 @@ func (x *UpdateGlobalAccessPolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateGlobalAccessPolicyRequest.ProtoReflect.Descriptor instead. func (*UpdateGlobalAccessPolicyRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{133} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{134} } func (x *UpdateGlobalAccessPolicyRequest) GetAccessPolicy() *AccessPolicy { @@ -9610,7 +9741,7 @@ type GetAtespaceAccessPolicyRequest struct { func (x *GetAtespaceAccessPolicyRequest) Reset() { *x = GetAtespaceAccessPolicyRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[134] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[135] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9622,7 +9753,7 @@ func (x *GetAtespaceAccessPolicyRequest) String() string { func (*GetAtespaceAccessPolicyRequest) ProtoMessage() {} func (x *GetAtespaceAccessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[134] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[135] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9635,7 +9766,7 @@ func (x *GetAtespaceAccessPolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAtespaceAccessPolicyRequest.ProtoReflect.Descriptor instead. func (*GetAtespaceAccessPolicyRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{134} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{135} } func (x *GetAtespaceAccessPolicyRequest) GetAtespace() *ObjectRef { @@ -9671,7 +9802,7 @@ type CreateAtespaceAccessPolicyRequest struct { func (x *CreateAtespaceAccessPolicyRequest) Reset() { *x = CreateAtespaceAccessPolicyRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[135] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[136] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9683,7 +9814,7 @@ func (x *CreateAtespaceAccessPolicyRequest) String() string { func (*CreateAtespaceAccessPolicyRequest) ProtoMessage() {} func (x *CreateAtespaceAccessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[135] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[136] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9696,7 +9827,7 @@ func (x *CreateAtespaceAccessPolicyRequest) ProtoReflect() protoreflect.Message // Deprecated: Use CreateAtespaceAccessPolicyRequest.ProtoReflect.Descriptor instead. func (*CreateAtespaceAccessPolicyRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{135} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{136} } func (x *CreateAtespaceAccessPolicyRequest) GetAtespace() *ObjectRef { @@ -9732,7 +9863,7 @@ type UpdateAtespaceAccessPolicyRequest struct { func (x *UpdateAtespaceAccessPolicyRequest) Reset() { *x = UpdateAtespaceAccessPolicyRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[136] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[137] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9744,7 +9875,7 @@ func (x *UpdateAtespaceAccessPolicyRequest) String() string { func (*UpdateAtespaceAccessPolicyRequest) ProtoMessage() {} func (x *UpdateAtespaceAccessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[136] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[137] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9757,7 +9888,7 @@ func (x *UpdateAtespaceAccessPolicyRequest) ProtoReflect() protoreflect.Message // Deprecated: Use UpdateAtespaceAccessPolicyRequest.ProtoReflect.Descriptor instead. func (*UpdateAtespaceAccessPolicyRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{136} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{137} } func (x *UpdateAtespaceAccessPolicyRequest) GetAtespace() *ObjectRef { @@ -9798,7 +9929,7 @@ type DeleteAtespaceAccessPolicyRequest struct { func (x *DeleteAtespaceAccessPolicyRequest) Reset() { *x = DeleteAtespaceAccessPolicyRequest{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[137] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[138] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9810,7 +9941,7 @@ func (x *DeleteAtespaceAccessPolicyRequest) String() string { func (*DeleteAtespaceAccessPolicyRequest) ProtoMessage() {} func (x *DeleteAtespaceAccessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[137] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[138] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9823,7 +9954,7 @@ func (x *DeleteAtespaceAccessPolicyRequest) ProtoReflect() protoreflect.Message // Deprecated: Use DeleteAtespaceAccessPolicyRequest.ProtoReflect.Descriptor instead. func (*DeleteAtespaceAccessPolicyRequest) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{137} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{138} } func (x *DeleteAtespaceAccessPolicyRequest) GetAtespace() *ObjectRef { @@ -9869,7 +10000,7 @@ type ResourceAnnotation struct { func (x *ResourceAnnotation) Reset() { *x = ResourceAnnotation{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[138] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[139] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9881,7 +10012,7 @@ func (x *ResourceAnnotation) String() string { func (*ResourceAnnotation) ProtoMessage() {} func (x *ResourceAnnotation) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[138] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[139] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9894,7 +10025,7 @@ func (x *ResourceAnnotation) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceAnnotation.ProtoReflect.Descriptor instead. func (*ResourceAnnotation) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{138} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{139} } func (x *ResourceAnnotation) GetParents() []string { @@ -9937,7 +10068,7 @@ type MethodAnnotation struct { func (x *MethodAnnotation) Reset() { *x = MethodAnnotation{} - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[139] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[140] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9949,7 +10080,7 @@ func (x *MethodAnnotation) String() string { func (*MethodAnnotation) ProtoMessage() {} func (x *MethodAnnotation) ProtoReflect() protoreflect.Message { - mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[139] + mi := &file_api_ateapi_v1_ateapi_proto_msgTypes[140] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9962,7 +10093,7 @@ func (x *MethodAnnotation) ProtoReflect() protoreflect.Message { // Deprecated: Use MethodAnnotation.ProtoReflect.Descriptor instead. func (*MethodAnnotation) Descriptor() ([]byte, []int) { - return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{139} + return file_api_ateapi_v1_ateapi_proto_rawDescGZIP(), []int{140} } func (x *MethodAnnotation) GetResource() string { @@ -10252,21 +10383,24 @@ const file_api_ateapi_v1_ateapi_proto_rawDesc = "" + "\x12CreateActorRequest\x120\n" + "\x05actor\x18\x01 \x01(\v2\x1a.substrate.ateapi.v1.ActorR\x05actor\"F\n" + "\x12UpdateActorRequest\x120\n" + - "\x05actor\x18\x01 \x01(\v2\x1a.substrate.ateapi.v1.ActorR\x05actor\"\x8a\x01\n" + + "\x05actor\x18\x01 \x01(\v2\x1a.substrate.ateapi.v1.ActorR\x05actor\"\xd4\x01\n" + "\x13SuspendActorRequest\x124\n" + "\x05actor\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x05actor\x12=\n" + - "\aoptions\x18\x02 \x01(\v2#.substrate.ateapi.v1.SuspendOptionsR\aoptions\"H\n" + + "\aoptions\x18\x02 \x01(\v2#.substrate.ateapi.v1.SuspendOptionsR\aoptions\x12H\n" + + "\rpreconditions\x18\x03 \x01(\v2\".substrate.ateapi.v1.PreconditionsR\rpreconditions\"H\n" + "\x14SuspendActorResponse\x120\n" + "\x05actor\x18\x01 \x01(\v2\x1a.substrate.ateapi.v1.ActorR\x05actor\"I\n" + "\x0eSuspendOptions\x127\n" + - "\x04mode\x18\x01 \x01(\x0e2#.substrate.ateapi.v1.DurabilityModeR\x04mode\"J\n" + + "\x04mode\x18\x01 \x01(\x0e2#.substrate.ateapi.v1.DurabilityModeR\x04mode\"\x94\x01\n" + "\x12ResumeActorRequest\x124\n" + - "\x05actor\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x05actor\"a\n" + + "\x05actor\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x05actor\x12H\n" + + "\rpreconditions\x18\x02 \x01(\v2\".substrate.ateapi.v1.PreconditionsR\rpreconditions\"a\n" + "\x13ResumeActorResponse\x120\n" + "\x05actor\x18\x01 \x01(\v2\x1a.substrate.ateapi.v1.ActorR\x05actor\x12\x18\n" + - "\aresumed\x18\x02 \x01(\bR\aresumed\"J\n" + + "\aresumed\x18\x02 \x01(\bR\aresumed\"\x94\x01\n" + "\x12RevertActorRequest\x124\n" + - "\x05actor\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x05actor\"G\n" + + "\x05actor\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x05actor\x12H\n" + + "\rpreconditions\x18\x02 \x01(\v2\".substrate.ateapi.v1.PreconditionsR\rpreconditions\"G\n" + "\x13RevertActorResponse\x120\n" + "\x05actor\x18\x01 \x01(\v2\x1a.substrate.ateapi.v1.ActorR\x05actor\"\x88\x01\n" + "\x12DeleteActorRequest\x124\n" + @@ -10310,6 +10444,9 @@ const file_api_ateapi_v1_ateapi_proto_rawDesc = "" + "\aoptions\x18\x02 \x01(\v2\".substrate.ateapi.v1.DeleteOptionsR\aoptions\";\n" + "\rDeleteOptions\x12\x18\n" + "\aversion\x18\x01 \x01(\x03R\aversion\x12\x10\n" + + "\x03uid\x18\x02 \x01(\tR\x03uid\";\n" + + "\rPreconditions\x12\x18\n" + + "\aversion\x18\x01 \x01(\x03R\aversion\x12\x10\n" + "\x03uid\x18\x02 \x01(\tR\x03uid\"I\n" + "\vListOptions\x12\x1b\n" + "\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" + @@ -10334,17 +10471,20 @@ const file_api_ateapi_v1_ateapi_proto_rawDesc = "" + "\x06worker\x18\x01 \x01(\v2\x1b.substrate.ateapi.v1.WorkerR\x06worker\"\x8b\x01\n" + "\x13DeleteWorkerRequest\x126\n" + "\x06worker\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x06worker\x12<\n" + - "\aoptions\x18\x02 \x01(\v2\".substrate.ateapi.v1.DeleteOptionsR\aoptions\"L\n" + + "\aoptions\x18\x02 \x01(\v2\".substrate.ateapi.v1.DeleteOptionsR\aoptions\"\x96\x01\n" + "\x12DrainWorkerRequest\x126\n" + - "\x06worker\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x06worker\"J\n" + + "\x06worker\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x06worker\x12H\n" + + "\rpreconditions\x18\x02 \x01(\v2\".substrate.ateapi.v1.PreconditionsR\rpreconditions\"J\n" + "\x13DrainWorkerResponse\x123\n" + - "\x06worker\x18\x01 \x01(\v2\x1b.substrate.ateapi.v1.WorkerR\x06worker\"T\n" + + "\x06worker\x18\x01 \x01(\v2\x1b.substrate.ateapi.v1.WorkerR\x06worker\"\x9e\x01\n" + "\x1aMarkWorkerAvailableRequest\x126\n" + - "\x06worker\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x06worker\"R\n" + + "\x06worker\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x06worker\x12H\n" + + "\rpreconditions\x18\x02 \x01(\v2\".substrate.ateapi.v1.PreconditionsR\rpreconditions\"R\n" + "\x1bMarkWorkerAvailableResponse\x123\n" + - "\x06worker\x18\x01 \x01(\v2\x1b.substrate.ateapi.v1.WorkerR\x06worker\"V\n" + + "\x06worker\x18\x01 \x01(\v2\x1b.substrate.ateapi.v1.WorkerR\x06worker\"\xa0\x01\n" + "\x1cMarkWorkerUnavailableRequest\x126\n" + - "\x06worker\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x06worker\"T\n" + + "\x06worker\x18\x01 \x01(\v2\x1e.substrate.ateapi.v1.ObjectRefR\x06worker\x12H\n" + + "\rpreconditions\x18\x02 \x01(\v2\".substrate.ateapi.v1.PreconditionsR\rpreconditions\"T\n" + "\x1dMarkWorkerUnavailableResponse\x123\n" + "\x06worker\x18\x01 \x01(\v2\x1b.substrate.ateapi.v1.WorkerR\x06worker\"k\n" + "\x11ListActorsRequest\x12\x1a\n" + @@ -10670,7 +10810,7 @@ func file_api_ateapi_v1_ateapi_proto_rawDescGZIP() []byte { } var file_api_ateapi_v1_ateapi_proto_enumTypes = make([]protoimpl.EnumInfo, 10) -var file_api_ateapi_v1_ateapi_proto_msgTypes = make([]protoimpl.MessageInfo, 143) +var file_api_ateapi_v1_ateapi_proto_msgTypes = make([]protoimpl.MessageInfo, 144) var file_api_ateapi_v1_ateapi_proto_goTypes = []any{ (SnapshotOwner)(0), // 0: substrate.ateapi.v1.SnapshotOwner (SnapshotStorageState)(0), // 1: substrate.ateapi.v1.SnapshotStorageState @@ -10766,68 +10906,69 @@ var file_api_ateapi_v1_ateapi_proto_goTypes = []any{ (*UpdateTagRequest)(nil), // 91: substrate.ateapi.v1.UpdateTagRequest (*DeleteTagRequest)(nil), // 92: substrate.ateapi.v1.DeleteTagRequest (*DeleteOptions)(nil), // 93: substrate.ateapi.v1.DeleteOptions - (*ListOptions)(nil), // 94: substrate.ateapi.v1.ListOptions - (*ListWorkerActorAssignmentsRequest)(nil), // 95: substrate.ateapi.v1.ListWorkerActorAssignmentsRequest - (*ListWorkerActorAssignmentsResponse)(nil), // 96: substrate.ateapi.v1.ListWorkerActorAssignmentsResponse - (*ListWorkersRequest)(nil), // 97: substrate.ateapi.v1.ListWorkersRequest - (*ListWorkersResponse)(nil), // 98: substrate.ateapi.v1.ListWorkersResponse - (*GetWorkerRequest)(nil), // 99: substrate.ateapi.v1.GetWorkerRequest - (*CreateWorkerRequest)(nil), // 100: substrate.ateapi.v1.CreateWorkerRequest - (*UpdateWorkerRequest)(nil), // 101: substrate.ateapi.v1.UpdateWorkerRequest - (*DeleteWorkerRequest)(nil), // 102: substrate.ateapi.v1.DeleteWorkerRequest - (*DrainWorkerRequest)(nil), // 103: substrate.ateapi.v1.DrainWorkerRequest - (*DrainWorkerResponse)(nil), // 104: substrate.ateapi.v1.DrainWorkerResponse - (*MarkWorkerAvailableRequest)(nil), // 105: substrate.ateapi.v1.MarkWorkerAvailableRequest - (*MarkWorkerAvailableResponse)(nil), // 106: substrate.ateapi.v1.MarkWorkerAvailableResponse - (*MarkWorkerUnavailableRequest)(nil), // 107: substrate.ateapi.v1.MarkWorkerUnavailableRequest - (*MarkWorkerUnavailableResponse)(nil), // 108: substrate.ateapi.v1.MarkWorkerUnavailableResponse - (*ListActorsRequest)(nil), // 109: substrate.ateapi.v1.ListActorsRequest - (*ListActorsResponse)(nil), // 110: substrate.ateapi.v1.ListActorsResponse - (*Worker)(nil), // 111: substrate.ateapi.v1.Worker - (*WorkerStatus)(nil), // 112: substrate.ateapi.v1.WorkerStatus - (*WorkerSandboxClass)(nil), // 113: substrate.ateapi.v1.WorkerSandboxClass - (*WorkerSandboxRuntime)(nil), // 114: substrate.ateapi.v1.WorkerSandboxRuntime - (*RuntimeOverhead)(nil), // 115: substrate.ateapi.v1.RuntimeOverhead - (*ActorSandboxRuntime)(nil), // 116: substrate.ateapi.v1.ActorSandboxRuntime - (*VersionedSandboxCompat)(nil), // 117: substrate.ateapi.v1.VersionedSandboxCompat - (*AttributeEntry)(nil), // 118: substrate.ateapi.v1.AttributeEntry - (*WorkerResources)(nil), // 119: substrate.ateapi.v1.WorkerResources - (*ActorAssignment)(nil), // 120: substrate.ateapi.v1.ActorAssignment - (*AcquireWorkerEpochRequest)(nil), // 121: substrate.ateapi.v1.AcquireWorkerEpochRequest - (*AcquireWorkerEpochResponse)(nil), // 122: substrate.ateapi.v1.AcquireWorkerEpochResponse - (*RegisterWorkerRequest)(nil), // 123: substrate.ateapi.v1.RegisterWorkerRequest - (*RegisterWorkerResponse)(nil), // 124: substrate.ateapi.v1.RegisterWorkerResponse - (*SetWorkerSandboxRuntimesRequest)(nil), // 125: substrate.ateapi.v1.SetWorkerSandboxRuntimesRequest - (*SetWorkerSandboxRuntimesResponse)(nil), // 126: substrate.ateapi.v1.SetWorkerSandboxRuntimesResponse - (*MintWorkerActorCertificateRequest)(nil), // 127: substrate.ateapi.v1.MintWorkerActorCertificateRequest - (*MintWorkerActorCertificateResponse)(nil), // 128: substrate.ateapi.v1.MintWorkerActorCertificateResponse - (*MintWorkerActorJwtRequest)(nil), // 129: substrate.ateapi.v1.MintWorkerActorJwtRequest - (*MintWorkerActorJwtResponse)(nil), // 130: substrate.ateapi.v1.MintWorkerActorJwtResponse - (*RequestActorSuspendRequest)(nil), // 131: substrate.ateapi.v1.RequestActorSuspendRequest - (*RequestActorSuspendResponse)(nil), // 132: substrate.ateapi.v1.RequestActorSuspendResponse - (*ReportActorCrashedRequest)(nil), // 133: substrate.ateapi.v1.ReportActorCrashedRequest - (*ReportActorCrashedResponse)(nil), // 134: substrate.ateapi.v1.ReportActorCrashedResponse - (*ReportActorSnapshotStateRequest)(nil), // 135: substrate.ateapi.v1.ReportActorSnapshotStateRequest - (*ReportActorSnapshotStateResponse)(nil), // 136: substrate.ateapi.v1.ReportActorSnapshotStateResponse - (*ActorSnapshotState)(nil), // 137: substrate.ateapi.v1.ActorSnapshotState - (*SnapshotReport)(nil), // 138: substrate.ateapi.v1.SnapshotReport - (*AccessPolicy)(nil), // 139: substrate.ateapi.v1.AccessPolicy - (*Binding)(nil), // 140: substrate.ateapi.v1.Binding - (*GetGlobalAccessPolicyRequest)(nil), // 141: substrate.ateapi.v1.GetGlobalAccessPolicyRequest - (*CreateGlobalAccessPolicyRequest)(nil), // 142: substrate.ateapi.v1.CreateGlobalAccessPolicyRequest - (*UpdateGlobalAccessPolicyRequest)(nil), // 143: substrate.ateapi.v1.UpdateGlobalAccessPolicyRequest - (*GetAtespaceAccessPolicyRequest)(nil), // 144: substrate.ateapi.v1.GetAtespaceAccessPolicyRequest - (*CreateAtespaceAccessPolicyRequest)(nil), // 145: substrate.ateapi.v1.CreateAtespaceAccessPolicyRequest - (*UpdateAtespaceAccessPolicyRequest)(nil), // 146: substrate.ateapi.v1.UpdateAtespaceAccessPolicyRequest - (*DeleteAtespaceAccessPolicyRequest)(nil), // 147: substrate.ateapi.v1.DeleteAtespaceAccessPolicyRequest - (*ResourceAnnotation)(nil), // 148: substrate.ateapi.v1.ResourceAnnotation - (*MethodAnnotation)(nil), // 149: substrate.ateapi.v1.MethodAnnotation - nil, // 150: substrate.ateapi.v1.Selector.MatchLabelsEntry - nil, // 151: substrate.ateapi.v1.ExternalVolumeStatus.VolumeContextEntry - nil, // 152: substrate.ateapi.v1.Worker.LabelsEntry - (*timestamppb.Timestamp)(nil), // 153: google.protobuf.Timestamp - (*descriptorpb.MessageOptions)(nil), // 154: google.protobuf.MessageOptions - (*descriptorpb.MethodOptions)(nil), // 155: google.protobuf.MethodOptions + (*Preconditions)(nil), // 94: substrate.ateapi.v1.Preconditions + (*ListOptions)(nil), // 95: substrate.ateapi.v1.ListOptions + (*ListWorkerActorAssignmentsRequest)(nil), // 96: substrate.ateapi.v1.ListWorkerActorAssignmentsRequest + (*ListWorkerActorAssignmentsResponse)(nil), // 97: substrate.ateapi.v1.ListWorkerActorAssignmentsResponse + (*ListWorkersRequest)(nil), // 98: substrate.ateapi.v1.ListWorkersRequest + (*ListWorkersResponse)(nil), // 99: substrate.ateapi.v1.ListWorkersResponse + (*GetWorkerRequest)(nil), // 100: substrate.ateapi.v1.GetWorkerRequest + (*CreateWorkerRequest)(nil), // 101: substrate.ateapi.v1.CreateWorkerRequest + (*UpdateWorkerRequest)(nil), // 102: substrate.ateapi.v1.UpdateWorkerRequest + (*DeleteWorkerRequest)(nil), // 103: substrate.ateapi.v1.DeleteWorkerRequest + (*DrainWorkerRequest)(nil), // 104: substrate.ateapi.v1.DrainWorkerRequest + (*DrainWorkerResponse)(nil), // 105: substrate.ateapi.v1.DrainWorkerResponse + (*MarkWorkerAvailableRequest)(nil), // 106: substrate.ateapi.v1.MarkWorkerAvailableRequest + (*MarkWorkerAvailableResponse)(nil), // 107: substrate.ateapi.v1.MarkWorkerAvailableResponse + (*MarkWorkerUnavailableRequest)(nil), // 108: substrate.ateapi.v1.MarkWorkerUnavailableRequest + (*MarkWorkerUnavailableResponse)(nil), // 109: substrate.ateapi.v1.MarkWorkerUnavailableResponse + (*ListActorsRequest)(nil), // 110: substrate.ateapi.v1.ListActorsRequest + (*ListActorsResponse)(nil), // 111: substrate.ateapi.v1.ListActorsResponse + (*Worker)(nil), // 112: substrate.ateapi.v1.Worker + (*WorkerStatus)(nil), // 113: substrate.ateapi.v1.WorkerStatus + (*WorkerSandboxClass)(nil), // 114: substrate.ateapi.v1.WorkerSandboxClass + (*WorkerSandboxRuntime)(nil), // 115: substrate.ateapi.v1.WorkerSandboxRuntime + (*RuntimeOverhead)(nil), // 116: substrate.ateapi.v1.RuntimeOverhead + (*ActorSandboxRuntime)(nil), // 117: substrate.ateapi.v1.ActorSandboxRuntime + (*VersionedSandboxCompat)(nil), // 118: substrate.ateapi.v1.VersionedSandboxCompat + (*AttributeEntry)(nil), // 119: substrate.ateapi.v1.AttributeEntry + (*WorkerResources)(nil), // 120: substrate.ateapi.v1.WorkerResources + (*ActorAssignment)(nil), // 121: substrate.ateapi.v1.ActorAssignment + (*AcquireWorkerEpochRequest)(nil), // 122: substrate.ateapi.v1.AcquireWorkerEpochRequest + (*AcquireWorkerEpochResponse)(nil), // 123: substrate.ateapi.v1.AcquireWorkerEpochResponse + (*RegisterWorkerRequest)(nil), // 124: substrate.ateapi.v1.RegisterWorkerRequest + (*RegisterWorkerResponse)(nil), // 125: substrate.ateapi.v1.RegisterWorkerResponse + (*SetWorkerSandboxRuntimesRequest)(nil), // 126: substrate.ateapi.v1.SetWorkerSandboxRuntimesRequest + (*SetWorkerSandboxRuntimesResponse)(nil), // 127: substrate.ateapi.v1.SetWorkerSandboxRuntimesResponse + (*MintWorkerActorCertificateRequest)(nil), // 128: substrate.ateapi.v1.MintWorkerActorCertificateRequest + (*MintWorkerActorCertificateResponse)(nil), // 129: substrate.ateapi.v1.MintWorkerActorCertificateResponse + (*MintWorkerActorJwtRequest)(nil), // 130: substrate.ateapi.v1.MintWorkerActorJwtRequest + (*MintWorkerActorJwtResponse)(nil), // 131: substrate.ateapi.v1.MintWorkerActorJwtResponse + (*RequestActorSuspendRequest)(nil), // 132: substrate.ateapi.v1.RequestActorSuspendRequest + (*RequestActorSuspendResponse)(nil), // 133: substrate.ateapi.v1.RequestActorSuspendResponse + (*ReportActorCrashedRequest)(nil), // 134: substrate.ateapi.v1.ReportActorCrashedRequest + (*ReportActorCrashedResponse)(nil), // 135: substrate.ateapi.v1.ReportActorCrashedResponse + (*ReportActorSnapshotStateRequest)(nil), // 136: substrate.ateapi.v1.ReportActorSnapshotStateRequest + (*ReportActorSnapshotStateResponse)(nil), // 137: substrate.ateapi.v1.ReportActorSnapshotStateResponse + (*ActorSnapshotState)(nil), // 138: substrate.ateapi.v1.ActorSnapshotState + (*SnapshotReport)(nil), // 139: substrate.ateapi.v1.SnapshotReport + (*AccessPolicy)(nil), // 140: substrate.ateapi.v1.AccessPolicy + (*Binding)(nil), // 141: substrate.ateapi.v1.Binding + (*GetGlobalAccessPolicyRequest)(nil), // 142: substrate.ateapi.v1.GetGlobalAccessPolicyRequest + (*CreateGlobalAccessPolicyRequest)(nil), // 143: substrate.ateapi.v1.CreateGlobalAccessPolicyRequest + (*UpdateGlobalAccessPolicyRequest)(nil), // 144: substrate.ateapi.v1.UpdateGlobalAccessPolicyRequest + (*GetAtespaceAccessPolicyRequest)(nil), // 145: substrate.ateapi.v1.GetAtespaceAccessPolicyRequest + (*CreateAtespaceAccessPolicyRequest)(nil), // 146: substrate.ateapi.v1.CreateAtespaceAccessPolicyRequest + (*UpdateAtespaceAccessPolicyRequest)(nil), // 147: substrate.ateapi.v1.UpdateAtespaceAccessPolicyRequest + (*DeleteAtespaceAccessPolicyRequest)(nil), // 148: substrate.ateapi.v1.DeleteAtespaceAccessPolicyRequest + (*ResourceAnnotation)(nil), // 149: substrate.ateapi.v1.ResourceAnnotation + (*MethodAnnotation)(nil), // 150: substrate.ateapi.v1.MethodAnnotation + nil, // 151: substrate.ateapi.v1.Selector.MatchLabelsEntry + nil, // 152: substrate.ateapi.v1.ExternalVolumeStatus.VolumeContextEntry + nil, // 153: substrate.ateapi.v1.Worker.LabelsEntry + (*timestamppb.Timestamp)(nil), // 154: google.protobuf.Timestamp + (*descriptorpb.MessageOptions)(nil), // 155: google.protobuf.MessageOptions + (*descriptorpb.MethodOptions)(nil), // 156: google.protobuf.MethodOptions } var file_api_ateapi_v1_ateapi_proto_depIdxs = []int32{ 1, // 0: substrate.ateapi.v1.SnapshotStorage.state:type_name -> substrate.ateapi.v1.SnapshotStorageState @@ -10835,13 +10976,13 @@ var file_api_ateapi_v1_ateapi_proto_depIdxs = []int32{ 0, // 2: substrate.ateapi.v1.Snapshot.owner:type_name -> substrate.ateapi.v1.SnapshotOwner 2, // 3: substrate.ateapi.v1.Snapshot.fidelity:type_name -> substrate.ateapi.v1.SnapshotFidelity 11, // 4: substrate.ateapi.v1.Snapshot.durable_snapshot:type_name -> substrate.ateapi.v1.SnapshotStorage - 116, // 5: substrate.ateapi.v1.Snapshot.sandbox_runtime:type_name -> substrate.ateapi.v1.ActorSandboxRuntime - 150, // 6: substrate.ateapi.v1.Selector.match_labels:type_name -> substrate.ateapi.v1.Selector.MatchLabelsEntry - 153, // 7: substrate.ateapi.v1.ResourceMetadata.create_time:type_name -> google.protobuf.Timestamp - 153, // 8: substrate.ateapi.v1.ResourceMetadata.update_time:type_name -> google.protobuf.Timestamp - 153, // 9: substrate.ateapi.v1.ResourceMetadata.delete_time:type_name -> google.protobuf.Timestamp + 117, // 5: substrate.ateapi.v1.Snapshot.sandbox_runtime:type_name -> substrate.ateapi.v1.ActorSandboxRuntime + 151, // 6: substrate.ateapi.v1.Selector.match_labels:type_name -> substrate.ateapi.v1.Selector.MatchLabelsEntry + 154, // 7: substrate.ateapi.v1.ResourceMetadata.create_time:type_name -> google.protobuf.Timestamp + 154, // 8: substrate.ateapi.v1.ResourceMetadata.update_time:type_name -> google.protobuf.Timestamp + 154, // 9: substrate.ateapi.v1.ResourceMetadata.delete_time:type_name -> google.protobuf.Timestamp 16, // 10: substrate.ateapi.v1.ExternalVolumes.volumes:type_name -> substrate.ateapi.v1.ExternalVolumeStatus - 151, // 11: substrate.ateapi.v1.ExternalVolumeStatus.volume_context:type_name -> substrate.ateapi.v1.ExternalVolumeStatus.VolumeContextEntry + 152, // 11: substrate.ateapi.v1.ExternalVolumeStatus.volume_context:type_name -> substrate.ateapi.v1.ExternalVolumeStatus.VolumeContextEntry 14, // 12: substrate.ateapi.v1.Actor.metadata:type_name -> substrate.ateapi.v1.ResourceMetadata 35, // 13: substrate.ateapi.v1.Actor.actor_template:type_name -> substrate.ateapi.v1.ObjectRef 13, // 14: substrate.ateapi.v1.Actor.worker_selector:type_name -> substrate.ateapi.v1.Selector @@ -10866,9 +11007,9 @@ var file_api_ateapi_v1_ateapi_proto_depIdxs = []int32{ 15, // 33: substrate.ateapi.v1.ActorStatus.external_volumes:type_name -> substrate.ateapi.v1.ExternalVolumes 30, // 34: substrate.ateapi.v1.ActorStatus.crash:type_name -> substrate.ateapi.v1.ActorCrash 12, // 35: substrate.ateapi.v1.ActorStatus.snapshots:type_name -> substrate.ateapi.v1.Snapshot - 153, // 36: substrate.ateapi.v1.ActorCrash.crash_time:type_name -> google.protobuf.Timestamp + 154, // 36: substrate.ateapi.v1.ActorCrash.crash_time:type_name -> google.protobuf.Timestamp 35, // 37: substrate.ateapi.v1.WorkerAssignment.worker:type_name -> substrate.ateapi.v1.ObjectRef - 116, // 38: substrate.ateapi.v1.WorkerAssignment.sandbox_runtime:type_name -> substrate.ateapi.v1.ActorSandboxRuntime + 117, // 38: substrate.ateapi.v1.WorkerAssignment.sandbox_runtime:type_name -> substrate.ateapi.v1.ActorSandboxRuntime 12, // 39: substrate.ateapi.v1.TagStatus.snapshot:type_name -> substrate.ateapi.v1.Snapshot 14, // 40: substrate.ateapi.v1.Tag.metadata:type_name -> substrate.ateapi.v1.ResourceMetadata 32, // 41: substrate.ateapi.v1.Tag.status:type_name -> substrate.ateapi.v1.TagStatus @@ -10885,7 +11026,7 @@ var file_api_ateapi_v1_ateapi_proto_depIdxs = []int32{ 40, // 52: substrate.ateapi.v1.ActorTemplate.status:type_name -> substrate.ateapi.v1.ActorTemplateStatus 38, // 53: substrate.ateapi.v1.ResourceRequirements.limits:type_name -> substrate.ateapi.v1.Resources 35, // 54: substrate.ateapi.v1.GoldenSnapshotStatus.golden_tag:type_name -> substrate.ateapi.v1.ObjectRef - 153, // 55: substrate.ateapi.v1.GoldenSnapshotStatus.snapshot_time:type_name -> google.protobuf.Timestamp + 154, // 55: substrate.ateapi.v1.GoldenSnapshotStatus.snapshot_time:type_name -> google.protobuf.Timestamp 39, // 56: substrate.ateapi.v1.ActorTemplateStatus.golden_snapshot_status:type_name -> substrate.ateapi.v1.GoldenSnapshotStatus 2, // 57: substrate.ateapi.v1.SnapshotConfig.preferred_fidelity:type_name -> substrate.ateapi.v1.SnapshotFidelity 42, // 58: substrate.ateapi.v1.SnapshotConfig.golden_snapshot_config:type_name -> substrate.ateapi.v1.GoldenSnapshotConfig @@ -10909,13 +11050,13 @@ var file_api_ateapi_v1_ateapi_proto_depIdxs = []int32{ 6, // 76: substrate.ateapi.v1.ActorMetadataItem.field:type_name -> substrate.ateapi.v1.ActorMetadataField 34, // 77: substrate.ateapi.v1.CreateAtespaceRequest.atespace:type_name -> substrate.ateapi.v1.Atespace 35, // 78: substrate.ateapi.v1.GetAtespaceRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef - 94, // 79: substrate.ateapi.v1.ListAtespacesRequest.options:type_name -> substrate.ateapi.v1.ListOptions + 95, // 79: substrate.ateapi.v1.ListAtespacesRequest.options:type_name -> substrate.ateapi.v1.ListOptions 34, // 80: substrate.ateapi.v1.ListAtespacesResponse.atespaces:type_name -> substrate.ateapi.v1.Atespace 35, // 81: substrate.ateapi.v1.DeleteAtespaceRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef 93, // 82: substrate.ateapi.v1.DeleteAtespaceRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions 36, // 83: substrate.ateapi.v1.CreateActorTemplateRequest.actor_template:type_name -> substrate.ateapi.v1.ActorTemplate 35, // 84: substrate.ateapi.v1.GetActorTemplateRequest.actor_template:type_name -> substrate.ateapi.v1.ObjectRef - 94, // 85: substrate.ateapi.v1.ListActorTemplatesRequest.options:type_name -> substrate.ateapi.v1.ListOptions + 95, // 85: substrate.ateapi.v1.ListActorTemplatesRequest.options:type_name -> substrate.ateapi.v1.ListOptions 36, // 86: substrate.ateapi.v1.ListActorTemplatesResponse.actor_templates:type_name -> substrate.ateapi.v1.ActorTemplate 35, // 87: substrate.ateapi.v1.DeleteActorTemplateRequest.actor_template:type_name -> substrate.ateapi.v1.ObjectRef 93, // 88: substrate.ateapi.v1.DeleteActorTemplateRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions @@ -10924,212 +11065,218 @@ var file_api_ateapi_v1_ateapi_proto_depIdxs = []int32{ 17, // 91: substrate.ateapi.v1.UpdateActorRequest.actor:type_name -> substrate.ateapi.v1.Actor 35, // 92: substrate.ateapi.v1.SuspendActorRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef 75, // 93: substrate.ateapi.v1.SuspendActorRequest.options:type_name -> substrate.ateapi.v1.SuspendOptions - 17, // 94: substrate.ateapi.v1.SuspendActorResponse.actor:type_name -> substrate.ateapi.v1.Actor - 7, // 95: substrate.ateapi.v1.SuspendOptions.mode:type_name -> substrate.ateapi.v1.DurabilityMode - 35, // 96: substrate.ateapi.v1.ResumeActorRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 17, // 97: substrate.ateapi.v1.ResumeActorResponse.actor:type_name -> substrate.ateapi.v1.Actor - 35, // 98: substrate.ateapi.v1.RevertActorRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 17, // 99: substrate.ateapi.v1.RevertActorResponse.actor:type_name -> substrate.ateapi.v1.Actor - 35, // 100: substrate.ateapi.v1.DeleteActorRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 93, // 101: substrate.ateapi.v1.DeleteActorRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions - 35, // 102: substrate.ateapi.v1.GetActorEgressPolicyRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 35, // 103: substrate.ateapi.v1.CreateActorEgressPolicyRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 18, // 104: substrate.ateapi.v1.CreateActorEgressPolicyRequest.egress_policy:type_name -> substrate.ateapi.v1.EgressPolicy - 35, // 105: substrate.ateapi.v1.UpdateActorEgressPolicyRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 18, // 106: substrate.ateapi.v1.UpdateActorEgressPolicyRequest.egress_policy:type_name -> substrate.ateapi.v1.EgressPolicy - 35, // 107: substrate.ateapi.v1.DeleteActorEgressPolicyRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 93, // 108: substrate.ateapi.v1.DeleteActorEgressPolicyRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions - 35, // 109: substrate.ateapi.v1.GetTagRequest.tag:type_name -> substrate.ateapi.v1.ObjectRef - 35, // 110: substrate.ateapi.v1.MintActorJwtRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 153, // 111: substrate.ateapi.v1.MintActorJwtResponse.expire_time:type_name -> google.protobuf.Timestamp - 94, // 112: substrate.ateapi.v1.ListTagsRequest.options:type_name -> substrate.ateapi.v1.ListOptions - 33, // 113: substrate.ateapi.v1.ListTagsResponse.tags:type_name -> substrate.ateapi.v1.Tag - 33, // 114: substrate.ateapi.v1.CreateTagRequest.tag:type_name -> substrate.ateapi.v1.Tag - 33, // 115: substrate.ateapi.v1.UpdateTagRequest.tag:type_name -> substrate.ateapi.v1.Tag - 35, // 116: substrate.ateapi.v1.DeleteTagRequest.tag:type_name -> substrate.ateapi.v1.ObjectRef - 93, // 117: substrate.ateapi.v1.DeleteTagRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions - 35, // 118: substrate.ateapi.v1.ListWorkerActorAssignmentsRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 94, // 119: substrate.ateapi.v1.ListWorkerActorAssignmentsRequest.options:type_name -> substrate.ateapi.v1.ListOptions - 120, // 120: substrate.ateapi.v1.ListWorkerActorAssignmentsResponse.actor_assignments:type_name -> substrate.ateapi.v1.ActorAssignment - 94, // 121: substrate.ateapi.v1.ListWorkersRequest.options:type_name -> substrate.ateapi.v1.ListOptions - 111, // 122: substrate.ateapi.v1.ListWorkersResponse.workers:type_name -> substrate.ateapi.v1.Worker - 35, // 123: substrate.ateapi.v1.GetWorkerRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 111, // 124: substrate.ateapi.v1.CreateWorkerRequest.worker:type_name -> substrate.ateapi.v1.Worker - 111, // 125: substrate.ateapi.v1.UpdateWorkerRequest.worker:type_name -> substrate.ateapi.v1.Worker - 35, // 126: substrate.ateapi.v1.DeleteWorkerRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 93, // 127: substrate.ateapi.v1.DeleteWorkerRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions - 35, // 128: substrate.ateapi.v1.DrainWorkerRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 111, // 129: substrate.ateapi.v1.DrainWorkerResponse.worker:type_name -> substrate.ateapi.v1.Worker - 35, // 130: substrate.ateapi.v1.MarkWorkerAvailableRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 111, // 131: substrate.ateapi.v1.MarkWorkerAvailableResponse.worker:type_name -> substrate.ateapi.v1.Worker - 35, // 132: substrate.ateapi.v1.MarkWorkerUnavailableRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 111, // 133: substrate.ateapi.v1.MarkWorkerUnavailableResponse.worker:type_name -> substrate.ateapi.v1.Worker - 94, // 134: substrate.ateapi.v1.ListActorsRequest.options:type_name -> substrate.ateapi.v1.ListOptions - 17, // 135: substrate.ateapi.v1.ListActorsResponse.actors:type_name -> substrate.ateapi.v1.Actor - 14, // 136: substrate.ateapi.v1.Worker.metadata:type_name -> substrate.ateapi.v1.ResourceMetadata - 152, // 137: substrate.ateapi.v1.Worker.labels:type_name -> substrate.ateapi.v1.Worker.LabelsEntry - 112, // 138: substrate.ateapi.v1.Worker.status:type_name -> substrate.ateapi.v1.WorkerStatus - 8, // 139: substrate.ateapi.v1.WorkerStatus.state:type_name -> substrate.ateapi.v1.WorkerState - 119, // 140: substrate.ateapi.v1.WorkerStatus.capacity:type_name -> substrate.ateapi.v1.WorkerResources - 119, // 141: substrate.ateapi.v1.WorkerStatus.allocated:type_name -> substrate.ateapi.v1.WorkerResources - 113, // 142: substrate.ateapi.v1.WorkerStatus.sandbox_classes:type_name -> substrate.ateapi.v1.WorkerSandboxClass - 114, // 143: substrate.ateapi.v1.WorkerSandboxClass.default_runtime:type_name -> substrate.ateapi.v1.WorkerSandboxRuntime - 114, // 144: substrate.ateapi.v1.WorkerSandboxClass.restorable_runtimes:type_name -> substrate.ateapi.v1.WorkerSandboxRuntime - 117, // 145: substrate.ateapi.v1.WorkerSandboxRuntime.version:type_name -> substrate.ateapi.v1.VersionedSandboxCompat - 115, // 146: substrate.ateapi.v1.WorkerSandboxRuntime.actor_overhead:type_name -> substrate.ateapi.v1.RuntimeOverhead - 117, // 147: substrate.ateapi.v1.ActorSandboxRuntime.version:type_name -> substrate.ateapi.v1.VersionedSandboxCompat - 118, // 148: substrate.ateapi.v1.VersionedSandboxCompat.attributes:type_name -> substrate.ateapi.v1.AttributeEntry - 14, // 149: substrate.ateapi.v1.ActorAssignment.metadata:type_name -> substrate.ateapi.v1.ResourceMetadata - 35, // 150: substrate.ateapi.v1.ActorAssignment.actor:type_name -> substrate.ateapi.v1.ObjectRef - 38, // 151: substrate.ateapi.v1.ActorAssignment.resources:type_name -> substrate.ateapi.v1.Resources - 35, // 152: substrate.ateapi.v1.AcquireWorkerEpochRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 35, // 153: substrate.ateapi.v1.RegisterWorkerRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 119, // 154: substrate.ateapi.v1.RegisterWorkerRequest.capacity:type_name -> substrate.ateapi.v1.WorkerResources - 111, // 155: substrate.ateapi.v1.RegisterWorkerResponse.worker:type_name -> substrate.ateapi.v1.Worker - 35, // 156: substrate.ateapi.v1.SetWorkerSandboxRuntimesRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 113, // 157: substrate.ateapi.v1.SetWorkerSandboxRuntimesRequest.sandbox_classes:type_name -> substrate.ateapi.v1.WorkerSandboxClass - 111, // 158: substrate.ateapi.v1.SetWorkerSandboxRuntimesResponse.worker:type_name -> substrate.ateapi.v1.Worker - 35, // 159: substrate.ateapi.v1.MintWorkerActorCertificateRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 35, // 160: substrate.ateapi.v1.MintWorkerActorCertificateRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 35, // 161: substrate.ateapi.v1.MintWorkerActorJwtRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 153, // 162: substrate.ateapi.v1.MintWorkerActorJwtResponse.expire_time:type_name -> google.protobuf.Timestamp - 35, // 163: substrate.ateapi.v1.RequestActorSuspendRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 35, // 164: substrate.ateapi.v1.RequestActorSuspendRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 17, // 165: substrate.ateapi.v1.RequestActorSuspendResponse.actor:type_name -> substrate.ateapi.v1.Actor - 35, // 166: substrate.ateapi.v1.ReportActorCrashedRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef - 35, // 167: substrate.ateapi.v1.ReportActorCrashedRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 17, // 168: substrate.ateapi.v1.ReportActorCrashedResponse.actor:type_name -> substrate.ateapi.v1.Actor - 35, // 169: substrate.ateapi.v1.ReportActorSnapshotStateRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef - 137, // 170: substrate.ateapi.v1.ReportActorSnapshotStateRequest.state:type_name -> substrate.ateapi.v1.ActorSnapshotState - 138, // 171: substrate.ateapi.v1.ActorSnapshotState.latest_local:type_name -> substrate.ateapi.v1.SnapshotReport - 138, // 172: substrate.ateapi.v1.ActorSnapshotState.uploading:type_name -> substrate.ateapi.v1.SnapshotReport - 138, // 173: substrate.ateapi.v1.ActorSnapshotState.latest_durable:type_name -> substrate.ateapi.v1.SnapshotReport - 153, // 174: substrate.ateapi.v1.ActorSnapshotState.upload_due_time:type_name -> google.protobuf.Timestamp - 2, // 175: substrate.ateapi.v1.SnapshotReport.fidelity:type_name -> substrate.ateapi.v1.SnapshotFidelity - 10, // 176: substrate.ateapi.v1.SnapshotReport.object:type_name -> substrate.ateapi.v1.ObjectSnapshot - 153, // 177: substrate.ateapi.v1.SnapshotReport.local_commit_time:type_name -> google.protobuf.Timestamp - 153, // 178: substrate.ateapi.v1.SnapshotReport.durable_complete_time:type_name -> google.protobuf.Timestamp - 14, // 179: substrate.ateapi.v1.AccessPolicy.metadata:type_name -> substrate.ateapi.v1.ResourceMetadata - 140, // 180: substrate.ateapi.v1.AccessPolicy.bindings:type_name -> substrate.ateapi.v1.Binding - 139, // 181: substrate.ateapi.v1.CreateGlobalAccessPolicyRequest.access_policy:type_name -> substrate.ateapi.v1.AccessPolicy - 139, // 182: substrate.ateapi.v1.UpdateGlobalAccessPolicyRequest.access_policy:type_name -> substrate.ateapi.v1.AccessPolicy - 35, // 183: substrate.ateapi.v1.GetAtespaceAccessPolicyRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef - 35, // 184: substrate.ateapi.v1.CreateAtespaceAccessPolicyRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef - 139, // 185: substrate.ateapi.v1.CreateAtespaceAccessPolicyRequest.access_policy:type_name -> substrate.ateapi.v1.AccessPolicy - 35, // 186: substrate.ateapi.v1.UpdateAtespaceAccessPolicyRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef - 139, // 187: substrate.ateapi.v1.UpdateAtespaceAccessPolicyRequest.access_policy:type_name -> substrate.ateapi.v1.AccessPolicy - 35, // 188: substrate.ateapi.v1.DeleteAtespaceAccessPolicyRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef - 93, // 189: substrate.ateapi.v1.DeleteAtespaceAccessPolicyRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions - 9, // 190: substrate.ateapi.v1.ResourceAnnotation.scope:type_name -> substrate.ateapi.v1.Scope - 154, // 191: substrate.ateapi.v1.resource:extendee -> google.protobuf.MessageOptions - 155, // 192: substrate.ateapi.v1.method:extendee -> google.protobuf.MethodOptions - 148, // 193: substrate.ateapi.v1.resource:type_name -> substrate.ateapi.v1.ResourceAnnotation - 149, // 194: substrate.ateapi.v1.method:type_name -> substrate.ateapi.v1.MethodAnnotation - 70, // 195: substrate.ateapi.v1.Control.GetActor:input_type -> substrate.ateapi.v1.GetActorRequest - 71, // 196: substrate.ateapi.v1.Control.CreateActor:input_type -> substrate.ateapi.v1.CreateActorRequest - 72, // 197: substrate.ateapi.v1.Control.UpdateActor:input_type -> substrate.ateapi.v1.UpdateActorRequest - 73, // 198: substrate.ateapi.v1.Control.SuspendActor:input_type -> substrate.ateapi.v1.SuspendActorRequest - 76, // 199: substrate.ateapi.v1.Control.ResumeActor:input_type -> substrate.ateapi.v1.ResumeActorRequest - 78, // 200: substrate.ateapi.v1.Control.RevertActor:input_type -> substrate.ateapi.v1.RevertActorRequest - 80, // 201: substrate.ateapi.v1.Control.DeleteActor:input_type -> substrate.ateapi.v1.DeleteActorRequest - 81, // 202: substrate.ateapi.v1.Control.GetActorEgressPolicy:input_type -> substrate.ateapi.v1.GetActorEgressPolicyRequest - 82, // 203: substrate.ateapi.v1.Control.CreateActorEgressPolicy:input_type -> substrate.ateapi.v1.CreateActorEgressPolicyRequest - 83, // 204: substrate.ateapi.v1.Control.UpdateActorEgressPolicy:input_type -> substrate.ateapi.v1.UpdateActorEgressPolicyRequest - 84, // 205: substrate.ateapi.v1.Control.DeleteActorEgressPolicy:input_type -> substrate.ateapi.v1.DeleteActorEgressPolicyRequest - 86, // 206: substrate.ateapi.v1.Control.MintActorJwt:input_type -> substrate.ateapi.v1.MintActorJwtRequest - 90, // 207: substrate.ateapi.v1.Control.CreateTag:input_type -> substrate.ateapi.v1.CreateTagRequest - 85, // 208: substrate.ateapi.v1.Control.GetTag:input_type -> substrate.ateapi.v1.GetTagRequest - 88, // 209: substrate.ateapi.v1.Control.ListTags:input_type -> substrate.ateapi.v1.ListTagsRequest - 91, // 210: substrate.ateapi.v1.Control.UpdateTag:input_type -> substrate.ateapi.v1.UpdateTagRequest - 92, // 211: substrate.ateapi.v1.Control.DeleteTag:input_type -> substrate.ateapi.v1.DeleteTagRequest - 97, // 212: substrate.ateapi.v1.Control.ListWorkers:input_type -> substrate.ateapi.v1.ListWorkersRequest - 99, // 213: substrate.ateapi.v1.Control.GetWorker:input_type -> substrate.ateapi.v1.GetWorkerRequest - 100, // 214: substrate.ateapi.v1.Control.CreateWorker:input_type -> substrate.ateapi.v1.CreateWorkerRequest - 101, // 215: substrate.ateapi.v1.Control.UpdateWorker:input_type -> substrate.ateapi.v1.UpdateWorkerRequest - 102, // 216: substrate.ateapi.v1.Control.DeleteWorker:input_type -> substrate.ateapi.v1.DeleteWorkerRequest - 103, // 217: substrate.ateapi.v1.Control.DrainWorker:input_type -> substrate.ateapi.v1.DrainWorkerRequest - 105, // 218: substrate.ateapi.v1.Control.MarkWorkerAvailable:input_type -> substrate.ateapi.v1.MarkWorkerAvailableRequest - 107, // 219: substrate.ateapi.v1.Control.MarkWorkerUnavailable:input_type -> substrate.ateapi.v1.MarkWorkerUnavailableRequest - 95, // 220: substrate.ateapi.v1.Control.ListWorkerActorAssignments:input_type -> substrate.ateapi.v1.ListWorkerActorAssignmentsRequest - 109, // 221: substrate.ateapi.v1.Control.ListActors:input_type -> substrate.ateapi.v1.ListActorsRequest - 60, // 222: substrate.ateapi.v1.Control.CreateAtespace:input_type -> substrate.ateapi.v1.CreateAtespaceRequest - 61, // 223: substrate.ateapi.v1.Control.GetAtespace:input_type -> substrate.ateapi.v1.GetAtespaceRequest - 62, // 224: substrate.ateapi.v1.Control.ListAtespaces:input_type -> substrate.ateapi.v1.ListAtespacesRequest - 64, // 225: substrate.ateapi.v1.Control.DeleteAtespace:input_type -> substrate.ateapi.v1.DeleteAtespaceRequest - 65, // 226: substrate.ateapi.v1.Control.CreateActorTemplate:input_type -> substrate.ateapi.v1.CreateActorTemplateRequest - 66, // 227: substrate.ateapi.v1.Control.GetActorTemplate:input_type -> substrate.ateapi.v1.GetActorTemplateRequest - 67, // 228: substrate.ateapi.v1.Control.ListActorTemplates:input_type -> substrate.ateapi.v1.ListActorTemplatesRequest - 69, // 229: substrate.ateapi.v1.Control.DeleteActorTemplate:input_type -> substrate.ateapi.v1.DeleteActorTemplateRequest - 141, // 230: substrate.ateapi.v1.Control.GetGlobalAccessPolicy:input_type -> substrate.ateapi.v1.GetGlobalAccessPolicyRequest - 142, // 231: substrate.ateapi.v1.Control.CreateGlobalAccessPolicy:input_type -> substrate.ateapi.v1.CreateGlobalAccessPolicyRequest - 143, // 232: substrate.ateapi.v1.Control.UpdateGlobalAccessPolicy:input_type -> substrate.ateapi.v1.UpdateGlobalAccessPolicyRequest - 144, // 233: substrate.ateapi.v1.Control.GetAtespaceAccessPolicy:input_type -> substrate.ateapi.v1.GetAtespaceAccessPolicyRequest - 145, // 234: substrate.ateapi.v1.Control.CreateAtespaceAccessPolicy:input_type -> substrate.ateapi.v1.CreateAtespaceAccessPolicyRequest - 146, // 235: substrate.ateapi.v1.Control.UpdateAtespaceAccessPolicy:input_type -> substrate.ateapi.v1.UpdateAtespaceAccessPolicyRequest - 147, // 236: substrate.ateapi.v1.Control.DeleteAtespaceAccessPolicy:input_type -> substrate.ateapi.v1.DeleteAtespaceAccessPolicyRequest - 121, // 237: substrate.ateapi.v1.WorkerService.AcquireWorkerEpoch:input_type -> substrate.ateapi.v1.AcquireWorkerEpochRequest - 123, // 238: substrate.ateapi.v1.WorkerService.RegisterWorker:input_type -> substrate.ateapi.v1.RegisterWorkerRequest - 125, // 239: substrate.ateapi.v1.WorkerService.SetWorkerSandboxRuntimes:input_type -> substrate.ateapi.v1.SetWorkerSandboxRuntimesRequest - 127, // 240: substrate.ateapi.v1.WorkerService.MintWorkerActorCertificate:input_type -> substrate.ateapi.v1.MintWorkerActorCertificateRequest - 129, // 241: substrate.ateapi.v1.WorkerService.MintWorkerActorJwt:input_type -> substrate.ateapi.v1.MintWorkerActorJwtRequest - 131, // 242: substrate.ateapi.v1.WorkerService.RequestActorSuspend:input_type -> substrate.ateapi.v1.RequestActorSuspendRequest - 135, // 243: substrate.ateapi.v1.WorkerService.ReportActorSnapshotState:input_type -> substrate.ateapi.v1.ReportActorSnapshotStateRequest - 133, // 244: substrate.ateapi.v1.WorkerService.ReportActorCrashed:input_type -> substrate.ateapi.v1.ReportActorCrashedRequest - 17, // 245: substrate.ateapi.v1.Control.GetActor:output_type -> substrate.ateapi.v1.Actor - 17, // 246: substrate.ateapi.v1.Control.CreateActor:output_type -> substrate.ateapi.v1.Actor - 17, // 247: substrate.ateapi.v1.Control.UpdateActor:output_type -> substrate.ateapi.v1.Actor - 74, // 248: substrate.ateapi.v1.Control.SuspendActor:output_type -> substrate.ateapi.v1.SuspendActorResponse - 77, // 249: substrate.ateapi.v1.Control.ResumeActor:output_type -> substrate.ateapi.v1.ResumeActorResponse - 79, // 250: substrate.ateapi.v1.Control.RevertActor:output_type -> substrate.ateapi.v1.RevertActorResponse - 17, // 251: substrate.ateapi.v1.Control.DeleteActor:output_type -> substrate.ateapi.v1.Actor - 18, // 252: substrate.ateapi.v1.Control.GetActorEgressPolicy:output_type -> substrate.ateapi.v1.EgressPolicy - 18, // 253: substrate.ateapi.v1.Control.CreateActorEgressPolicy:output_type -> substrate.ateapi.v1.EgressPolicy - 18, // 254: substrate.ateapi.v1.Control.UpdateActorEgressPolicy:output_type -> substrate.ateapi.v1.EgressPolicy - 18, // 255: substrate.ateapi.v1.Control.DeleteActorEgressPolicy:output_type -> substrate.ateapi.v1.EgressPolicy - 87, // 256: substrate.ateapi.v1.Control.MintActorJwt:output_type -> substrate.ateapi.v1.MintActorJwtResponse - 33, // 257: substrate.ateapi.v1.Control.CreateTag:output_type -> substrate.ateapi.v1.Tag - 33, // 258: substrate.ateapi.v1.Control.GetTag:output_type -> substrate.ateapi.v1.Tag - 89, // 259: substrate.ateapi.v1.Control.ListTags:output_type -> substrate.ateapi.v1.ListTagsResponse - 33, // 260: substrate.ateapi.v1.Control.UpdateTag:output_type -> substrate.ateapi.v1.Tag - 33, // 261: substrate.ateapi.v1.Control.DeleteTag:output_type -> substrate.ateapi.v1.Tag - 98, // 262: substrate.ateapi.v1.Control.ListWorkers:output_type -> substrate.ateapi.v1.ListWorkersResponse - 111, // 263: substrate.ateapi.v1.Control.GetWorker:output_type -> substrate.ateapi.v1.Worker - 111, // 264: substrate.ateapi.v1.Control.CreateWorker:output_type -> substrate.ateapi.v1.Worker - 111, // 265: substrate.ateapi.v1.Control.UpdateWorker:output_type -> substrate.ateapi.v1.Worker - 111, // 266: substrate.ateapi.v1.Control.DeleteWorker:output_type -> substrate.ateapi.v1.Worker - 104, // 267: substrate.ateapi.v1.Control.DrainWorker:output_type -> substrate.ateapi.v1.DrainWorkerResponse - 106, // 268: substrate.ateapi.v1.Control.MarkWorkerAvailable:output_type -> substrate.ateapi.v1.MarkWorkerAvailableResponse - 108, // 269: substrate.ateapi.v1.Control.MarkWorkerUnavailable:output_type -> substrate.ateapi.v1.MarkWorkerUnavailableResponse - 96, // 270: substrate.ateapi.v1.Control.ListWorkerActorAssignments:output_type -> substrate.ateapi.v1.ListWorkerActorAssignmentsResponse - 110, // 271: substrate.ateapi.v1.Control.ListActors:output_type -> substrate.ateapi.v1.ListActorsResponse - 34, // 272: substrate.ateapi.v1.Control.CreateAtespace:output_type -> substrate.ateapi.v1.Atespace - 34, // 273: substrate.ateapi.v1.Control.GetAtespace:output_type -> substrate.ateapi.v1.Atespace - 63, // 274: substrate.ateapi.v1.Control.ListAtespaces:output_type -> substrate.ateapi.v1.ListAtespacesResponse - 34, // 275: substrate.ateapi.v1.Control.DeleteAtespace:output_type -> substrate.ateapi.v1.Atespace - 36, // 276: substrate.ateapi.v1.Control.CreateActorTemplate:output_type -> substrate.ateapi.v1.ActorTemplate - 36, // 277: substrate.ateapi.v1.Control.GetActorTemplate:output_type -> substrate.ateapi.v1.ActorTemplate - 68, // 278: substrate.ateapi.v1.Control.ListActorTemplates:output_type -> substrate.ateapi.v1.ListActorTemplatesResponse - 36, // 279: substrate.ateapi.v1.Control.DeleteActorTemplate:output_type -> substrate.ateapi.v1.ActorTemplate - 139, // 280: substrate.ateapi.v1.Control.GetGlobalAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy - 139, // 281: substrate.ateapi.v1.Control.CreateGlobalAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy - 139, // 282: substrate.ateapi.v1.Control.UpdateGlobalAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy - 139, // 283: substrate.ateapi.v1.Control.GetAtespaceAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy - 139, // 284: substrate.ateapi.v1.Control.CreateAtespaceAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy - 139, // 285: substrate.ateapi.v1.Control.UpdateAtespaceAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy - 139, // 286: substrate.ateapi.v1.Control.DeleteAtespaceAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy - 122, // 287: substrate.ateapi.v1.WorkerService.AcquireWorkerEpoch:output_type -> substrate.ateapi.v1.AcquireWorkerEpochResponse - 124, // 288: substrate.ateapi.v1.WorkerService.RegisterWorker:output_type -> substrate.ateapi.v1.RegisterWorkerResponse - 126, // 289: substrate.ateapi.v1.WorkerService.SetWorkerSandboxRuntimes:output_type -> substrate.ateapi.v1.SetWorkerSandboxRuntimesResponse - 128, // 290: substrate.ateapi.v1.WorkerService.MintWorkerActorCertificate:output_type -> substrate.ateapi.v1.MintWorkerActorCertificateResponse - 130, // 291: substrate.ateapi.v1.WorkerService.MintWorkerActorJwt:output_type -> substrate.ateapi.v1.MintWorkerActorJwtResponse - 132, // 292: substrate.ateapi.v1.WorkerService.RequestActorSuspend:output_type -> substrate.ateapi.v1.RequestActorSuspendResponse - 136, // 293: substrate.ateapi.v1.WorkerService.ReportActorSnapshotState:output_type -> substrate.ateapi.v1.ReportActorSnapshotStateResponse - 134, // 294: substrate.ateapi.v1.WorkerService.ReportActorCrashed:output_type -> substrate.ateapi.v1.ReportActorCrashedResponse - 245, // [245:295] is the sub-list for method output_type - 195, // [195:245] is the sub-list for method input_type - 193, // [193:195] is the sub-list for extension type_name - 191, // [191:193] is the sub-list for extension extendee - 0, // [0:191] is the sub-list for field type_name + 94, // 94: substrate.ateapi.v1.SuspendActorRequest.preconditions:type_name -> substrate.ateapi.v1.Preconditions + 17, // 95: substrate.ateapi.v1.SuspendActorResponse.actor:type_name -> substrate.ateapi.v1.Actor + 7, // 96: substrate.ateapi.v1.SuspendOptions.mode:type_name -> substrate.ateapi.v1.DurabilityMode + 35, // 97: substrate.ateapi.v1.ResumeActorRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 94, // 98: substrate.ateapi.v1.ResumeActorRequest.preconditions:type_name -> substrate.ateapi.v1.Preconditions + 17, // 99: substrate.ateapi.v1.ResumeActorResponse.actor:type_name -> substrate.ateapi.v1.Actor + 35, // 100: substrate.ateapi.v1.RevertActorRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 94, // 101: substrate.ateapi.v1.RevertActorRequest.preconditions:type_name -> substrate.ateapi.v1.Preconditions + 17, // 102: substrate.ateapi.v1.RevertActorResponse.actor:type_name -> substrate.ateapi.v1.Actor + 35, // 103: substrate.ateapi.v1.DeleteActorRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 93, // 104: substrate.ateapi.v1.DeleteActorRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions + 35, // 105: substrate.ateapi.v1.GetActorEgressPolicyRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 35, // 106: substrate.ateapi.v1.CreateActorEgressPolicyRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 18, // 107: substrate.ateapi.v1.CreateActorEgressPolicyRequest.egress_policy:type_name -> substrate.ateapi.v1.EgressPolicy + 35, // 108: substrate.ateapi.v1.UpdateActorEgressPolicyRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 18, // 109: substrate.ateapi.v1.UpdateActorEgressPolicyRequest.egress_policy:type_name -> substrate.ateapi.v1.EgressPolicy + 35, // 110: substrate.ateapi.v1.DeleteActorEgressPolicyRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 93, // 111: substrate.ateapi.v1.DeleteActorEgressPolicyRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions + 35, // 112: substrate.ateapi.v1.GetTagRequest.tag:type_name -> substrate.ateapi.v1.ObjectRef + 35, // 113: substrate.ateapi.v1.MintActorJwtRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 154, // 114: substrate.ateapi.v1.MintActorJwtResponse.expire_time:type_name -> google.protobuf.Timestamp + 95, // 115: substrate.ateapi.v1.ListTagsRequest.options:type_name -> substrate.ateapi.v1.ListOptions + 33, // 116: substrate.ateapi.v1.ListTagsResponse.tags:type_name -> substrate.ateapi.v1.Tag + 33, // 117: substrate.ateapi.v1.CreateTagRequest.tag:type_name -> substrate.ateapi.v1.Tag + 33, // 118: substrate.ateapi.v1.UpdateTagRequest.tag:type_name -> substrate.ateapi.v1.Tag + 35, // 119: substrate.ateapi.v1.DeleteTagRequest.tag:type_name -> substrate.ateapi.v1.ObjectRef + 93, // 120: substrate.ateapi.v1.DeleteTagRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions + 35, // 121: substrate.ateapi.v1.ListWorkerActorAssignmentsRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 95, // 122: substrate.ateapi.v1.ListWorkerActorAssignmentsRequest.options:type_name -> substrate.ateapi.v1.ListOptions + 121, // 123: substrate.ateapi.v1.ListWorkerActorAssignmentsResponse.actor_assignments:type_name -> substrate.ateapi.v1.ActorAssignment + 95, // 124: substrate.ateapi.v1.ListWorkersRequest.options:type_name -> substrate.ateapi.v1.ListOptions + 112, // 125: substrate.ateapi.v1.ListWorkersResponse.workers:type_name -> substrate.ateapi.v1.Worker + 35, // 126: substrate.ateapi.v1.GetWorkerRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 112, // 127: substrate.ateapi.v1.CreateWorkerRequest.worker:type_name -> substrate.ateapi.v1.Worker + 112, // 128: substrate.ateapi.v1.UpdateWorkerRequest.worker:type_name -> substrate.ateapi.v1.Worker + 35, // 129: substrate.ateapi.v1.DeleteWorkerRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 93, // 130: substrate.ateapi.v1.DeleteWorkerRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions + 35, // 131: substrate.ateapi.v1.DrainWorkerRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 94, // 132: substrate.ateapi.v1.DrainWorkerRequest.preconditions:type_name -> substrate.ateapi.v1.Preconditions + 112, // 133: substrate.ateapi.v1.DrainWorkerResponse.worker:type_name -> substrate.ateapi.v1.Worker + 35, // 134: substrate.ateapi.v1.MarkWorkerAvailableRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 94, // 135: substrate.ateapi.v1.MarkWorkerAvailableRequest.preconditions:type_name -> substrate.ateapi.v1.Preconditions + 112, // 136: substrate.ateapi.v1.MarkWorkerAvailableResponse.worker:type_name -> substrate.ateapi.v1.Worker + 35, // 137: substrate.ateapi.v1.MarkWorkerUnavailableRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 94, // 138: substrate.ateapi.v1.MarkWorkerUnavailableRequest.preconditions:type_name -> substrate.ateapi.v1.Preconditions + 112, // 139: substrate.ateapi.v1.MarkWorkerUnavailableResponse.worker:type_name -> substrate.ateapi.v1.Worker + 95, // 140: substrate.ateapi.v1.ListActorsRequest.options:type_name -> substrate.ateapi.v1.ListOptions + 17, // 141: substrate.ateapi.v1.ListActorsResponse.actors:type_name -> substrate.ateapi.v1.Actor + 14, // 142: substrate.ateapi.v1.Worker.metadata:type_name -> substrate.ateapi.v1.ResourceMetadata + 153, // 143: substrate.ateapi.v1.Worker.labels:type_name -> substrate.ateapi.v1.Worker.LabelsEntry + 113, // 144: substrate.ateapi.v1.Worker.status:type_name -> substrate.ateapi.v1.WorkerStatus + 8, // 145: substrate.ateapi.v1.WorkerStatus.state:type_name -> substrate.ateapi.v1.WorkerState + 120, // 146: substrate.ateapi.v1.WorkerStatus.capacity:type_name -> substrate.ateapi.v1.WorkerResources + 120, // 147: substrate.ateapi.v1.WorkerStatus.allocated:type_name -> substrate.ateapi.v1.WorkerResources + 114, // 148: substrate.ateapi.v1.WorkerStatus.sandbox_classes:type_name -> substrate.ateapi.v1.WorkerSandboxClass + 115, // 149: substrate.ateapi.v1.WorkerSandboxClass.default_runtime:type_name -> substrate.ateapi.v1.WorkerSandboxRuntime + 115, // 150: substrate.ateapi.v1.WorkerSandboxClass.restorable_runtimes:type_name -> substrate.ateapi.v1.WorkerSandboxRuntime + 118, // 151: substrate.ateapi.v1.WorkerSandboxRuntime.version:type_name -> substrate.ateapi.v1.VersionedSandboxCompat + 116, // 152: substrate.ateapi.v1.WorkerSandboxRuntime.actor_overhead:type_name -> substrate.ateapi.v1.RuntimeOverhead + 118, // 153: substrate.ateapi.v1.ActorSandboxRuntime.version:type_name -> substrate.ateapi.v1.VersionedSandboxCompat + 119, // 154: substrate.ateapi.v1.VersionedSandboxCompat.attributes:type_name -> substrate.ateapi.v1.AttributeEntry + 14, // 155: substrate.ateapi.v1.ActorAssignment.metadata:type_name -> substrate.ateapi.v1.ResourceMetadata + 35, // 156: substrate.ateapi.v1.ActorAssignment.actor:type_name -> substrate.ateapi.v1.ObjectRef + 38, // 157: substrate.ateapi.v1.ActorAssignment.resources:type_name -> substrate.ateapi.v1.Resources + 35, // 158: substrate.ateapi.v1.AcquireWorkerEpochRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 35, // 159: substrate.ateapi.v1.RegisterWorkerRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 120, // 160: substrate.ateapi.v1.RegisterWorkerRequest.capacity:type_name -> substrate.ateapi.v1.WorkerResources + 112, // 161: substrate.ateapi.v1.RegisterWorkerResponse.worker:type_name -> substrate.ateapi.v1.Worker + 35, // 162: substrate.ateapi.v1.SetWorkerSandboxRuntimesRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 114, // 163: substrate.ateapi.v1.SetWorkerSandboxRuntimesRequest.sandbox_classes:type_name -> substrate.ateapi.v1.WorkerSandboxClass + 112, // 164: substrate.ateapi.v1.SetWorkerSandboxRuntimesResponse.worker:type_name -> substrate.ateapi.v1.Worker + 35, // 165: substrate.ateapi.v1.MintWorkerActorCertificateRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 35, // 166: substrate.ateapi.v1.MintWorkerActorCertificateRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 35, // 167: substrate.ateapi.v1.MintWorkerActorJwtRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 154, // 168: substrate.ateapi.v1.MintWorkerActorJwtResponse.expire_time:type_name -> google.protobuf.Timestamp + 35, // 169: substrate.ateapi.v1.RequestActorSuspendRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 35, // 170: substrate.ateapi.v1.RequestActorSuspendRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 17, // 171: substrate.ateapi.v1.RequestActorSuspendResponse.actor:type_name -> substrate.ateapi.v1.Actor + 35, // 172: substrate.ateapi.v1.ReportActorCrashedRequest.worker:type_name -> substrate.ateapi.v1.ObjectRef + 35, // 173: substrate.ateapi.v1.ReportActorCrashedRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 17, // 174: substrate.ateapi.v1.ReportActorCrashedResponse.actor:type_name -> substrate.ateapi.v1.Actor + 35, // 175: substrate.ateapi.v1.ReportActorSnapshotStateRequest.actor:type_name -> substrate.ateapi.v1.ObjectRef + 138, // 176: substrate.ateapi.v1.ReportActorSnapshotStateRequest.state:type_name -> substrate.ateapi.v1.ActorSnapshotState + 139, // 177: substrate.ateapi.v1.ActorSnapshotState.latest_local:type_name -> substrate.ateapi.v1.SnapshotReport + 139, // 178: substrate.ateapi.v1.ActorSnapshotState.uploading:type_name -> substrate.ateapi.v1.SnapshotReport + 139, // 179: substrate.ateapi.v1.ActorSnapshotState.latest_durable:type_name -> substrate.ateapi.v1.SnapshotReport + 154, // 180: substrate.ateapi.v1.ActorSnapshotState.upload_due_time:type_name -> google.protobuf.Timestamp + 2, // 181: substrate.ateapi.v1.SnapshotReport.fidelity:type_name -> substrate.ateapi.v1.SnapshotFidelity + 10, // 182: substrate.ateapi.v1.SnapshotReport.object:type_name -> substrate.ateapi.v1.ObjectSnapshot + 154, // 183: substrate.ateapi.v1.SnapshotReport.local_commit_time:type_name -> google.protobuf.Timestamp + 154, // 184: substrate.ateapi.v1.SnapshotReport.durable_complete_time:type_name -> google.protobuf.Timestamp + 14, // 185: substrate.ateapi.v1.AccessPolicy.metadata:type_name -> substrate.ateapi.v1.ResourceMetadata + 141, // 186: substrate.ateapi.v1.AccessPolicy.bindings:type_name -> substrate.ateapi.v1.Binding + 140, // 187: substrate.ateapi.v1.CreateGlobalAccessPolicyRequest.access_policy:type_name -> substrate.ateapi.v1.AccessPolicy + 140, // 188: substrate.ateapi.v1.UpdateGlobalAccessPolicyRequest.access_policy:type_name -> substrate.ateapi.v1.AccessPolicy + 35, // 189: substrate.ateapi.v1.GetAtespaceAccessPolicyRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef + 35, // 190: substrate.ateapi.v1.CreateAtespaceAccessPolicyRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef + 140, // 191: substrate.ateapi.v1.CreateAtespaceAccessPolicyRequest.access_policy:type_name -> substrate.ateapi.v1.AccessPolicy + 35, // 192: substrate.ateapi.v1.UpdateAtespaceAccessPolicyRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef + 140, // 193: substrate.ateapi.v1.UpdateAtespaceAccessPolicyRequest.access_policy:type_name -> substrate.ateapi.v1.AccessPolicy + 35, // 194: substrate.ateapi.v1.DeleteAtespaceAccessPolicyRequest.atespace:type_name -> substrate.ateapi.v1.ObjectRef + 93, // 195: substrate.ateapi.v1.DeleteAtespaceAccessPolicyRequest.options:type_name -> substrate.ateapi.v1.DeleteOptions + 9, // 196: substrate.ateapi.v1.ResourceAnnotation.scope:type_name -> substrate.ateapi.v1.Scope + 155, // 197: substrate.ateapi.v1.resource:extendee -> google.protobuf.MessageOptions + 156, // 198: substrate.ateapi.v1.method:extendee -> google.protobuf.MethodOptions + 149, // 199: substrate.ateapi.v1.resource:type_name -> substrate.ateapi.v1.ResourceAnnotation + 150, // 200: substrate.ateapi.v1.method:type_name -> substrate.ateapi.v1.MethodAnnotation + 70, // 201: substrate.ateapi.v1.Control.GetActor:input_type -> substrate.ateapi.v1.GetActorRequest + 71, // 202: substrate.ateapi.v1.Control.CreateActor:input_type -> substrate.ateapi.v1.CreateActorRequest + 72, // 203: substrate.ateapi.v1.Control.UpdateActor:input_type -> substrate.ateapi.v1.UpdateActorRequest + 73, // 204: substrate.ateapi.v1.Control.SuspendActor:input_type -> substrate.ateapi.v1.SuspendActorRequest + 76, // 205: substrate.ateapi.v1.Control.ResumeActor:input_type -> substrate.ateapi.v1.ResumeActorRequest + 78, // 206: substrate.ateapi.v1.Control.RevertActor:input_type -> substrate.ateapi.v1.RevertActorRequest + 80, // 207: substrate.ateapi.v1.Control.DeleteActor:input_type -> substrate.ateapi.v1.DeleteActorRequest + 81, // 208: substrate.ateapi.v1.Control.GetActorEgressPolicy:input_type -> substrate.ateapi.v1.GetActorEgressPolicyRequest + 82, // 209: substrate.ateapi.v1.Control.CreateActorEgressPolicy:input_type -> substrate.ateapi.v1.CreateActorEgressPolicyRequest + 83, // 210: substrate.ateapi.v1.Control.UpdateActorEgressPolicy:input_type -> substrate.ateapi.v1.UpdateActorEgressPolicyRequest + 84, // 211: substrate.ateapi.v1.Control.DeleteActorEgressPolicy:input_type -> substrate.ateapi.v1.DeleteActorEgressPolicyRequest + 86, // 212: substrate.ateapi.v1.Control.MintActorJwt:input_type -> substrate.ateapi.v1.MintActorJwtRequest + 90, // 213: substrate.ateapi.v1.Control.CreateTag:input_type -> substrate.ateapi.v1.CreateTagRequest + 85, // 214: substrate.ateapi.v1.Control.GetTag:input_type -> substrate.ateapi.v1.GetTagRequest + 88, // 215: substrate.ateapi.v1.Control.ListTags:input_type -> substrate.ateapi.v1.ListTagsRequest + 91, // 216: substrate.ateapi.v1.Control.UpdateTag:input_type -> substrate.ateapi.v1.UpdateTagRequest + 92, // 217: substrate.ateapi.v1.Control.DeleteTag:input_type -> substrate.ateapi.v1.DeleteTagRequest + 98, // 218: substrate.ateapi.v1.Control.ListWorkers:input_type -> substrate.ateapi.v1.ListWorkersRequest + 100, // 219: substrate.ateapi.v1.Control.GetWorker:input_type -> substrate.ateapi.v1.GetWorkerRequest + 101, // 220: substrate.ateapi.v1.Control.CreateWorker:input_type -> substrate.ateapi.v1.CreateWorkerRequest + 102, // 221: substrate.ateapi.v1.Control.UpdateWorker:input_type -> substrate.ateapi.v1.UpdateWorkerRequest + 103, // 222: substrate.ateapi.v1.Control.DeleteWorker:input_type -> substrate.ateapi.v1.DeleteWorkerRequest + 104, // 223: substrate.ateapi.v1.Control.DrainWorker:input_type -> substrate.ateapi.v1.DrainWorkerRequest + 106, // 224: substrate.ateapi.v1.Control.MarkWorkerAvailable:input_type -> substrate.ateapi.v1.MarkWorkerAvailableRequest + 108, // 225: substrate.ateapi.v1.Control.MarkWorkerUnavailable:input_type -> substrate.ateapi.v1.MarkWorkerUnavailableRequest + 96, // 226: substrate.ateapi.v1.Control.ListWorkerActorAssignments:input_type -> substrate.ateapi.v1.ListWorkerActorAssignmentsRequest + 110, // 227: substrate.ateapi.v1.Control.ListActors:input_type -> substrate.ateapi.v1.ListActorsRequest + 60, // 228: substrate.ateapi.v1.Control.CreateAtespace:input_type -> substrate.ateapi.v1.CreateAtespaceRequest + 61, // 229: substrate.ateapi.v1.Control.GetAtespace:input_type -> substrate.ateapi.v1.GetAtespaceRequest + 62, // 230: substrate.ateapi.v1.Control.ListAtespaces:input_type -> substrate.ateapi.v1.ListAtespacesRequest + 64, // 231: substrate.ateapi.v1.Control.DeleteAtespace:input_type -> substrate.ateapi.v1.DeleteAtespaceRequest + 65, // 232: substrate.ateapi.v1.Control.CreateActorTemplate:input_type -> substrate.ateapi.v1.CreateActorTemplateRequest + 66, // 233: substrate.ateapi.v1.Control.GetActorTemplate:input_type -> substrate.ateapi.v1.GetActorTemplateRequest + 67, // 234: substrate.ateapi.v1.Control.ListActorTemplates:input_type -> substrate.ateapi.v1.ListActorTemplatesRequest + 69, // 235: substrate.ateapi.v1.Control.DeleteActorTemplate:input_type -> substrate.ateapi.v1.DeleteActorTemplateRequest + 142, // 236: substrate.ateapi.v1.Control.GetGlobalAccessPolicy:input_type -> substrate.ateapi.v1.GetGlobalAccessPolicyRequest + 143, // 237: substrate.ateapi.v1.Control.CreateGlobalAccessPolicy:input_type -> substrate.ateapi.v1.CreateGlobalAccessPolicyRequest + 144, // 238: substrate.ateapi.v1.Control.UpdateGlobalAccessPolicy:input_type -> substrate.ateapi.v1.UpdateGlobalAccessPolicyRequest + 145, // 239: substrate.ateapi.v1.Control.GetAtespaceAccessPolicy:input_type -> substrate.ateapi.v1.GetAtespaceAccessPolicyRequest + 146, // 240: substrate.ateapi.v1.Control.CreateAtespaceAccessPolicy:input_type -> substrate.ateapi.v1.CreateAtespaceAccessPolicyRequest + 147, // 241: substrate.ateapi.v1.Control.UpdateAtespaceAccessPolicy:input_type -> substrate.ateapi.v1.UpdateAtespaceAccessPolicyRequest + 148, // 242: substrate.ateapi.v1.Control.DeleteAtespaceAccessPolicy:input_type -> substrate.ateapi.v1.DeleteAtespaceAccessPolicyRequest + 122, // 243: substrate.ateapi.v1.WorkerService.AcquireWorkerEpoch:input_type -> substrate.ateapi.v1.AcquireWorkerEpochRequest + 124, // 244: substrate.ateapi.v1.WorkerService.RegisterWorker:input_type -> substrate.ateapi.v1.RegisterWorkerRequest + 126, // 245: substrate.ateapi.v1.WorkerService.SetWorkerSandboxRuntimes:input_type -> substrate.ateapi.v1.SetWorkerSandboxRuntimesRequest + 128, // 246: substrate.ateapi.v1.WorkerService.MintWorkerActorCertificate:input_type -> substrate.ateapi.v1.MintWorkerActorCertificateRequest + 130, // 247: substrate.ateapi.v1.WorkerService.MintWorkerActorJwt:input_type -> substrate.ateapi.v1.MintWorkerActorJwtRequest + 132, // 248: substrate.ateapi.v1.WorkerService.RequestActorSuspend:input_type -> substrate.ateapi.v1.RequestActorSuspendRequest + 136, // 249: substrate.ateapi.v1.WorkerService.ReportActorSnapshotState:input_type -> substrate.ateapi.v1.ReportActorSnapshotStateRequest + 134, // 250: substrate.ateapi.v1.WorkerService.ReportActorCrashed:input_type -> substrate.ateapi.v1.ReportActorCrashedRequest + 17, // 251: substrate.ateapi.v1.Control.GetActor:output_type -> substrate.ateapi.v1.Actor + 17, // 252: substrate.ateapi.v1.Control.CreateActor:output_type -> substrate.ateapi.v1.Actor + 17, // 253: substrate.ateapi.v1.Control.UpdateActor:output_type -> substrate.ateapi.v1.Actor + 74, // 254: substrate.ateapi.v1.Control.SuspendActor:output_type -> substrate.ateapi.v1.SuspendActorResponse + 77, // 255: substrate.ateapi.v1.Control.ResumeActor:output_type -> substrate.ateapi.v1.ResumeActorResponse + 79, // 256: substrate.ateapi.v1.Control.RevertActor:output_type -> substrate.ateapi.v1.RevertActorResponse + 17, // 257: substrate.ateapi.v1.Control.DeleteActor:output_type -> substrate.ateapi.v1.Actor + 18, // 258: substrate.ateapi.v1.Control.GetActorEgressPolicy:output_type -> substrate.ateapi.v1.EgressPolicy + 18, // 259: substrate.ateapi.v1.Control.CreateActorEgressPolicy:output_type -> substrate.ateapi.v1.EgressPolicy + 18, // 260: substrate.ateapi.v1.Control.UpdateActorEgressPolicy:output_type -> substrate.ateapi.v1.EgressPolicy + 18, // 261: substrate.ateapi.v1.Control.DeleteActorEgressPolicy:output_type -> substrate.ateapi.v1.EgressPolicy + 87, // 262: substrate.ateapi.v1.Control.MintActorJwt:output_type -> substrate.ateapi.v1.MintActorJwtResponse + 33, // 263: substrate.ateapi.v1.Control.CreateTag:output_type -> substrate.ateapi.v1.Tag + 33, // 264: substrate.ateapi.v1.Control.GetTag:output_type -> substrate.ateapi.v1.Tag + 89, // 265: substrate.ateapi.v1.Control.ListTags:output_type -> substrate.ateapi.v1.ListTagsResponse + 33, // 266: substrate.ateapi.v1.Control.UpdateTag:output_type -> substrate.ateapi.v1.Tag + 33, // 267: substrate.ateapi.v1.Control.DeleteTag:output_type -> substrate.ateapi.v1.Tag + 99, // 268: substrate.ateapi.v1.Control.ListWorkers:output_type -> substrate.ateapi.v1.ListWorkersResponse + 112, // 269: substrate.ateapi.v1.Control.GetWorker:output_type -> substrate.ateapi.v1.Worker + 112, // 270: substrate.ateapi.v1.Control.CreateWorker:output_type -> substrate.ateapi.v1.Worker + 112, // 271: substrate.ateapi.v1.Control.UpdateWorker:output_type -> substrate.ateapi.v1.Worker + 112, // 272: substrate.ateapi.v1.Control.DeleteWorker:output_type -> substrate.ateapi.v1.Worker + 105, // 273: substrate.ateapi.v1.Control.DrainWorker:output_type -> substrate.ateapi.v1.DrainWorkerResponse + 107, // 274: substrate.ateapi.v1.Control.MarkWorkerAvailable:output_type -> substrate.ateapi.v1.MarkWorkerAvailableResponse + 109, // 275: substrate.ateapi.v1.Control.MarkWorkerUnavailable:output_type -> substrate.ateapi.v1.MarkWorkerUnavailableResponse + 97, // 276: substrate.ateapi.v1.Control.ListWorkerActorAssignments:output_type -> substrate.ateapi.v1.ListWorkerActorAssignmentsResponse + 111, // 277: substrate.ateapi.v1.Control.ListActors:output_type -> substrate.ateapi.v1.ListActorsResponse + 34, // 278: substrate.ateapi.v1.Control.CreateAtespace:output_type -> substrate.ateapi.v1.Atespace + 34, // 279: substrate.ateapi.v1.Control.GetAtespace:output_type -> substrate.ateapi.v1.Atespace + 63, // 280: substrate.ateapi.v1.Control.ListAtespaces:output_type -> substrate.ateapi.v1.ListAtespacesResponse + 34, // 281: substrate.ateapi.v1.Control.DeleteAtespace:output_type -> substrate.ateapi.v1.Atespace + 36, // 282: substrate.ateapi.v1.Control.CreateActorTemplate:output_type -> substrate.ateapi.v1.ActorTemplate + 36, // 283: substrate.ateapi.v1.Control.GetActorTemplate:output_type -> substrate.ateapi.v1.ActorTemplate + 68, // 284: substrate.ateapi.v1.Control.ListActorTemplates:output_type -> substrate.ateapi.v1.ListActorTemplatesResponse + 36, // 285: substrate.ateapi.v1.Control.DeleteActorTemplate:output_type -> substrate.ateapi.v1.ActorTemplate + 140, // 286: substrate.ateapi.v1.Control.GetGlobalAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy + 140, // 287: substrate.ateapi.v1.Control.CreateGlobalAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy + 140, // 288: substrate.ateapi.v1.Control.UpdateGlobalAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy + 140, // 289: substrate.ateapi.v1.Control.GetAtespaceAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy + 140, // 290: substrate.ateapi.v1.Control.CreateAtespaceAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy + 140, // 291: substrate.ateapi.v1.Control.UpdateAtespaceAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy + 140, // 292: substrate.ateapi.v1.Control.DeleteAtespaceAccessPolicy:output_type -> substrate.ateapi.v1.AccessPolicy + 123, // 293: substrate.ateapi.v1.WorkerService.AcquireWorkerEpoch:output_type -> substrate.ateapi.v1.AcquireWorkerEpochResponse + 125, // 294: substrate.ateapi.v1.WorkerService.RegisterWorker:output_type -> substrate.ateapi.v1.RegisterWorkerResponse + 127, // 295: substrate.ateapi.v1.WorkerService.SetWorkerSandboxRuntimes:output_type -> substrate.ateapi.v1.SetWorkerSandboxRuntimesResponse + 129, // 296: substrate.ateapi.v1.WorkerService.MintWorkerActorCertificate:output_type -> substrate.ateapi.v1.MintWorkerActorCertificateResponse + 131, // 297: substrate.ateapi.v1.WorkerService.MintWorkerActorJwt:output_type -> substrate.ateapi.v1.MintWorkerActorJwtResponse + 133, // 298: substrate.ateapi.v1.WorkerService.RequestActorSuspend:output_type -> substrate.ateapi.v1.RequestActorSuspendResponse + 137, // 299: substrate.ateapi.v1.WorkerService.ReportActorSnapshotState:output_type -> substrate.ateapi.v1.ReportActorSnapshotStateResponse + 135, // 300: substrate.ateapi.v1.WorkerService.ReportActorCrashed:output_type -> substrate.ateapi.v1.ReportActorCrashedResponse + 251, // [251:301] is the sub-list for method output_type + 201, // [201:251] is the sub-list for method input_type + 199, // [199:201] is the sub-list for extension type_name + 197, // [197:199] is the sub-list for extension extendee + 0, // [0:197] is the sub-list for field type_name } func init() { file_api_ateapi_v1_ateapi_proto_init() } @@ -11143,7 +11290,7 @@ func file_api_ateapi_v1_ateapi_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_ateapi_v1_ateapi_proto_rawDesc), len(file_api_ateapi_v1_ateapi_proto_rawDesc)), NumEnums: 10, - NumMessages: 143, + NumMessages: 144, NumExtensions: 2, NumServices: 2, }, diff --git a/api/ateapi/v1/ateapi.proto b/api/ateapi/v1/ateapi.proto index f1b1fbdca4..64ae2c0ccb 100644 --- a/api/ateapi/v1/ateapi.proto +++ b/api/ateapi/v1/ateapi.proto @@ -39,7 +39,8 @@ service Control { } // Suspend a given actor to a new snapshot. A running actor is checkpointed - // on its worker. A SUSPENDED actor is returned as it is. + // on its worker. A SUSPENDED actor is returned as it is, unless a + // preconditions guard does not match. rpc SuspendActor(SuspendActorRequest) returns (SuspendActorResponse) { option (method).resource = "Actor"; } @@ -1814,6 +1815,11 @@ message SuspendActorRequest { // // +k8s:optional SuspendOptions options = 2; + + // Act only if the actor still matches these guards. + // + // +k8s:optional + Preconditions preconditions = 3; } message SuspendActorResponse { @@ -1852,6 +1858,11 @@ message ResumeActorRequest { // +k8s:required // +k8s:subfield(atespace)=+k8s:required ObjectRef actor = 1; + + // Act only if the actor still matches these guards. + // + // +k8s:optional + Preconditions preconditions = 2; } message ResumeActorResponse { @@ -1868,6 +1879,11 @@ message RevertActorRequest { // +k8s:required // +k8s:subfield(atespace)=+k8s:required ObjectRef actor = 1; + + // Act only if the actor still matches these guards. + // + // +k8s:optional + Preconditions preconditions = 2; } // RevertActorResponse holds the reverted Actor. @@ -2103,6 +2119,25 @@ message DeleteOptions { string uid = 2; } +// Preconditions are the optional guards a custom method request may carry. +// A guard that does not match the resource fails the request with `ABORTED`. +message Preconditions { + // Act only if the resource is still at this version, that is, unchanged + // since the caller read it. Zero skips the check. + // + // +k8s:optional + // +k8s:minimum=1 + int64 version = 1; + + // Act only if the resource still has this uid, that is, it is the one + // the caller read and not a later one created under the same name. Empty + // skips the check. + // + // +k8s:optional + // +k8s:format=k8s-uuid + string uid = 2; +} + // ListOptions are the pagination controls a List request may carry. message ListOptions { // Requested page size; the server may return fewer, or occasionally @@ -2214,6 +2249,11 @@ message DrainWorkerRequest { // +k8s:required // +k8s:beta(since: "0.0")=+k8s:subfield(atespace)=+k8s:forbidden # TODO: get rid of beta prefix ObjectRef worker = 1; + + // Act only if the Worker still matches these guards. + // + // +k8s:optional + Preconditions preconditions = 2; } // DrainWorkerResponse holds the drained Worker. @@ -2229,6 +2269,11 @@ message MarkWorkerAvailableRequest { // +k8s:required // +k8s:beta(since: "0.0")=+k8s:subfield(atespace)=+k8s:forbidden # TODO: get rid of beta prefix ObjectRef worker = 1; + + // Act only if the Worker still matches these guards. + // + // +k8s:optional + Preconditions preconditions = 2; } // MarkWorkerAvailableResponse holds the Worker marked ACTIVE. @@ -2244,6 +2289,11 @@ message MarkWorkerUnavailableRequest { // +k8s:required // +k8s:beta(since: "0.0")=+k8s:subfield(atespace)=+k8s:forbidden # TODO: get rid of beta prefix ObjectRef worker = 1; + + // Act only if the Worker still matches these guards. + // + // +k8s:optional + Preconditions preconditions = 2; } // MarkWorkerUnavailableResponse holds the Worker marked UNAVAILABLE. diff --git a/api/ateapi/v1/ateapi_grpc.pb.go b/api/ateapi/v1/ateapi_grpc.pb.go index e54c306d67..092a63b639 100644 --- a/api/ateapi/v1/ateapi_grpc.pb.go +++ b/api/ateapi/v1/ateapi_grpc.pb.go @@ -90,7 +90,8 @@ type ControlClient interface { // Update mutable fields on an existing Actor. UpdateActor(ctx context.Context, in *UpdateActorRequest, opts ...grpc.CallOption) (*Actor, error) // Suspend a given actor to a new snapshot. A running actor is checkpointed - // on its worker. A SUSPENDED actor is returned as it is. + // on its worker. A SUSPENDED actor is returned as it is, unless a + // preconditions guard does not match. SuspendActor(ctx context.Context, in *SuspendActorRequest, opts ...grpc.CallOption) (*SuspendActorResponse, error) // Resume an actor from its latest snapshot. ResumeActor(ctx context.Context, in *ResumeActorRequest, opts ...grpc.CallOption) (*ResumeActorResponse, error) @@ -638,7 +639,8 @@ type ControlServer interface { // Update mutable fields on an existing Actor. UpdateActor(context.Context, *UpdateActorRequest) (*Actor, error) // Suspend a given actor to a new snapshot. A running actor is checkpointed - // on its worker. A SUSPENDED actor is returned as it is. + // on its worker. A SUSPENDED actor is returned as it is, unless a + // preconditions guard does not match. SuspendActor(context.Context, *SuspendActorRequest) (*SuspendActorResponse, error) // Resume an actor from its latest snapshot. ResumeActor(context.Context, *ResumeActorRequest) (*ResumeActorResponse, error) diff --git a/cmd/ateapi/internal/apivalidation/actor_test.go b/cmd/ateapi/internal/apivalidation/actor_test.go index 3c5595f15c..55167e80f3 100644 --- a/cmd/ateapi/internal/apivalidation/actor_test.go +++ b/cmd/ateapi/internal/apivalidation/actor_test.go @@ -952,6 +952,27 @@ func TestValidateResumeActorRequest(t *testing.T) { "invalid actor.name", &ateapi.ResumeActorRequest{Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "ID1"}}, field.ErrorList{field.Invalid(field.NewPath("actor", "name"), "ID1", "").WithOrigin("format=k8s-short-name")}, + }, { + "valid preconditions", + &ateapi.ResumeActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Uid: someActorUID, Version: 3}, + }, + nil, + }, { + "invalid preconditions.uid", + &ateapi.ResumeActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Uid: "not-a-uuid"}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "uid"), nil, "").WithOrigin("format=k8s-uuid")}, + }, { + "negative preconditions.version", + &ateapi.ResumeActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Version: -1}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "version"), nil, "").WithOrigin("minimum")}, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1024,6 +1045,27 @@ func TestValidateSuspendActorRequest(t *testing.T) { Options: &ateapi.SuspendOptions{Mode: ateapi.DurabilityMode(3)}, }, field.ErrorList{field.Invalid(field.NewPath("options", "mode"), nil, "").WithOrigin("maximum")}, + }, { + "valid preconditions", + &ateapi.SuspendActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Uid: someActorUID, Version: 3}, + }, + nil, + }, { + "invalid preconditions.uid", + &ateapi.SuspendActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Uid: "not-a-uuid"}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "uid"), nil, "").WithOrigin("format=k8s-uuid")}, + }, { + "negative preconditions.version", + &ateapi.SuspendActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Version: -1}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "version"), nil, "").WithOrigin("minimum")}, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -1032,6 +1074,48 @@ func TestValidateSuspendActorRequest(t *testing.T) { } } +func TestValidateRevertActorRequest(t *testing.T) { + tests := []struct { + name string + req *ateapi.RevertActorRequest + want field.ErrorList + }{{ + "valid", + &ateapi.RevertActorRequest{Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}}, + nil, + }, { + "missing actor", + &ateapi.RevertActorRequest{}, + field.ErrorList{field.Required(field.NewPath("actor"), "")}, + }, { + "valid preconditions", + &ateapi.RevertActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Uid: someActorUID, Version: 3}, + }, + nil, + }, { + "invalid preconditions.uid", + &ateapi.RevertActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Uid: "not-a-uuid"}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "uid"), nil, "").WithOrigin("format=k8s-uuid")}, + }, { + "negative preconditions.version", + &ateapi.RevertActorRequest{ + Actor: &ateapi.ObjectRef{Atespace: "ns1", Name: "id1"}, + Preconditions: &ateapi.Preconditions{Version: -1}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "version"), nil, "").WithOrigin("minimum")}, + }} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assertValidateErr(t, ValidateRevertActorRequest(context.Background(), tt.req), tt.want) + }) + } +} + // validActor returns a minimal Actor which should pass input validation. func validActor(mods ...func(*ateapi.Actor)) *ateapi.Actor { a := &ateapi.Actor{ diff --git a/cmd/ateapi/internal/apivalidation/validation_test.go b/cmd/ateapi/internal/apivalidation/validation_test.go index 6534715a8c..33396e3a01 100644 --- a/cmd/ateapi/internal/apivalidation/validation_test.go +++ b/cmd/ateapi/internal/apivalidation/validation_test.go @@ -1014,45 +1014,48 @@ func TestValidateExternalVolume_Update(t *testing.T) { } } -func TestValidateDeleteOptions(t *testing.T) { - valid := func(mutate ...func(*ateapi.DeleteOptions)) *ateapi.DeleteOptions { - tb := &ateapi.DeleteOptions{} - for _, m := range mutate { - m(tb) - } - return tb +// TestValidateGuards covers DeleteOptions and Preconditions, which carry the +// same optional guards. +func TestValidateGuards(t *testing.T) { + validators := map[string]func(version int64, uid string) field.ErrorList{ + "DeleteOptions": func(version int64, uid string) field.ErrorList { + ctx := context.Background() + return Validate_DeleteOptions(ctx, MakeCreateOp(ctx), nil, &ateapi.DeleteOptions{Version: version, Uid: uid}, nil) + }, + "Preconditions": func(version int64, uid string) field.ErrorList { + ctx := context.Background() + return Validate_Preconditions(ctx, MakeCreateOp(ctx), nil, &ateapi.Preconditions{Version: version, Uid: uid}, nil) + }, } - tests := []struct { - name string - obj *ateapi.DeleteOptions - want field.ErrorList + name string + version int64 + uid string + want field.ErrorList }{{ - name: "valid", - obj: valid(), // all optional fields + name: "valid", // all optional fields }, { - name: "valid version", - obj: valid(func(do *ateapi.DeleteOptions) { do.Version = 1 }), - want: nil, + name: "valid version", + version: 1, }, { - name: "invalid version", - obj: valid(func(do *ateapi.DeleteOptions) { do.Version = -1 }), - want: field.ErrorList{field.Invalid(field.NewPath("version"), nil, "").WithOrigin("minimum")}, + name: "invalid version", + version: -1, + want: field.ErrorList{field.Invalid(field.NewPath("version"), nil, "").WithOrigin("minimum")}, }, { name: "valid uid", - obj: valid(func(do *ateapi.DeleteOptions) { do.Uid = "11111111-2222-3333-4444-555555555555" }), - want: nil, + uid: "11111111-2222-3333-4444-555555555555", }, { name: "invalid uid", - obj: valid(func(do *ateapi.DeleteOptions) { do.Uid = "not a uid" }), + uid: "not a uid", want: field.ErrorList{field.Invalid(field.NewPath("uid"), nil, "").WithOrigin("format=k8s-uuid")}, }} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - op := MakeCreateOp(context.Background()) - matcher := field.ErrorMatcher{}.ByType().ByField().ByOrigin() - matcher.Test(t, tt.want, Validate_DeleteOptions(context.Background(), op, nil, tt.obj, nil)) - }) + for msg, validate := range validators { + for _, tt := range tests { + t.Run(msg+"/"+tt.name, func(t *testing.T) { + matcher := field.ErrorMatcher{}.ByType().ByField().ByOrigin() + matcher.Test(t, tt.want, validate(tt.version, tt.uid)) + }) + } } } diff --git a/cmd/ateapi/internal/apivalidation/worker_test.go b/cmd/ateapi/internal/apivalidation/worker_test.go index e87ee2f159..92ad0069fb 100644 --- a/cmd/ateapi/internal/apivalidation/worker_test.go +++ b/cmd/ateapi/internal/apivalidation/worker_test.go @@ -266,6 +266,132 @@ func TestValidateDeleteWorkerRequest(t *testing.T) { } } +func TestValidateDrainWorkerRequest(t *testing.T) { + tests := []struct { + name string + req *ateapi.DrainWorkerRequest + want field.ErrorList + }{{ + "valid, no preconditions", + &ateapi.DrainWorkerRequest{Worker: workerRef(apiWorkerName)}, + nil, + }, { + "valid, both guards", + &ateapi.DrainWorkerRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Uid: apiOtherWorkerName, Version: 3}, + }, + nil, + }, { + "missing worker", + &ateapi.DrainWorkerRequest{}, + field.ErrorList{field.Required(field.NewPath("worker"), "")}, + }, { + "invalid preconditions.uid", + &ateapi.DrainWorkerRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Uid: "not-a-uuid"}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "uid"), nil, "").WithOrigin("format=k8s-uuid")}, + }, { + "negative preconditions.version", + &ateapi.DrainWorkerRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Version: -1}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "version"), nil, "").WithOrigin("minimum")}, + }} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assertValidateErr(t, ValidateDrainWorkerRequest(context.Background(), tt.req), tt.want) + }) + } +} + +func TestValidateMarkWorkerAvailableRequest(t *testing.T) { + tests := []struct { + name string + req *ateapi.MarkWorkerAvailableRequest + want field.ErrorList + }{{ + "valid, no preconditions", + &ateapi.MarkWorkerAvailableRequest{Worker: workerRef(apiWorkerName)}, + nil, + }, { + "valid, both guards", + &ateapi.MarkWorkerAvailableRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Uid: apiOtherWorkerName, Version: 3}, + }, + nil, + }, { + "missing worker", + &ateapi.MarkWorkerAvailableRequest{}, + field.ErrorList{field.Required(field.NewPath("worker"), "")}, + }, { + "invalid preconditions.uid", + &ateapi.MarkWorkerAvailableRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Uid: "not-a-uuid"}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "uid"), nil, "").WithOrigin("format=k8s-uuid")}, + }, { + "negative preconditions.version", + &ateapi.MarkWorkerAvailableRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Version: -1}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "version"), nil, "").WithOrigin("minimum")}, + }} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assertValidateErr(t, ValidateMarkWorkerAvailableRequest(context.Background(), tt.req), tt.want) + }) + } +} + +func TestValidateMarkWorkerUnavailableRequest(t *testing.T) { + tests := []struct { + name string + req *ateapi.MarkWorkerUnavailableRequest + want field.ErrorList + }{{ + "valid, no preconditions", + &ateapi.MarkWorkerUnavailableRequest{Worker: workerRef(apiWorkerName)}, + nil, + }, { + "valid, both guards", + &ateapi.MarkWorkerUnavailableRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Uid: apiOtherWorkerName, Version: 3}, + }, + nil, + }, { + "missing worker", + &ateapi.MarkWorkerUnavailableRequest{}, + field.ErrorList{field.Required(field.NewPath("worker"), "")}, + }, { + "invalid preconditions.uid", + &ateapi.MarkWorkerUnavailableRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Uid: "not-a-uuid"}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "uid"), nil, "").WithOrigin("format=k8s-uuid")}, + }, { + "negative preconditions.version", + &ateapi.MarkWorkerUnavailableRequest{ + Worker: workerRef(apiWorkerName), + Preconditions: &ateapi.Preconditions{Version: -1}, + }, + field.ErrorList{field.Invalid(field.NewPath("preconditions", "version"), nil, "").WithOrigin("minimum")}, + }} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assertValidateErr(t, ValidateMarkWorkerUnavailableRequest(context.Background(), tt.req), tt.want) + }) + } +} + func TestValidateUpdateWorkerRequest(t *testing.T) { // This test verifies validation of user input for update. The worker body // is deliberately not descended into here (updates are validated in two diff --git a/cmd/ateapi/internal/apivalidation/zz_generated.validation.go b/cmd/ateapi/internal/apivalidation/zz_generated.validation.go index 1094393d19..0aecd87a5c 100644 --- a/cmd/ateapi/internal/apivalidation/zz_generated.validation.go +++ b/cmd/ateapi/internal/apivalidation/zz_generated.validation.go @@ -3535,6 +3535,36 @@ func Validate_DrainWorkerRequest( errs = append(errs, fn(fldPath.Child("worker"), obj.Worker, oldVal, oldObj != nil)...) } + { // field v1.DrainWorkerRequest.Preconditions + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Preconditions, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if ateDeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_Preconditions(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.DrainWorkerRequest) *v1.Preconditions { + return oldObj.Preconditions + }) + errs = append(errs, fn(fldPath.Child("preconditions"), obj.Preconditions, oldVal, oldObj != nil)...) + } + return errs } @@ -5816,6 +5846,36 @@ func Validate_MarkWorkerAvailableRequest( errs = append(errs, fn(fldPath.Child("worker"), obj.Worker, oldVal, oldObj != nil)...) } + { // field v1.MarkWorkerAvailableRequest.Preconditions + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Preconditions, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if ateDeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_Preconditions(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.MarkWorkerAvailableRequest) *v1.Preconditions { + return oldObj.Preconditions + }) + errs = append(errs, fn(fldPath.Child("preconditions"), obj.Preconditions, oldVal, oldObj != nil)...) + } + return errs } @@ -5875,6 +5935,36 @@ func Validate_MarkWorkerUnavailableRequest( errs = append(errs, fn(fldPath.Child("worker"), obj.Worker, oldVal, oldObj != nil)...) } + { // field v1.MarkWorkerUnavailableRequest.Preconditions + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Preconditions, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if ateDeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_Preconditions(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.MarkWorkerUnavailableRequest) *v1.Preconditions { + return oldObj.Preconditions + }) + errs = append(errs, fn(fldPath.Child("preconditions"), obj.Preconditions, oldVal, oldObj != nil)...) + } + return errs } @@ -6517,6 +6607,77 @@ func Validate_Ports( return errs } +// Validate_Preconditions validates an instance of Preconditions according +// to declarative validation rules in the API schema. +func Validate_Preconditions( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *v1.Preconditions) (errs field.ErrorList) { + + { // field v1.Preconditions.Version + fn := func( + fldPath *field.Path, + obj, oldObj *int64, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 1); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.Preconditions) *int64 { + return &oldObj.Version + }) + errs = append(errs, fn(fldPath.Child("version"), &obj.Version, oldVal, oldObj != nil)...) + } + + { // field v1.Preconditions.Uid + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.UUID(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.Preconditions) *string { + return &oldObj.Uid + }) + errs = append(errs, fn(fldPath.Child("uid"), &obj.Uid, oldVal, oldObj != nil)...) + } + + return errs +} + // Validate_RegisterWorkerRequest validates an instance of RegisterWorkerRequest according // to declarative validation rules in the API schema. func Validate_RegisterWorkerRequest( @@ -7520,6 +7681,36 @@ func Validate_ResumeActorRequest( errs = append(errs, fn(fldPath.Child("actor"), obj.Actor, oldVal, oldObj != nil)...) } + { // field v1.ResumeActorRequest.Preconditions + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Preconditions, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if ateDeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_Preconditions(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ResumeActorRequest) *v1.Preconditions { + return oldObj.Preconditions + }) + errs = append(errs, fn(fldPath.Child("preconditions"), obj.Preconditions, oldVal, oldObj != nil)...) + } + return errs } @@ -7575,6 +7766,36 @@ func Validate_RevertActorRequest( errs = append(errs, fn(fldPath.Child("actor"), obj.Actor, oldVal, oldObj != nil)...) } + { // field v1.RevertActorRequest.Preconditions + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Preconditions, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if ateDeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_Preconditions(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.RevertActorRequest) *v1.Preconditions { + return oldObj.Preconditions + }) + errs = append(errs, fn(fldPath.Child("preconditions"), obj.Preconditions, oldVal, oldObj != nil)...) + } + return errs } @@ -8630,6 +8851,36 @@ func Validate_SuspendActorRequest( errs = append(errs, fn(fldPath.Child("options"), obj.Options, oldVal, oldObj != nil)...) } + { // field v1.SuspendActorRequest.Preconditions + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Preconditions, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if ateDeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_Preconditions(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.SuspendActorRequest) *v1.Preconditions { + return oldObj.Preconditions + }) + errs = append(errs, fn(fldPath.Child("preconditions"), obj.Preconditions, oldVal, oldObj != nil)...) + } + return errs } diff --git a/cmd/ateapi/internal/controlapi/actor.go b/cmd/ateapi/internal/controlapi/actor.go index baf014865e..ec9e6b104f 100644 --- a/cmd/ateapi/internal/controlapi/actor.go +++ b/cmd/ateapi/internal/controlapi/actor.go @@ -301,7 +301,9 @@ func (s *ServiceImpl) UpdateActor(ctx context.Context, actorRef resources.ActorR // API errors, and returns any other error unchanged. func actorWriteError(actorRef resources.ActorRef, err error) error { switch { - case errors.Is(err, store.ErrVersionConflict), errors.Is(err, store.ErrUIDConflict): + case errors.Is(err, store.ErrUIDConflict): + return apierror.Aborted("actor %s has a different uid than expected", actorRef) + case errors.Is(err, store.ErrVersionConflict): return apierror.Aborted("concurrent update conflict, please retry") case errors.Is(err, store.ErrNotFound): return apierror.NotFound("actor %s not found", actorRef) @@ -490,15 +492,9 @@ func (s *RPCService) ResumeActor(ctx context.Context, req *ateapi.ResumeActorReq actorRef := resources.ActorRefFromObjectRef(req.GetActor()) setSpanActorRefAttributes(ctx, actorRef) - actor, resumed, err := s.actorWorkflow.ResumeActor(ctx, actorRef) + actor, resumed, err := s.actorWorkflow.ResumeActor(ctx, actorRef, toPreconditions(req.GetPreconditions())) if err != nil { - if errors.Is(err, store.ErrVersionConflict) { - return nil, apierror.Aborted("concurrent update conflict, please retry") - } - if errors.Is(err, store.ErrNotFound) { - return nil, apierror.NotFound("Actor %s not found", actorRef) - } - return nil, err + return nil, actorWriteError(actorRef, err) } setSpanActorAttributes(ctx, actor) @@ -512,15 +508,9 @@ func (s *RPCService) SuspendActor(ctx context.Context, req *ateapi.SuspendActorR actorRef := resources.ActorRefFromObjectRef(req.GetActor()) setSpanActorRefAttributes(ctx, actorRef) - actor, err := s.actorWorkflow.SuspendActor(ctx, actorRef, suspendModeFromOptions(req.GetOptions())) + actor, err := s.actorWorkflow.SuspendActor(ctx, actorRef, toPreconditions(req.GetPreconditions()), suspendModeFromOptions(req.GetOptions())) if err != nil { - if errors.Is(err, store.ErrVersionConflict) { - return nil, apierror.Aborted("concurrent update conflict, please retry") - } - if errors.Is(err, store.ErrNotFound) { - return nil, apierror.NotFound("Actor %s not found", actorRef) - } - return nil, err + return nil, actorWriteError(actorRef, err) } setSpanActorAttributes(ctx, actor) return &ateapi.SuspendActorResponse{Actor: actor}, nil @@ -548,15 +538,9 @@ func (s *RPCService) RevertActor(ctx context.Context, req *ateapi.RevertActorReq actorRef := resources.ActorRefFromObjectRef(req.GetActor()) setSpanActorRefAttributes(ctx, actorRef) - actor, err := s.actorWorkflow.RevertActor(ctx, actorRef) + actor, err := s.actorWorkflow.RevertActor(ctx, actorRef, toPreconditions(req.GetPreconditions())) if err != nil { - if errors.Is(err, store.ErrVersionConflict) { - return nil, apierror.Aborted("concurrent update conflict, please retry") - } - if errors.Is(err, store.ErrNotFound) { - return nil, apierror.NotFound("Actor %s not found", actorRef) - } - return nil, err + return nil, actorWriteError(actorRef, err) } setSpanActorAttributes(ctx, actor) return &ateapi.RevertActorResponse{Actor: actor}, nil diff --git a/cmd/ateapi/internal/controlapi/actor_test.go b/cmd/ateapi/internal/controlapi/actor_test.go index 544cf88d18..3409bd647f 100644 --- a/cmd/ateapi/internal/controlapi/actor_test.go +++ b/cmd/ateapi/internal/controlapi/actor_test.go @@ -30,6 +30,7 @@ import ( "go.ate.dev/substrate/internal/ateattr" "go.ate.dev/substrate/internal/preview" "go.ate.dev/substrate/internal/resources" + "go.opentelemetry.io/otel/sdk/metric/metricdata" "google.golang.org/grpc/codes" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/testing/protocmp" @@ -1053,7 +1054,7 @@ func TestCreateActor_GoldenTagDefault(t *testing.T) { } workflow := &ActorWorkflow{store: persistence} actorRef := resources.ActorRefFromActor(created) - loaded, _, err := workflow.loadActorForResume(ctx, actorRef) + loaded, _, err := workflow.loadActorForResume(ctx, actorRef, store.Precondition{}) if err != nil { t.Fatal(err) } @@ -1063,3 +1064,138 @@ func TestCreateActor_GoldenTagDefault(t *testing.T) { }) } } + +// TestActorCustomMethods_Preconditions checks that Suspend, Resume and Revert +// refuse an actor that no longer matches the caller's guards with ABORTED, and +// leave it untouched. The refused calls' lifecycle metric carries no labels +// from the stored actor. Each seed state completes without atelet, so the +// matching call succeeds. +func TestActorCustomMethods_Preconditions(t *testing.T) { + const foreignUID = "1a7e4c83-6d20-4f95-b3c8-9e0a2f6d4b17" + actorRef := resources.ActorRef{Atespace: testAtespace, Name: testActorID} + ref := &ateapi.ObjectRef{Atespace: actorRef.Atespace, Name: actorRef.Name} + + methods := []struct { + name string + state ateapi.ActorState + call func(ctx context.Context, svc *RPCService, p *ateapi.Preconditions) error + }{ + { + // SUSPENDED takes the shortcut that reports success without writing. + name: "SuspendActor", + state: ateapi.ActorState_ACTOR_STATE_SUSPENDED, + call: func(ctx context.Context, svc *RPCService, p *ateapi.Preconditions) error { + _, err := svc.SuspendActor(ctx, &ateapi.SuspendActorRequest{ + Actor: ref, + Options: &ateapi.SuspendOptions{Mode: ateapi.DurabilityMode_DURABILITY_MODE_SYNCHRONOUS}, + Preconditions: p, + }) + return err + }, + }, + { + // RUNNING takes the fast path that returns before the lease. + name: "ResumeActor", + state: ateapi.ActorState_ACTOR_STATE_RUNNING, + call: func(ctx context.Context, svc *RPCService, p *ateapi.Preconditions) error { + _, err := svc.ResumeActor(ctx, &ateapi.ResumeActorRequest{Actor: ref, Preconditions: p}) + return err + }, + }, + { + // A CRASHED actor with no node reverts without atelet. + name: "RevertActor", + state: ateapi.ActorState_ACTOR_STATE_CRASHED, + call: func(ctx context.Context, svc *RPCService, p *ateapi.Preconditions) error { + _, err := svc.RevertActor(ctx, &ateapi.RevertActorRequest{Actor: ref, Preconditions: p}) + return err + }, + }, + } + for _, m := range methods { + t.Run(m.name, func(t *testing.T) { + ctx := context.Background() + st, cleanup := storetest.SetupTestStore(t) + t.Cleanup(cleanup) + w := newTestActorWorkflow(t, st, "ns", "tmpl1") + inst, reader := newTestInstruments(t) + w.instruments = inst + svc := &RPCService{impl: newServiceImpl(st, nil), actorWorkflow: w} + seedWorkflowActor(t, ctx, st, actorRef, "ns", "tmpl1", m.state) + seeded := mustReadActor(t, ctx, st, actorRef) + md := seeded.GetMetadata() + + for _, tc := range []struct { + name string + p *ateapi.Preconditions + }{ + {"stale version", &ateapi.Preconditions{Version: md.GetVersion() + 7}}, + {"foreign uid", &ateapi.Preconditions{Uid: foreignUID}}, + {"foreign uid, matching version", &ateapi.Preconditions{Uid: foreignUID, Version: md.GetVersion()}}, + } { + if err := m.call(ctx, svc, tc.p); apierror.Code(err) != codes.Aborted { + t.Errorf("%s: code = %v (err %v), want %v", tc.name, apierror.Code(err), err, codes.Aborted) + } + } + if diff := cmp.Diff(seeded, mustReadActor(t, ctx, st, actorRef), protocmp.Transform()); diff != "" { + t.Errorf("refused calls changed the actor (-seeded +stored):\n%s", diff) + } + for _, dp := range mustMetric(t, reader, lifecycleOpDurationMetric).Data.(metricdata.Histogram[float64]).DataPoints { + if name, ok := attrString(dp, ateattr.TemplateNameKey); ok { + t.Errorf("refused call recorded template %q, want no template label", name) + } + } + + if err := m.call(ctx, svc, &ateapi.Preconditions{Uid: md.GetUid(), Version: md.GetVersion()}); err != nil { + t.Errorf("matching preconditions failed: %v", err) + } + }) + } +} + +// replacingLeaseStore runs replace once, just before the first lease is taken. +type replacingLeaseStore struct { + store.Interface + replace func() +} + +func (s *replacingLeaseStore) AcquireLease(ctx context.Context, key string) (*store.Lease, error) { + if s.replace != nil { + s.replace() + s.replace = nil + } + return s.Interface.AcquireLease(ctx, key) +} + +// TestResumeActor_PreconditionCheckedUnderLease covers an actor deleted and +// recreated between ResumeActor's read before the lease and its read under it. +func TestResumeActor_PreconditionCheckedUnderLease(t *testing.T) { + ctx := context.Background() + persistence, cleanup := storetest.SetupTestStore(t) + t.Cleanup(cleanup) + actorRef := resources.ActorRef{Atespace: testAtespace, Name: testActorID} + st := &replacingLeaseStore{Interface: persistence} + w := newTestActorWorkflow(t, st, "ns", "tmpl1") + seedWorkflowActor(t, ctx, persistence, actorRef, "ns", "tmpl1", ateapi.ActorState_ACTOR_STATE_SUSPENDED) + original := mustReadActor(t, ctx, persistence, actorRef) + + var recreated *ateapi.Actor + st.replace = func() { + if _, err := persistence.MarkActorForDeletion(ctx, actorRef, store.Precondition{}, nil); err != nil { + t.Fatalf("MarkActorForDeletion: %v", err) + } + if _, err := persistence.DeleteActor(ctx, actorRef, store.Precondition{}); err != nil { + t.Fatalf("DeleteActor: %v", err) + } + seedWorkflowActor(t, ctx, persistence, actorRef, "ns", "tmpl1", ateapi.ActorState_ACTOR_STATE_SUSPENDED) + recreated = mustReadActor(t, ctx, persistence, actorRef) + } + + _, _, err := w.ResumeActor(ctx, actorRef, store.Precondition{UID: original.GetMetadata().GetUid()}) + if apierror.Code(err) != codes.Aborted { + t.Fatalf("ResumeActor code = %v (err %v), want %v", apierror.Code(err), err, codes.Aborted) + } + if diff := cmp.Diff(recreated, mustReadActor(t, ctx, persistence, actorRef), protocmp.Transform()); diff != "" { + t.Errorf("ResumeActor changed the recreated actor (-recreated +stored):\n%s", diff) + } +} diff --git a/cmd/ateapi/internal/controlapi/delete_options.go b/cmd/ateapi/internal/controlapi/delete_options.go deleted file mode 100644 index f891600a8a..0000000000 --- a/cmd/ateapi/internal/controlapi/delete_options.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2026 The Agent Substrate Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package controlapi - -import ( - "go.ate.dev/substrate/api/ateapi/v1" - "go.ate.dev/substrate/cmd/ateapi/internal/store" -) - -func toDeletePreconditions(opts *ateapi.DeleteOptions) store.Precondition { - return store.Precondition{UID: opts.GetUid(), Version: opts.GetVersion()} -} diff --git a/cmd/ateapi/internal/controlapi/export_test.go b/cmd/ateapi/internal/controlapi/export_test.go index e9537c0a78..dd197829d2 100644 --- a/cmd/ateapi/internal/controlapi/export_test.go +++ b/cmd/ateapi/internal/controlapi/export_test.go @@ -87,7 +87,7 @@ func ReleasingWorkflows() []ReleasingWorkflow { // and its first actor update is the finalize commit. Finalize: func(t *testing.T, ctx context.Context, st store.Interface, actorRef resources.ActorRef, _ *ateapi.Actor) error { w, _ := newWireCaptureWorkflow(t, st) - _, err := w.SuspendActor(ctx, actorRef, suspendAsync) + _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendAsync) return err }, WantRetry: codes.OK, @@ -102,7 +102,7 @@ func ReleasingWorkflows() []ReleasingWorkflow { // As for the async suspend, the finalize commit is the first actor update. Finalize: func(t *testing.T, ctx context.Context, st store.Interface, actorRef resources.ActorRef, _ *ateapi.Actor) error { w, _ := newWireCaptureWorkflow(t, st) - _, err := w.SuspendActor(ctx, actorRef, suspendSync) + _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync) return err }, WantRetry: codes.OK, diff --git a/cmd/ateapi/internal/controlapi/functionaltest/actor_test.go b/cmd/ateapi/internal/controlapi/functionaltest/actor_test.go index 0c8e151f69..3beebfedf4 100644 --- a/cmd/ateapi/internal/controlapi/functionaltest/actor_test.go +++ b/cmd/ateapi/internal/controlapi/functionaltest/actor_test.go @@ -1055,7 +1055,7 @@ func TestUpdateActor_Preconditions(t *testing.T) { otherLifecycle := proto.Clone(created).(*ateapi.Actor) otherLifecycle.Metadata.Uid = staleUID _, err = update(otherLifecycle, "other-lifecycle") - assertGrpcError(t, err, codes.Aborted, "concurrent update conflict, please retry") + assertGrpcError(t, err, codes.Aborted, "actor test-atespace/id1 has a different uid than expected") // Both guards matching the observed state: the update goes through, and // moves the resource past the version observed above. diff --git a/cmd/ateapi/internal/controlapi/hosting_test.go b/cmd/ateapi/internal/controlapi/hosting_test.go index e9b2a829f7..8f24cc1625 100644 --- a/cmd/ateapi/internal/controlapi/hosting_test.go +++ b/cmd/ateapi/internal/controlapi/hosting_test.go @@ -190,7 +190,7 @@ func TestHostingNodeAfterResumeOntoNewWorker(t *testing.T) { tmpl := &ateapi.ActorTemplate{ WorkerSelector: &ateapi.Selector{MatchLabels: map[string]string{"pool": "b"}}, } - resuming, _, err := w.assignWorkerAttempt(ctx, actorRef, actor, tmpl) + resuming, _, err := w.assignWorkerAttempt(ctx, actorRef, actor, tmpl, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt: %v", err) } diff --git a/cmd/ateapi/internal/controlapi/preconditions.go b/cmd/ateapi/internal/controlapi/preconditions.go new file mode 100644 index 0000000000..c23df0424a --- /dev/null +++ b/cmd/ateapi/internal/controlapi/preconditions.go @@ -0,0 +1,50 @@ +// Copyright 2026 The Agent Substrate Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package controlapi + +import ( + "errors" + + "go.ate.dev/substrate/api/ateapi/v1" + "go.ate.dev/substrate/cmd/ateapi/internal/store" + "go.ate.dev/substrate/internal/apierror" + "go.ate.dev/substrate/internal/resources" +) + +func toDeletePreconditions(opts *ateapi.DeleteOptions) store.Precondition { + return store.Precondition{UID: opts.GetUid(), Version: opts.GetVersion()} +} + +func toPreconditions(p *ateapi.Preconditions) store.Precondition { + return store.Precondition{UID: p.GetUid(), Version: p.GetVersion()} +} + +// checkPreconditions returns ABORTED if md, the metadata of the resource +// named by what, does not match precondition. +func checkPreconditions(what string, precondition store.Precondition, md *ateapi.ResourceMetadata) error { + err := precondition.Check(md) + switch { + case errors.Is(err, store.ErrUIDConflict): + return apierror.Aborted("%s does not have uid %s", what, precondition.UID) + case errors.Is(err, store.ErrVersionConflict): + return apierror.Aborted("%s is not at version %d", what, precondition.Version) + } + return err +} + +// checkActorPreconditions returns ABORTED if actor does not match precondition. +func checkActorPreconditions(actorRef resources.ActorRef, precondition store.Precondition, actor *ateapi.Actor) error { + return checkPreconditions("Actor "+actorRef.String(), precondition, actor.GetMetadata()) +} diff --git a/cmd/ateapi/internal/controlapi/worker.go b/cmd/ateapi/internal/controlapi/worker.go index 5ad0c0e649..b42bd42caf 100644 --- a/cmd/ateapi/internal/controlapi/worker.go +++ b/cmd/ateapi/internal/controlapi/worker.go @@ -246,7 +246,7 @@ func (s *RPCService) DrainWorker(ctx context.Context, req *ateapi.DrainWorkerReq if errs := apivalidation.ValidateDrainWorkerRequest(ctx, req); len(errs) > 0 { return nil, resources.ToAPIError(errs) } - drained, err := s.mutateNamedWorker(ctx, req.GetWorker().GetName(), func(toUpdate *ateapi.Worker) error { + drained, err := s.mutateNamedWorker(ctx, req.GetWorker().GetName(), toPreconditions(req.GetPreconditions()), func(toUpdate *ateapi.Worker) error { if toUpdate.GetStatus().GetState() == ateapi.WorkerState_WORKER_STATE_DRAINING { // already draining, do nothing return &workerUnchanged{worker: proto.Clone(toUpdate).(*ateapi.Worker)} @@ -266,7 +266,7 @@ func (s *RPCService) MarkWorkerAvailable(ctx context.Context, req *ateapi.MarkWo if errs := apivalidation.ValidateMarkWorkerAvailableRequest(ctx, req); len(errs) > 0 { return nil, resources.ToAPIError(errs) } - marked, err := s.mutateNamedWorker(ctx, req.GetWorker().GetName(), func(toUpdate *ateapi.Worker) error { + marked, err := s.mutateNamedWorker(ctx, req.GetWorker().GetName(), toPreconditions(req.GetPreconditions()), func(toUpdate *ateapi.Worker) error { switch toUpdate.GetStatus().GetState() { case ateapi.WorkerState_WORKER_STATE_ACTIVE: return &workerUnchanged{worker: proto.Clone(toUpdate).(*ateapi.Worker)} @@ -286,7 +286,7 @@ func (s *RPCService) MarkWorkerUnavailable(ctx context.Context, req *ateapi.Mark if errs := apivalidation.ValidateMarkWorkerUnavailableRequest(ctx, req); len(errs) > 0 { return nil, resources.ToAPIError(errs) } - marked, err := s.mutateNamedWorker(ctx, req.GetWorker().GetName(), func(toUpdate *ateapi.Worker) error { + marked, err := s.mutateNamedWorker(ctx, req.GetWorker().GetName(), toPreconditions(req.GetPreconditions()), func(toUpdate *ateapi.Worker) error { switch toUpdate.GetStatus().GetState() { case ateapi.WorkerState_WORKER_STATE_UNAVAILABLE: return &workerUnchanged{worker: proto.Clone(toUpdate).(*ateapi.Worker)} @@ -307,11 +307,12 @@ func (s *RPCService) MarkWorkerUnavailable(ctx context.Context, req *ateapi.Mark // is final. var errWorkerDraining = errors.New("worker is draining") -// mutateNamedWorker runs mutate against the named Worker for a request that -// carries no guards, so the ones the store requires come from a read here -// rather than from the client. A write that lands in between is reported as a -// conflict for the caller to retry, the same as any other guarded update. -func (s *RPCService) mutateNamedWorker(ctx context.Context, name string, mutate func(toUpdate *ateapi.Worker) error) (*ateapi.Worker, error) { +// mutateNamedWorker runs mutate against the named Worker for a request whose +// guards are optional. It checks precondition against a read here, and the +// guards the store requires come from that read. A write that lands in between +// is reported as a conflict for the caller to retry, the same as any other +// guarded update. +func (s *RPCService) mutateNamedWorker(ctx context.Context, name string, precondition store.Precondition, mutate func(toUpdate *ateapi.Worker) error) (*ateapi.Worker, error) { observed, err := s.impl.GetWorker(ctx, name) if errors.Is(err, store.ErrNotFound) { return nil, apierror.NotFound("Worker %s not found", name) @@ -319,6 +320,9 @@ func (s *RPCService) mutateNamedWorker(ctx context.Context, name string, mutate if err != nil { return nil, fmt.Errorf("while getting worker %s: %w", name, err) } + if err := checkPreconditions("Worker "+name, precondition, observed.GetMetadata()); err != nil { + return nil, err + } return s.mutateWorker(ctx, name, store.PreconditionFrom(observed), mutate) } diff --git a/cmd/ateapi/internal/controlapi/worker_test.go b/cmd/ateapi/internal/controlapi/worker_test.go index 6f22b94bd2..019d95b041 100644 --- a/cmd/ateapi/internal/controlapi/worker_test.go +++ b/cmd/ateapi/internal/controlapi/worker_test.go @@ -586,6 +586,72 @@ func TestDeleteWorker_Preconditions(t *testing.T) { }) } +func TestWorkerCustomMethods_Preconditions(t *testing.T) { + ctx := context.Background() + methods := []struct { + name string + call func(svc *RPCService, p *ateapi.Preconditions) (*ateapi.Worker, error) + }{ + {"DrainWorker", func(svc *RPCService, p *ateapi.Preconditions) (*ateapi.Worker, error) { + resp, err := svc.DrainWorker(ctx, &ateapi.DrainWorkerRequest{Worker: workerRef(apiWorkerName), Preconditions: p}) + return resp.GetWorker(), err + }}, + {"MarkWorkerAvailable", func(svc *RPCService, p *ateapi.Preconditions) (*ateapi.Worker, error) { + resp, err := svc.MarkWorkerAvailable(ctx, &ateapi.MarkWorkerAvailableRequest{Worker: workerRef(apiWorkerName), Preconditions: p}) + return resp.GetWorker(), err + }}, + {"MarkWorkerUnavailable", func(svc *RPCService, p *ateapi.Preconditions) (*ateapi.Worker, error) { + resp, err := svc.MarkWorkerUnavailable(ctx, &ateapi.MarkWorkerUnavailableRequest{Worker: workerRef(apiWorkerName), Preconditions: p}) + return resp.GetWorker(), err + }}, + } + for _, m := range methods { + t.Run(m.name, func(t *testing.T) { + svc, persistence := newWorkerAPIService(t) + seeded := seedAPIWorker(t, ctx, persistence, validWorker(apiWorkerName)) + md := seeded.GetMetadata() + + for _, tc := range []struct { + name string + p *ateapi.Preconditions + }{ + {"stale version", &ateapi.Preconditions{Version: md.GetVersion() + 7}}, + {"foreign uid", &ateapi.Preconditions{Uid: apiOtherWorkerName}}, + } { + if _, err := m.call(svc, tc.p); apierror.Code(err) != codes.Aborted { + t.Errorf("%s: code = %v (err %v), want %v", tc.name, apierror.Code(err), err, codes.Aborted) + } + } + stored, err := persistence.GetWorker(ctx, apiWorkerName) + if err != nil { + t.Fatalf("GetWorker() failed: %v", err) + } + if diff := cmp.Diff(seeded, stored, protocmp.Transform()); diff != "" { + t.Errorf("refused calls changed the worker (-seeded +stored):\n%s", diff) + } + + matching := &ateapi.Preconditions{Uid: md.GetUid(), Version: md.GetVersion()} + got, err := m.call(svc, matching) + if err != nil { + t.Fatalf("matching preconditions failed: %v", err) + } + + // A retry with the same version fails once the first call wrote + // the Worker. A retry with the uid alone succeeds. + wantRetry := codes.OK + if got.GetMetadata().GetVersion() != md.GetVersion() { + wantRetry = codes.Aborted + } + if _, err := m.call(svc, matching); apierror.Code(err) != wantRetry { + t.Errorf("retry with the same version: code = %v (err %v), want %v", apierror.Code(err), err, wantRetry) + } + if _, err := m.call(svc, &ateapi.Preconditions{Uid: md.GetUid()}); err != nil { + t.Errorf("retry with uid alone failed: %v", err) + } + }) + } +} + func TestDrainWorker(t *testing.T) { ctx := context.Background() svc, persistence := newWorkerAPIService(t) diff --git a/cmd/ateapi/internal/controlapi/workflow_delete_test.go b/cmd/ateapi/internal/controlapi/workflow_delete_test.go index a14c6a5907..6b720ca17a 100644 --- a/cmd/ateapi/internal/controlapi/workflow_delete_test.go +++ b/cmd/ateapi/internal/controlapi/workflow_delete_test.go @@ -222,7 +222,7 @@ func TestRevertAndDelete_AssignedNodeGone(t *testing.T) { wantState := ateapi.ActorState_ACTOR_STATE_REVERTING if verb == "revert" { - _, err = w.RevertActor(ctx, actorRef) + _, err = w.RevertActor(ctx, actorRef, store.Precondition{}) } else { wantState = ateapi.ActorState_ACTOR_STATE_DELETING _, err = w.DeleteActor(ctx, actorRef, store.Precondition{}) @@ -605,7 +605,7 @@ func TestDeleteActor_CollectsSnapshotsAfterWorkerDelete(t *testing.T) { objects.PutSnapshot(t, fresh, "manifest.json") return apierror.Unavailable("worker pod is gone") } - if _, err := actorWorkflow.SuspendActor(ctx, actorRef, suspendSync); apierror.Code(err) != codes.Unavailable { + if _, err := actorWorkflow.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync); apierror.Code(err) != codes.Unavailable { t.Fatalf("SuspendActor err = %v, want Unavailable from the failed checkpoint", err) } // SuspendActor failed mid-checkpoint and released the actor's lease, diff --git a/cmd/ateapi/internal/controlapi/workflow_reconcile_assignments_test.go b/cmd/ateapi/internal/controlapi/workflow_reconcile_assignments_test.go index b9d1cb7c15..99d2ae35ad 100644 --- a/cmd/ateapi/internal/controlapi/workflow_reconcile_assignments_test.go +++ b/cmd/ateapi/internal/controlapi/workflow_reconcile_assignments_test.go @@ -453,7 +453,7 @@ func TestAssignWorkerAttempt_LeavesWorkerEpochUnset(t *testing.T) { w := &ActorWorkflow{store: persistence, workerCache: wc, scheduler: scheduling.New(wc)} tmpl := &ateapi.ActorTemplate{} - stored, _, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl) + stored, _, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt: %v", err) } diff --git a/cmd/ateapi/internal/controlapi/workflow_resume.go b/cmd/ateapi/internal/controlapi/workflow_resume.go index 44694c5be9..e4b048193b 100644 --- a/cmd/ateapi/internal/controlapi/workflow_resume.go +++ b/cmd/ateapi/internal/controlapi/workflow_resume.go @@ -51,7 +51,8 @@ type restoreTelemetry struct { // ResumeActor executes the workflow to resume a suspended actor. Idempotent: // a re-entered workflow fast-forwards past the steps a previous attempt // completed, deriving progress from the persisted actor alone. -func (w *ActorWorkflow) ResumeActor(ctx context.Context, actorRef resources.ActorRef) (_ *ateapi.Actor, resumed bool, err error) { +// Fails with ABORTED if the actor does not match precondition. +func (w *ActorWorkflow) ResumeActor(ctx context.Context, actorRef resources.ActorRef, precondition store.Precondition) (_ *ateapi.Actor, resumed bool, err error) { ctx = preview.ContextWithOptIn(ctx) start := time.Now() var actor *ateapi.Actor @@ -75,10 +76,16 @@ func (w *ActorWorkflow) ResumeActor(ctx context.Context, actorRef resources.Acto // Read before taking the distributed lease so that hot-path checks do not // upsert and delete a PostgreSQL lease row. Any state that needs work is read // again under the lease below. - actor, err = w.store.GetActor(ctx, actorRef) + // actor stays nil until the guards match, so a refused call does not label + // its metric with another actor's template and pool. + observed, err := w.store.GetActor(ctx, actorRef) if err != nil { return nil, false, err } + if err = checkActorPreconditions(actorRef, precondition, observed); err != nil { + return nil, false, err + } + actor = observed if wasRunning = actor.GetStatus().GetState() == ateapi.ActorState_ACTOR_STATE_RUNNING; wasRunning { return actor, false, nil } @@ -89,7 +96,7 @@ func (w *ActorWorkflow) ResumeActor(ctx context.Context, actorRef resources.Acto } defer lease.Close() - actor, actorTemplate, err = w.loadActorForResume(leaseCtx, actorRef) + actor, actorTemplate, err = w.loadActorForResume(leaseCtx, actorRef, precondition) if err != nil { return nil, false, err } @@ -103,14 +110,14 @@ func (w *ActorWorkflow) ResumeActor(ctx context.Context, actorRef resources.Acto actor = created var worker *ateapi.Worker var assigned *ateapi.Actor - assigned, worker, err = w.ensureWorkerAssigned(leaseCtx, actorRef, actor, actorTemplate) + assigned, worker, err = w.ensureWorkerAssigned(leaseCtx, actorRef, actor, actorTemplate, precondition) if err != nil && shouldDetachFromNode(actor, err) { var detached *ateapi.Actor - if detached, err = w.detachFromFullNode(leaseCtx, actorRef, actor, actorTemplate, err); err != nil { + if detached, err = w.detachFromFullNode(leaseCtx, actorRef, actor, actorTemplate, err, precondition); err != nil { return nil, false, err } actor = detached - assigned, worker, err = w.ensureWorkerAssigned(leaseCtx, actorRef, actor, actorTemplate) + assigned, worker, err = w.ensureWorkerAssigned(leaseCtx, actorRef, actor, actorTemplate, precondition) } if err != nil { return nil, false, err @@ -132,8 +139,9 @@ func (w *ActorWorkflow) ResumeActor(ctx context.Context, actorRef resources.Acto return actor, true, nil } -// loadActorForResume fetches the current actor record and its template. -func (w *ActorWorkflow) loadActorForResume(ctx context.Context, actorRef resources.ActorRef) (_ *ateapi.Actor, _ *ateapi.ActorTemplate, err error) { +// loadActorForResume fetches the current actor record, checks it against +// precondition, and fetches its template. +func (w *ActorWorkflow) loadActorForResume(ctx context.Context, actorRef resources.ActorRef, precondition store.Precondition) (_ *ateapi.Actor, _ *ateapi.ActorTemplate, err error) { ctx, done := stepSpan(ctx, "LoadActorForResume") defer func() { err = done(err) }() @@ -144,6 +152,9 @@ func (w *ActorWorkflow) loadActorForResume(ctx context.Context, actorRef resourc } return nil, nil, fmt.Errorf("while getting actor from DB: %w", err) } + if err := checkActorPreconditions(actorRef, precondition, actor); err != nil { + return nil, nil, err + } // If the actor is already running, there is no pending restore to prepare // for. Short-circuit immediately to avoid an unnecessary template read on @@ -223,18 +234,16 @@ func (w *ActorWorkflow) ensureVolumesCreated(ctx context.Context, actorRef resou } storedActor, updateErr := w.store.UpdateActor(ctx, actorRef, updatePrecondition, persistVolumes) if updateErr != nil { - if errors.Is(updateErr, store.ErrVersionConflict) { - return nil, apierror.Aborted("concurrent update conflict, please retry") - } - return nil, fmt.Errorf("while updating actor after volume creation: %w", updateErr) + return nil, fmt.Errorf("while updating actor after volume creation: %w", actorWriteError(actorRef, updateErr)) } return storedActor, nil } // ensureWorkerAssigned assigns a worker and leaves the actor RESUMING. // Re-entry validates the recorded assignment before reuse. -// Version conflicts re-read the actor before retrying. -func (w *ActorWorkflow) ensureWorkerAssigned(ctx context.Context, actorRef resources.ActorRef, actor *ateapi.Actor, actorTemplate *ateapi.ActorTemplate) (_ *ateapi.Actor, _ *ateapi.Worker, err error) { +// Version conflicts re-read the actor before retrying, unless the caller +// passed a version guard. +func (w *ActorWorkflow) ensureWorkerAssigned(ctx context.Context, actorRef resources.ActorRef, actor *ateapi.Actor, actorTemplate *ateapi.ActorTemplate, precondition store.Precondition) (_ *ateapi.Actor, _ *ateapi.Worker, err error) { ctx, done := stepSpan(ctx, "AssignWorker") defer func() { err = done(err) }() @@ -268,7 +277,7 @@ func (w *ActorWorkflow) ensureWorkerAssigned(ctx context.Context, actorRef resou return false, err } attemptStart := time.Now() - attemptActor, attemptWorker, attemptErr := w.assignWorkerAttempt(ctx, actorRef, actor, actorTemplate) + attemptActor, attemptWorker, attemptErr := w.assignWorkerAttempt(ctx, actorRef, actor, actorTemplate, precondition) lastAttempt = time.Since(attemptStart) attempted = true if attemptErr == nil { @@ -401,8 +410,9 @@ func schedulerRecordable(err error) bool { // and persisting RESUMING with the assignment. On a version conflict it // re-reads the actor: if the fresh copy can still be resumed the refreshed // actor is returned along with the conflict so the caller retries with clean -// inputs; any other status aborts the resume. -func (w *ActorWorkflow) assignWorkerAttempt(ctx context.Context, actorRef resources.ActorRef, actor *ateapi.Actor, actorTemplate *ateapi.ActorTemplate) (_ *ateapi.Actor, _ *ateapi.Worker, err error) { +// inputs; any other status aborts the resume. Under the caller's version guard +// the conflict aborts the resume instead. +func (w *ActorWorkflow) assignWorkerAttempt(ctx context.Context, actorRef resources.ActorRef, actor *ateapi.Actor, actorTemplate *ateapi.ActorTemplate, precondition store.Precondition) (_ *ateapi.Actor, _ *ateapi.Worker, err error) { // Checked before a worker is claimed. if err := checkSnapshotUpload(actorRef, actor); err != nil { return nil, nil, err @@ -510,12 +520,22 @@ func (w *ActorWorkflow) assignWorkerAttempt(ctx context.Context, actorRef resour if !errors.Is(err, store.ErrVersionConflict) { return nil, nil, actorWriteError(actorRef, err) } + // The caller's version guard was checked against actor, so never retry + // against a version written since. + if precondition.Version != 0 { + return nil, nil, apierror.Aborted("Actor %s changed during the resume", actorRef) + } // refresh the version of actor to avoid always failure in rest retries. fresh, gerr := w.store.GetActor(ctx, actorRef) if gerr != nil { slog.WarnContext(ctx, "Failed to refresh actor after assignment conflict", slog.Any("err", gerr)) return nil, nil, err } + // The template and the caller's uid guard were checked against the + // actor read under the lease, so never retry against a recreated one. + if fresh.GetMetadata().GetUid() != actor.GetMetadata().GetUid() { + return nil, nil, apierror.Aborted("Actor %s changed during the resume", actorRef) + } switch fresh.GetStatus().GetState() { case ateapi.ActorState_ACTOR_STATE_SUSPENDED: slog.InfoContext(ctx, "Retrying assignment due to actor version conflict", slog.Any("actor", actorRef)) @@ -908,10 +928,7 @@ func (w *ActorWorkflow) finalizeRunning(ctx context.Context, actorRef resources. return nil }) if err != nil { - if errors.Is(err, store.ErrVersionConflict) { - return nil, apierror.Aborted("concurrent update conflict, please retry") - } - return nil, err + return nil, actorWriteError(actorRef, err) } logActorStateChanged(ctx, storedActor, ateattr.OperationResume) return storedActor, nil diff --git a/cmd/ateapi/internal/controlapi/workflow_resume_detach.go b/cmd/ateapi/internal/controlapi/workflow_resume_detach.go index af22fc890d..257f15220f 100644 --- a/cmd/ateapi/internal/controlapi/workflow_resume_detach.go +++ b/cmd/ateapi/internal/controlapi/workflow_resume_detach.go @@ -46,13 +46,18 @@ func shouldDetachFromNode(actor *ateapi.Actor, assignErr error) bool { // Unreachable nodes can be forgotten when the latest local snapshot is durable. // A deleted node is released even when that snapshot is not durable, so resume // tries its upload. -func (w *ActorWorkflow) detachFromFullNode(ctx context.Context, actorRef resources.ActorRef, actor *ateapi.Actor, actorTemplate *ateapi.ActorTemplate, assignErr error) (_ *ateapi.Actor, err error) { +func (w *ActorWorkflow) detachFromFullNode(ctx context.Context, actorRef resources.ActorRef, actor *ateapi.Actor, actorTemplate *ateapi.ActorTemplate, assignErr error, precondition store.Precondition) (_ *ateapi.Actor, err error) { ctx, done := stepSpan(ctx, "DetachFromFullNode") defer func() { err = done(err) }() node := actor.GetStatus().GetAssignedNode() - // Assignment may have retried on a newer version than actor. - if actor, err = w.loadPinnedActor(ctx, actorRef, actor.GetMetadata().GetUid(), node); err != nil { + // Assignment may have retried on a newer version than actor. It does not + // under the caller's version guard, so pin actor's version then. + var version int64 + if precondition.Version != 0 { + version = actor.GetMetadata().GetVersion() + } + if actor, err = w.loadPinnedActor(ctx, actorRef, actor.GetMetadata().GetUid(), version, node); err != nil { return nil, err } constraints := schedulingConstraints(actor, actorTemplate) @@ -92,7 +97,7 @@ func (w *ActorWorkflow) detachFromFullNode(ctx context.Context, actorRef resourc return nil, apierror.Unavailable("while getting atelet conn for node %q: %w (and while checking the node: %w)", node, err, nodeErr) } if gone { - return w.recordGoneNode(ctx, actorRef, actor, node) + return w.recordGoneNode(ctx, actorRef, actor, version, node) } } return nil, apierror.Unavailable("while getting atelet conn for node %q: %w", node, err) @@ -126,16 +131,20 @@ func (w *ActorWorkflow) detachFromFullNode(ctx context.Context, actorRef resourc } // loadPinnedActor reads the actor, and fails with Aborted unless it is still -// the SUSPENDED incarnation uid, pinned to node. -func (w *ActorWorkflow) loadPinnedActor(ctx context.Context, actorRef resources.ActorRef, uid, node string) (*ateapi.Actor, error) { +// the SUSPENDED incarnation uid, pinned to node. A nonzero version must match +// too. +func (w *ActorWorkflow) loadPinnedActor(ctx context.Context, actorRef resources.ActorRef, uid string, version int64, node string) (*ateapi.Actor, error) { actor, err := w.store.GetActor(ctx, actorRef) if err != nil { return nil, fmt.Errorf("while reading Actor %s: %w", actorRef, err) } + if version != 0 && actor.GetMetadata().GetVersion() != version { + return nil, apierror.Aborted("Actor %s changed during the resume", actorRef) + } if actor.GetMetadata().GetUid() != uid || actor.GetStatus().GetState() != ateapi.ActorState_ACTOR_STATE_SUSPENDED || actor.GetStatus().GetAssignedNode() != node { - return nil, apierror.Aborted("Actor %s changed during the resume, please retry", actorRef) + return nil, apierror.Aborted("Actor %s changed during the resume", actorRef) } return actor, nil } @@ -161,10 +170,7 @@ func (w *ActorWorkflow) recordDetach(ctx context.Context, actorRef resources.Act return nil }) if err != nil { - if errors.Is(err, store.ErrVersionConflict) { - return nil, apierror.Aborted("concurrent update conflict, please retry") - } - return nil, fmt.Errorf("while recording the detach of Actor %s from node %q: %w", actorRef, node, err) + return nil, fmt.Errorf("while recording the detach of Actor %s from node %q: %w", actorRef, node, actorWriteError(actorRef, err)) } return stored, nil } @@ -173,9 +179,10 @@ func (w *ActorWorkflow) recordDetach(ctx context.Context, actorRef resources.Act // snapshot is not recorded durable. atelet may have uploaded it without // reporting, so the snapshot keeps its locality and resume restores it from // the upload on another node. It reads the actor again first, so an upload -// recorded during the node lookup detaches it instead. -func (w *ActorWorkflow) recordGoneNode(ctx context.Context, actorRef resources.ActorRef, actor *ateapi.Actor, node string) (*ateapi.Actor, error) { - actor, err := w.loadPinnedActor(ctx, actorRef, actor.GetMetadata().GetUid(), node) +// recorded during the node lookup detaches it instead. A nonzero version pins +// the read as loadPinnedActor does. +func (w *ActorWorkflow) recordGoneNode(ctx context.Context, actorRef resources.ActorRef, actor *ateapi.Actor, version int64, node string) (*ateapi.Actor, error) { + actor, err := w.loadPinnedActor(ctx, actorRef, actor.GetMetadata().GetUid(), version, node) if err != nil { return nil, err } @@ -188,9 +195,9 @@ func (w *ActorWorkflow) recordGoneNode(ctx context.Context, actorRef resources.A }) if err != nil { if errors.Is(err, store.ErrVersionConflict) { - return nil, apierror.Aborted("Actor %s changed during the resume, please retry", actorRef) + return nil, apierror.Aborted("Actor %s changed during the resume", actorRef) } - return nil, fmt.Errorf("while releasing Actor %s from deleted node %q: %w", actorRef, node, err) + return nil, fmt.Errorf("while releasing Actor %s from deleted node %q: %w", actorRef, node, actorWriteError(actorRef, err)) } slog.InfoContext(ctx, "Released actor from its deleted node to restore its snapshot's upload on another node", slog.Any("actor", actorRef), diff --git a/cmd/ateapi/internal/controlapi/workflow_resume_detach_test.go b/cmd/ateapi/internal/controlapi/workflow_resume_detach_test.go index de5b60cebd..5606e996a2 100644 --- a/cmd/ateapi/internal/controlapi/workflow_resume_detach_test.go +++ b/cmd/ateapi/internal/controlapi/workflow_resume_detach_test.go @@ -444,7 +444,7 @@ func TestDetachFromFullNode(t *testing.T) { } tmpl := &ateapi.ActorTemplate{Resources: &ateapi.ResourceRequirements{Limits: tt.limits}} - stored, err := w.detachFromFullNode(ctx, actorRef, actor, tmpl, noRoom) + stored, err := w.detachFromFullNode(ctx, actorRef, actor, tmpl, noRoom, store.Precondition{}) if got := apierror.Code(err); got != tt.wantCode { t.Fatalf("detachFromFullNode() = %v, want code %v", err, tt.wantCode) } @@ -587,7 +587,7 @@ func TestResumeActor_DetachesFromFullNode(t *testing.T) { atelet.detachState = detachedState(snap) atelet.detachErr = tt.detachErr - got, resumed, err := w.ResumeActor(ctx, actorRef) + got, resumed, err := w.ResumeActor(ctx, actorRef, store.Precondition{}) if code := apierror.Code(err); code != tt.wantCode { t.Fatalf("ResumeActor() = %v, want code %v", err, tt.wantCode) } @@ -698,7 +698,7 @@ func TestResumeActor_NodeGoneWithPendingUpload(t *testing.T) { atelet.restoreErr = apierror.NotFound("snapshot has no usable local copy and no uploaded copy") } - got, resumed, err := w.ResumeActor(ctx, actorRef) + got, resumed, err := w.ResumeActor(ctx, actorRef, store.Precondition{}) restore, _ := atelet.requests() if restore.GetWorkerPodUid() != worker.GetWorkerPodUid() || restore.GetSnapshot().GetSnapshotUuid() != pending.GetUuid() { t.Fatalf("Restore = (worker %q, snapshot %q), want (%q, %q)", restore.GetWorkerPodUid(), restore.GetSnapshot().GetSnapshotUuid(), worker.GetWorkerPodUid(), pending.GetUuid()) @@ -742,7 +742,7 @@ func TestResumeActor_NodeGoneWithPendingUpload(t *testing.T) { // The crash leaves the actor on node-2, so revert terminates it // there. - reverted, err := w.RevertActor(ctx, actorRef) + reverted, err := w.RevertActor(ctx, actorRef, store.Precondition{}) if err != nil { t.Fatalf("RevertActor: %v", err) } @@ -752,7 +752,7 @@ func TestResumeActor_NodeGoneWithPendingUpload(t *testing.T) { atelet.mu.Lock() atelet.restoreErr = nil atelet.mu.Unlock() - if _, _, err := w.ResumeActor(ctx, actorRef); err != nil { + if _, _, err := w.ResumeActor(ctx, actorRef, store.Precondition{}); err != nil { t.Fatalf("second ResumeActor: %v", err) } if restore, _ := atelet.requests(); restore.GetSnapshot().GetSnapshotUuid() != durable.GetUuid() { @@ -780,6 +780,32 @@ func addAteletOnNode(t *testing.T, w *ActorWorkflow, node string) { w.dialer.ateletConns.Add(string(uid), &ateletConn{ip: "10.0.0.2", conn: cached.(*ateletConn).conn}) } +// Under the caller's version guard, an actor written since the resume read it +// aborts the detach before atelet is asked. +func TestDetachFromFullNode_VersionGuardAbortsOnNewerActor(t *testing.T) { + ctx := context.Background() + st := newTestPersistence(t) + actorRef := resources.ActorRef{Atespace: "team-a", Name: "id1"} + fillWorker(t, st, seedRuntimeWorker(t, ctx, st, "pod-node-1", "node-1", testSandboxRuntime())) + seedRuntimeWorker(t, ctx, st, "pod-2", "node-2", testSandboxRuntime()) + snap := newPausedSnapshot(t, 1, ateapi.SnapshotFidelity_SNAPSHOT_FIDELITY_MEMORY, "", "pause-snap-1", "node-1") + actor := seedActorWithSnapshot(t, ctx, st, ateapi.ActorState_ACTOR_STATE_SUSPENDED, "node-1", snap) + w, atelet := newDetachTestWorkflow(t, ctx, st) + atelet.detachState = detachedState(snap) + noRoom := apierror.ResourceExhausted("%w", errNoWorkerRoom) + + if _, err := st.UpdateActor(ctx, actorRef, store.PreconditionFrom(actor), func(*ateapi.Actor) error { return nil }); err != nil { + t.Fatalf("UpdateActor: %v", err) + } + guard := store.Precondition{Version: actor.GetMetadata().GetVersion()} + if _, err := w.detachFromFullNode(ctx, actorRef, actor, &ateapi.ActorTemplate{}, noRoom, guard); apierror.Code(err) != codes.Aborted { + t.Fatalf("detachFromFullNode() = %v, want Aborted", err) + } + if atelet.detach != nil { + t.Errorf("DetachActor called with %v, want no call", atelet.detach) + } +} + // TestDetachFromFullNode_ReentryRecordsAfterConflict loses the record write // to a concurrent update, then runs the step again, as the next resume does: // the second attempt detaches again and records the detach. @@ -806,12 +832,12 @@ func TestDetachFromFullNode_ReentryRecordsAfterConflict(t *testing.T) { t.Errorf("UpdateActor: %v", err) } } - if _, err := w.detachFromFullNode(ctx, actorRef, actor, &ateapi.ActorTemplate{}, noRoom); apierror.Code(err) != codes.Aborted { + if _, err := w.detachFromFullNode(ctx, actorRef, actor, &ateapi.ActorTemplate{}, noRoom, store.Precondition{}); apierror.Code(err) != codes.Aborted { t.Fatalf("first detachFromFullNode() = %v, want Aborted", err) } atelet.onDetach = nil - stored, err := w.detachFromFullNode(ctx, actorRef, actor, &ateapi.ActorTemplate{}, noRoom) + stored, err := w.detachFromFullNode(ctx, actorRef, actor, &ateapi.ActorTemplate{}, noRoom, store.Precondition{}) if err != nil { t.Fatalf("second detachFromFullNode() = %v, want success", err) } diff --git a/cmd/ateapi/internal/controlapi/workflow_resume_test.go b/cmd/ateapi/internal/controlapi/workflow_resume_test.go index f2c4c5f937..f8ed73eed1 100644 --- a/cmd/ateapi/internal/controlapi/workflow_resume_test.go +++ b/cmd/ateapi/internal/controlapi/workflow_resume_test.go @@ -100,7 +100,7 @@ func TestResumeActor_RunningFastPathDoesNotAcquireLease(t *testing.T) { st := &leaseCountingStore{Interface: persistence} w := &ActorWorkflow{store: st} - got, resumed, err := w.ResumeActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}) + got, resumed, err := w.ResumeActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, store.Precondition{}) if err != nil { t.Fatalf("ResumeActor: %v", err) } @@ -348,7 +348,7 @@ func TestAssignWorkerAttempt_BindNotFound(t *testing.T) { st := &bindErrorStore{Interface: persistence, err: tc.bindErr} w := &ActorWorkflow{store: st, workerCache: wc, scheduler: scheduling.New(wc)} - _, _, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, _, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if tc.wantErr != nil { if !errors.Is(err, tc.wantErr) { t.Fatalf("assignWorkerAttempt error = %v, want %v", err, tc.wantErr) @@ -375,7 +375,7 @@ func TestEnsureWorkerAssigned_ConflictExhaustionIsRetryable(t *testing.T) { w := &ActorWorkflow{store: st, workerCache: wc, scheduler: scheduling.New(wc)} tmpl := &ateapi.ActorTemplate{} - _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl) + _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl, store.Precondition{}) if !errors.Is(err, store.ErrVersionConflict) { t.Fatalf("ensureWorkerAssigned error = %v, want ErrVersionConflict", err) } @@ -419,7 +419,7 @@ func TestAssignWorkerAttempt_SkipsWorkerAssignedInOtherAtespace(t *testing.T) { Metadata: &ateapi.ResourceMetadata{Atespace: "team-a", Name: "shared", Uid: "actor-uid"}, } tmpl := &ateapi.ActorTemplate{} - _, _, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "shared"}, actor, tmpl) + _, _, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "shared"}, actor, tmpl, store.Precondition{}) if apierror.Code(err) != codes.ResourceExhausted { t.Fatalf("assignWorkerAttempt() error = %v, want ResourceExhausted (no worker has room)", err) } @@ -476,7 +476,7 @@ func TestEnsureWorkerAssigned_MissingUploadClaimsNoWorker(t *testing.T) { } w := &ActorWorkflow{store: persistence, workerCache: wc, scheduler: scheduling.New(wc)} - if _, _, err := w.ensureWorkerAssigned(ctx, actorRef, actor, &ateapi.ActorTemplate{}); apierror.Code(err) != codes.DataLoss { + if _, _, err := w.ensureWorkerAssigned(ctx, actorRef, actor, &ateapi.ActorTemplate{}, store.Precondition{}); apierror.Code(err) != codes.DataLoss { t.Fatalf("ensureWorkerAssigned() error = %v, want DataLoss", err) } @@ -558,7 +558,7 @@ func TestAssignWorkerAttempt_RetryAfterConflictPicksFreshWorker(t *testing.T) { w := &ActorWorkflow{store: persistence, workerCache: wc, scheduler: scheduling.New(wc)} tmpl := &ateapi.ActorTemplate{} - _, worker, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl) + _, worker, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt() on retry = %v, want nil (must re-pick a free worker)", err) } @@ -646,16 +646,35 @@ func seedAssignFixture(t *testing.T, ctx context.Context, persistence store.Inte return actor, wc } +// recreatingGetStore deletes and recreates the actor on the first GetActor. +type recreatingGetStore struct { + store.Interface + once sync.Once + recreate func() +} + +func (s *recreatingGetStore) GetActor(ctx context.Context, actorRef resources.ActorRef) (*ateapi.Actor, error) { + s.once.Do(s.recreate) + return s.Interface.GetActor(ctx, actorRef) +} + // TestAssignWorkerAttempt_ConflictRefreshesActor verifies the actor write's // conflict handling within a single attempt: a concurrent spec write leaves // ErrVersionConflict with the refreshed actor returned for the retry, while -// a concurrent transition out of a resumable state aborts the resume. +// a concurrent transition out of a resumable state, or a recreated actor, +// aborts the resume. func TestAssignWorkerAttempt_ConflictRefreshesActor(t *testing.T) { t.Parallel() tests := []struct { name string // mutate is the racing concurrent write applied to the fresh actor. mutate func(fresh *ateapi.Actor) + // recreateOnRefresh deletes and recreates the actor between the + // failed bind and the refresh. + recreateOnRefresh bool + // versionGuard passes the caller's version guard, checked against the + // actor before the racing write. + versionGuard bool // wantRetry means the attempt surfaces ErrVersionConflict with the // refreshed actor returned; otherwise Aborted. wantRetry bool @@ -678,6 +697,24 @@ func TestAssignWorkerAttempt_ConflictRefreshesActor(t *testing.T) { wantRetry: false, wantStoredState: ateapi.ActorState_ACTOR_STATE_CRASHED, }, + { + name: "the actor is recreated before the refresh", + mutate: func(fresh *ateapi.Actor) { + fresh.WorkerSelector = &ateapi.Selector{MatchLabels: map[string]string{"team": "blue"}} + }, + recreateOnRefresh: true, + wantRetry: false, + wantStoredState: ateapi.ActorState_ACTOR_STATE_SUSPENDED, + }, + { + name: "another writer refreshes the Actor under a version guard", + mutate: func(fresh *ateapi.Actor) { + fresh.WorkerSelector = &ateapi.Selector{MatchLabels: map[string]string{"team": "blue"}} + }, + versionGuard: true, + wantRetry: false, + wantStoredState: ateapi.ActorState_ACTOR_STATE_SUSPENDED, + }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { @@ -686,8 +723,21 @@ func TestAssignWorkerAttempt_ConflictRefreshesActor(t *testing.T) { persistence := newTestPersistence(t) actor, wc := seedAssignFixture(t, ctx, persistence) + base := persistence + if tc.recreateOnRefresh { + base = &recreatingGetStore{Interface: persistence, recreate: func() { + if _, err := persistence.DeleteActor(ctx, resources.ActorRefFromActor(actor), store.Precondition{}); err != nil { + t.Errorf("recreate DeleteActor: %v", err) + return + } + storetest.MustCreateActor(t, ctx, persistence, &ateapi.Actor{ + Metadata: &ateapi.ResourceMetadata{Atespace: "team-a", Name: "id1"}, + Status: &ateapi.ActorStatus{State: ateapi.ActorState_ACTOR_STATE_SUSPENDED}, + }) + }} + } var injected *ateapi.Actor - st := &conflictInjectingStore{Interface: persistence, inject: func() { + st := &conflictInjectingStore{Interface: base, inject: func() { fresh, err := persistence.GetActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}) if err != nil { t.Errorf("inject GetActor: %v", err) @@ -706,7 +756,11 @@ func TestAssignWorkerAttempt_ConflictRefreshesActor(t *testing.T) { w := &ActorWorkflow{store: st, workerCache: wc, scheduler: scheduling.New(wc)} tmpl := &ateapi.ActorTemplate{} - refreshed, _, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl) + var precondition store.Precondition + if tc.versionGuard { + precondition.Version = actor.GetMetadata().GetVersion() + } + refreshed, _, err := w.assignWorkerAttempt(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl, precondition) if tc.wantRetry { if !errors.Is(err, store.ErrVersionConflict) { @@ -731,6 +785,9 @@ func TestAssignWorkerAttempt_ConflictRefreshesActor(t *testing.T) { if stored.GetStatus().GetState() != tc.wantStoredState { t.Errorf("stored state = %v, want %v", stored.GetStatus().GetState(), tc.wantStoredState) } + if got := stored.GetMetadata().GetUid() != actor.GetMetadata().GetUid(); got != tc.recreateOnRefresh { + t.Errorf("stored actor recreated = %v, want %v", got, tc.recreateOnRefresh) + } // The losing bind rolls back with the actor update. if worker := storetest.WorkerHostingActor(t, ctx, persistence, stored.GetMetadata().GetUid()); worker != "" { t.Errorf("worker %q holds the actor, want none: the losing bind leaves no claim", worker) @@ -786,7 +843,7 @@ func TestResumeActorWorkflow_RejectedAndIdempotentPaths(t *testing.T) { } }) - actor, resumed, err := w.ResumeActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}) + actor, resumed, err := w.ResumeActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, store.Precondition{}) if tc.wantErr { if got := apierror.Code(err); got != codes.FailedPrecondition { t.Fatalf("apierror.Code(err) = %v, want %v (err: %v)", got, codes.FailedPrecondition, err) @@ -835,7 +892,7 @@ func TestEnsureWorkerAssigned_RejectsNonResumableStates(t *testing.T) { continue } actor := &ateapi.Actor{Status: &ateapi.ActorStatus{State: st}, Metadata: &ateapi.ResourceMetadata{Name: "id1", Uid: "actor-uid-1"}} - _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) assertPrerequisiteResult(t, st, err, false) } } @@ -871,7 +928,7 @@ func TestResumeActor_MetricSkipsAlreadyRunningNoop(t *testing.T) { } }) - _, _, err := w.ResumeActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}) + _, _, err := w.ResumeActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, store.Precondition{}) if tt.wantRecord && err == nil { t.Fatal("expected resume to fail, got nil error") } @@ -1081,7 +1138,7 @@ func TestLoadActorForResume_RunningActorShortCircuits(t *testing.T) { w := &ActorWorkflow{store: persistence} - actor, tmpl, err := w.loadActorForResume(ctx, actorRef) + actor, tmpl, err := w.loadActorForResume(ctx, actorRef, store.Precondition{}) if err != nil { t.Fatalf("loadActorForResume() unexpected error = %v", err) } @@ -1923,7 +1980,7 @@ func TestResumeActor_AteletWireRequest(t *testing.T) { a.Status.LastAssignedGeneration = gen }) - actor, loadedTmpl, err := w.loadActorForResume(ctx, actorRef) + actor, loadedTmpl, err := w.loadActorForResume(ctx, actorRef, store.Precondition{}) var tele restoreTelemetry if err == nil { tele, _, err = w.ensureAteletRestored(ctx, actorRef, actor, loadedTmpl, nil) @@ -2329,7 +2386,7 @@ func TestEnsureWorkerAssigned_ContentionRecordsOneObservation(t *testing.T) { } w, actor, reader := newContendedWorkflow(t, sched) - _, worker, err := w.ensureWorkerAssigned(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, worker, err := w.ensureWorkerAssigned(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if err != nil { t.Fatalf("ensureWorkerAssigned: %v", err) } @@ -2363,7 +2420,7 @@ func TestEnsureWorkerAssigned_ExhaustedBackoffRecordsOneError(t *testing.T) { } w, actor, reader := newContendedWorkflow(t, sched) - _, _, err := w.ensureWorkerAssigned(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, _, err := w.ensureWorkerAssigned(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if err == nil { t.Fatal("ensureWorkerAssigned succeeded, want a failure after the backoff ended") } @@ -2432,7 +2489,7 @@ func TestEnsureWorkerAssigned_CancelledDuringBackoffRecordsOne(t *testing.T) { } defer cancel() - _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if !errors.Is(err, context.Canceled) { t.Fatalf("ensureWorkerAssigned error = %v, want context.Canceled", err) } @@ -2462,7 +2519,7 @@ func TestEnsureWorkerAssigned_CancelledBeforeFirstAttemptRecordsNothing(t *testi ctx, cancel := context.WithCancel(context.Background()) cancel() - _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if !errors.Is(err, context.Canceled) { t.Fatalf("ensureWorkerAssigned error = %v, want context.Canceled", err) } @@ -2494,7 +2551,7 @@ func TestEnsureWorkerAssigned_CancelledInLastSleepRecordsOne(t *testing.T) { } defer cancel() - _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, _, err := w.ensureWorkerAssigned(ctx, resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if !errors.Is(err, context.Canceled) { t.Fatalf("ensureWorkerAssigned error = %v, want context.Canceled", err) } @@ -2523,7 +2580,7 @@ func TestEnsureWorkerAssigned_ContextEndsInsideAttemptRecordsOne(t *testing.T) { } w, actor, reader := newContendedWorkflow(t, sched) - _, _, err := w.ensureWorkerAssigned(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, _, err := w.ensureWorkerAssigned(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if !errors.Is(err, context.DeadlineExceeded) { t.Fatalf("ensureWorkerAssigned error = %v, want context.DeadlineExceeded", err) } @@ -2588,7 +2645,7 @@ func TestEnsureWorkerAssigned_CapacityOutcome(t *testing.T) { w, actor, reader := newContendedWorkflow(t, sched) actor.Status.AssignedNode = tt.assignedNode - _, _, err := w.ensureWorkerAssigned(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}) + _, _, err := w.ensureWorkerAssigned(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if got := apierror.Code(err); got != tt.wantCode { t.Errorf("ensureWorkerAssigned() = %v, want code %v", err, tt.wantCode) } @@ -2766,7 +2823,7 @@ func TestAssignWorkerAttempt_PrefersRuntimeMatchingWorkerAndFallsBack(t *testing seedRuntimeWorker(t, ctx, st, "amd-pod", "node-amd", amd64RT) actor := seedActorWithSnapshot(t, ctx, st, suspended, "", durableMemorySnapshot(t, amd64RT)) - stored, worker, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}) + stored, worker, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt: %v", err) } @@ -2782,7 +2839,7 @@ func TestAssignWorkerAttempt_PrefersRuntimeMatchingWorkerAndFallsBack(t *testing seedRuntimeWorker(t, ctx, st, "amd-pod", "node-amd", newDefaultRT, oldRestorableRT) actor := seedActorWithSnapshot(t, ctx, st, suspended, "", durableMemorySnapshot(t, oldRestorableRT)) - stored, _, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}) + stored, _, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt: %v", err) } @@ -2797,7 +2854,7 @@ func TestAssignWorkerAttempt_PrefersRuntimeMatchingWorkerAndFallsBack(t *testing seedRuntimeWorker(t, ctx, st, "arm-pod", "node-arm", arm64RT) actor := seedActorWithSnapshot(t, ctx, st, suspended, "", durableMemorySnapshot(t, amd64RT)) - stored, worker, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}) + stored, worker, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt: %v", err) } @@ -2825,7 +2882,7 @@ func TestAssignWorkerAttempt_PrefersRuntimeMatchingWorkerAndFallsBack(t *testing snap.Fidelity = fidelity actor := seedActorWithSnapshot(t, ctx, st, suspended, "", snap) - _, _, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}) + _, _, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if apierror.Code(err) != codes.ResourceExhausted { t.Fatalf("assignWorkerAttempt with only a microvm worker = %v, want ResourceExhausted", err) } @@ -2842,7 +2899,7 @@ func TestAssignWorkerAttempt_PrefersRuntimeMatchingWorkerAndFallsBack(t *testing local.SandboxRuntime = amd64RT actor := seedActorWithSnapshot(t, ctx, st, suspended, "node-1", local) - _, _, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}) + _, _, err := newSchedulingWorkflow(t, ctx, st).assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if got := apierror.Code(err); got != codes.ResourceExhausted { t.Fatalf("apierror.Code(err) = %v, want %v (err: %v)", got, codes.ResourceExhausted, err) } @@ -2872,7 +2929,7 @@ func TestAssignWorkerAttempt_PrefersRuntimeMatchingWorkerAndFallsBack(t *testing actor := seedActorWithSnapshot(t, ctx, st, suspended, "", durableMemorySnapshot(t, oldRestorableRT)) w := &ActorWorkflow{store: st, scheduler: &relaxingTestScheduler{Scheduler: scheduling.New(nil), relaxedWorker: worker}} - stored, _, err := w.assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}) + stored, _, err := w.assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt: %v", err) } @@ -2892,7 +2949,7 @@ func TestAssignWorkerAttempt_PrefersRuntimeMatchingWorkerAndFallsBack(t *testing actor := seedActorWithSnapshot(t, ctx, st, suspended, "", durableMemorySnapshot(t, oldRestorableRT)) w := &ActorWorkflow{store: st, scheduler: &relaxingTestScheduler{Scheduler: scheduling.New(nil), relaxedWorker: stale}} - stored, bound, err := w.assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}) + stored, bound, err := w.assignWorkerAttempt(ctx, actorRef, actor, &ateapi.ActorTemplate{}, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt: %v", err) } @@ -3238,7 +3295,7 @@ func TestResume_ChecksMountedVolumesBeforeAttach(t *testing.T) { // u is declared but not mounted; o is not declared at all. tmpl := volumeTemplate([]string{"a", "u", "b"}, "a", "b") - assigned, worker, err := w.assignWorkerAttempt(ctx, actorRef, actor, tmpl) + assigned, worker, err := w.assignWorkerAttempt(ctx, actorRef, actor, tmpl, store.Precondition{}) if err != nil { t.Fatalf("assignWorkerAttempt: %v", err) } @@ -3507,7 +3564,7 @@ func TestAssignWorkerAttempt_WorkerWithoutNodeRejectsVolumes(t *testing.T) { w := newVolumeAssignWorkflow(persistence, wc, plugin) tmpl := volumeTemplate([]string{"vol"}, tt.mounted...) - _, _, err := w.assignWorkerAttempt(ctx, actorRef, actor, tmpl) + _, _, err := w.assignWorkerAttempt(ctx, actorRef, actor, tmpl, store.Precondition{}) stored, gerr := persistence.GetActor(ctx, actorRef) if gerr != nil { t.Fatalf("GetActor: %v", gerr) @@ -3545,13 +3602,13 @@ func TestAssignWorkerAttempt_RefusesChangedOverhead(t *testing.T) { w.store.(*contentionStore).workers[locked.GetMetadata().GetName()] = locked tmpl := &ateapi.ActorTemplate{Resources: &ateapi.ResourceRequirements{Limits: &ateapi.Resources{MemoryBytes: 256 << 20}}} - _, _, err := w.assignWorkerAttempt(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl) + _, _, err := w.assignWorkerAttempt(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl, store.Precondition{}) if !errors.Is(err, errWorkerFilledUp) { t.Fatalf("assignWorkerAttempt() = %v, want %v", err, errWorkerFilledUp) } w.store.(*contentionStore).workers[locked.GetMetadata().GetName()] = cached - if _, _, err := w.assignWorkerAttempt(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl); err != nil { + if _, _, err := w.assignWorkerAttempt(context.Background(), resources.ActorRef{Atespace: "team-a", Name: "id1"}, actor, tmpl, store.Precondition{}); err != nil { t.Fatalf("assignWorkerAttempt() with an unchanged overhead = %v", err) } } diff --git a/cmd/ateapi/internal/controlapi/workflow_revert.go b/cmd/ateapi/internal/controlapi/workflow_revert.go index 1c56e9d994..26431ed812 100644 --- a/cmd/ateapi/internal/controlapi/workflow_revert.go +++ b/cmd/ateapi/internal/controlapi/workflow_revert.go @@ -57,7 +57,8 @@ func isRevertable(actor *ateapi.Actor) bool { // Idempotent: each step keys on a persisted field rather than on the state the // actor was reverted from, so a re-entered workflow fast-forwards to wherever // the previous attempt stopped. -func (w *ActorWorkflow) RevertActor(ctx context.Context, actorRef resources.ActorRef) (_ *ateapi.Actor, err error) { +// Fails with ABORTED if the actor does not match precondition. +func (w *ActorWorkflow) RevertActor(ctx context.Context, actorRef resources.ActorRef, precondition store.Precondition) (_ *ateapi.Actor, err error) { ctx = preview.ContextWithOptIn(ctx) start := time.Now() var actor *ateapi.Actor @@ -80,7 +81,7 @@ func (w *ActorWorkflow) RevertActor(ctx context.Context, actorRef resources.Acto } defer lease.Close() - actor, actorTemplate, err = w.loadActorForRevert(leaseCtx, actorRef) + actor, actorTemplate, err = w.loadActorForRevert(leaseCtx, actorRef, precondition) if err != nil { return nil, err } @@ -112,8 +113,9 @@ func (w *ActorWorkflow) RevertActor(ctx context.Context, actorRef resources.Acto return finalized, nil } -// loadActorForRevert fetches the current actor record and its template. -func (w *ActorWorkflow) loadActorForRevert(ctx context.Context, actorRef resources.ActorRef) (_ *ateapi.Actor, _ *ateapi.ActorTemplate, err error) { +// loadActorForRevert fetches the current actor record, checks it against +// precondition, and fetches its template. +func (w *ActorWorkflow) loadActorForRevert(ctx context.Context, actorRef resources.ActorRef, precondition store.Precondition) (_ *ateapi.Actor, _ *ateapi.ActorTemplate, err error) { ctx, done := stepSpan(ctx, "LoadActorForRevert") defer func() { err = done(err) }() @@ -124,6 +126,9 @@ func (w *ActorWorkflow) loadActorForRevert(ctx context.Context, actorRef resourc } return nil, nil, fmt.Errorf("while fetching actor: %w", err) } + if err := checkActorPreconditions(actorRef, precondition, actor); err != nil { + return nil, nil, err + } actorTemplate, err := resolveActorTemplate(ctx, w.store, actor) if errors.Is(err, errActorTemplateNotFound) { @@ -160,10 +165,7 @@ func (w *ActorWorkflow) ensureMarkedReverting(ctx context.Context, actorRef reso return nil }) if err != nil { - if errors.Is(err, store.ErrVersionConflict) { - return nil, apierror.Aborted("concurrent update conflict, please retry") - } - return nil, fmt.Errorf("while setting actor state to REVERTING: %w", err) + return nil, fmt.Errorf("while setting actor state to REVERTING: %w", actorWriteError(actorRef, err)) } logActorStateChanged(ctx, storedActor, ateattr.OperationRevert) return storedActor, nil diff --git a/cmd/ateapi/internal/controlapi/workflow_revert_test.go b/cmd/ateapi/internal/controlapi/workflow_revert_test.go index 177af4610d..ac51809831 100644 --- a/cmd/ateapi/internal/controlapi/workflow_revert_test.go +++ b/cmd/ateapi/internal/controlapi/workflow_revert_test.go @@ -96,6 +96,31 @@ func TestEnsureMarkedReverting_AcceptsPaused(t *testing.T) { } } +// An actor recreated after the workflow read it fails the write with ABORTED, +// the code the RPC returns, so the lifecycle metric records the same code. +func TestEnsureMarkedReverting_RecreatedActorAborts(t *testing.T) { + ctx := context.Background() + st, cleanup := storetest.SetupTestStore(t) + defer cleanup() + w := newTestActorWorkflow(t, st, "ns", "tmpl1") + + actorRef := resources.ActorRef{Atespace: "team-a", Name: "id1"} + seedWorkflowActor(t, ctx, st, actorRef, "ns", "tmpl1", ateapi.ActorState_ACTOR_STATE_CRASHED) + stale, err := st.GetActor(ctx, actorRef) + if err != nil { + t.Fatalf("get seeded actor: %v", err) + } + if _, err := st.DeleteActor(ctx, actorRef, store.Precondition{}); err != nil { + t.Fatalf("DeleteActor: %v", err) + } + seedWorkflowActor(t, ctx, st, actorRef, "ns", "tmpl1", ateapi.ActorState_ACTOR_STATE_CRASHED) + + _, err = w.ensureMarkedReverting(ctx, actorRef, stale) + if got := apierror.Code(err); got != codes.Aborted { + t.Errorf("ensureMarkedReverting code = %v, want %v; error = %v", got, codes.Aborted, err) + } +} + // TestRevertActor_ReturnsActorToItsSnapshot covers the whole workflow from each // accepted origin: the actor lands SUSPENDED holding the same external snapshot // it started with, and every pointer to the discarded execution is gone. @@ -155,7 +180,7 @@ func TestRevertActor_ReturnsActorToItsSnapshot(t *testing.T) { } }) - reverted, err := w.RevertActor(ctx, actorRef) + reverted, err := w.RevertActor(ctx, actorRef, store.Precondition{}) if err != nil { t.Fatalf("RevertActor: %v", err) } @@ -205,7 +230,7 @@ func TestRevertActor_ReturnsActorToItsSnapshot(t *testing.T) { }) seedWireWorker(t, ctx, st, assignmentOf(running)) wire, atelet := newWireCaptureWorkflow(t, st) - suspended, err := wire.SuspendActor(ctx, actorRef, suspendSync) + suspended, err := wire.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync) if err != nil { t.Fatalf("SuspendActor after revert: %v", err) } @@ -294,7 +319,7 @@ func TestRevertActor_UnreachableNode(t *testing.T) { } } } - reverted, err := w.RevertActor(ctx, ref) + reverted, err := w.RevertActor(ctx, ref, store.Precondition{}) if got := apierror.Code(err); got != tt.wantCode { t.Fatalf("RevertActor = %v, want %v", err, tt.wantCode) } @@ -316,7 +341,7 @@ func TestRevertActor_UnreachableNode(t *testing.T) { atelet.mu.Lock() atelet.onTerminate = nil atelet.mu.Unlock() - reverted, err = w.RevertActor(ctx, ref) + reverted, err = w.RevertActor(ctx, ref, store.Precondition{}) if err != nil { t.Fatalf("retry after conflict: %v", err) } @@ -373,7 +398,7 @@ func TestRevertActor_PausedSnapshotAlreadyUploaded(t *testing.T) { } }) - reverted, err := w.RevertActor(ctx, actorRef) + reverted, err := w.RevertActor(ctx, actorRef, store.Precondition{}) if err != nil { t.Fatalf("RevertActor: %v", err) } @@ -403,7 +428,7 @@ func TestRevertActor_RejectsSuspended(t *testing.T) { actorRef := resources.ActorRef{Atespace: "team-a", Name: "id1"} seedWorkflowActor(t, ctx, st, actorRef, "ns", "tmpl1", ateapi.ActorState_ACTOR_STATE_SUSPENDED) - if _, err := w.RevertActor(ctx, actorRef); apierror.Code(err) != codes.FailedPrecondition { + if _, err := w.RevertActor(ctx, actorRef, store.Precondition{}); apierror.Code(err) != codes.FailedPrecondition { t.Fatalf("RevertActor = %v, want FailedPrecondition", err) } }) @@ -417,10 +442,10 @@ func TestRevertActor_RejectsSuspended(t *testing.T) { actorRef := resources.ActorRef{Atespace: "team-a", Name: "id1"} seedWorkflowActor(t, ctx, st, actorRef, "ns", "tmpl1", ateapi.ActorState_ACTOR_STATE_CRASHED) - if _, err := w.RevertActor(ctx, actorRef); err != nil { + if _, err := w.RevertActor(ctx, actorRef, store.Precondition{}); err != nil { t.Fatalf("first RevertActor: %v", err) } - if _, err := w.RevertActor(ctx, actorRef); apierror.Code(err) != codes.FailedPrecondition { + if _, err := w.RevertActor(ctx, actorRef, store.Precondition{}); apierror.Code(err) != codes.FailedPrecondition { t.Fatalf("second RevertActor = %v, want FailedPrecondition", err) } }) @@ -438,7 +463,7 @@ func TestRevertActor_MissingTemplate(t *testing.T) { actorRef := resources.ActorRef{Atespace: "team-a", Name: "id1"} seedWorkflowActor(t, ctx, st, actorRef, "ns", "missing-tmpl", ateapi.ActorState_ACTOR_STATE_CRASHED) - reverted, err := w.RevertActor(ctx, actorRef) + reverted, err := w.RevertActor(ctx, actorRef, store.Precondition{}) if err != nil { t.Fatalf("RevertActor: %v", err) } @@ -462,7 +487,7 @@ func TestRevertActor_NoSnapshotToRevertTo(t *testing.T) { a.Status.Crash = newActorCrash("resume", crashMessageWorkerDraining) }) - reverted, err := w.RevertActor(ctx, actorRef) + reverted, err := w.RevertActor(ctx, actorRef, store.Precondition{}) if err != nil { t.Fatalf("RevertActor: %v", err) } diff --git a/cmd/ateapi/internal/controlapi/workflow_suspend.go b/cmd/ateapi/internal/controlapi/workflow_suspend.go index e9a25a6eff..eec3216cfa 100644 --- a/cmd/ateapi/internal/controlapi/workflow_suspend.go +++ b/cmd/ateapi/internal/controlapi/workflow_suspend.go @@ -16,7 +16,6 @@ package controlapi import ( "context" - "errors" "fmt" "log/slog" "time" @@ -74,7 +73,8 @@ func (m suspendMode) uploadMode() ateletpb.UploadMode { // is returned as it is, whatever the mode. Idempotent: a re-entered workflow // fast-forwards past the steps a previous attempt completed, deriving // progress from the persisted actor alone. -func (w *ActorWorkflow) SuspendActor(ctx context.Context, actorRef resources.ActorRef, mode suspendMode) (_ *ateapi.Actor, err error) { +// Fails with ABORTED if the actor does not match precondition. +func (w *ActorWorkflow) SuspendActor(ctx context.Context, actorRef resources.ActorRef, precondition store.Precondition, mode suspendMode) (_ *ateapi.Actor, err error) { ctx = preview.ContextWithOptIn(ctx) start := time.Now() var actor *ateapi.Actor @@ -101,7 +101,9 @@ func (w *ActorWorkflow) SuspendActor(ctx context.Context, actorRef resources.Act } defer lease.Close() - actor, actorTemplate, err = w.loadActorForSuspend(leaseCtx, actorRef) + // The load checks precondition before the SUSPENDED shortcut, which would + // otherwise report success for a different actor under the same name. + actor, actorTemplate, err = w.loadActorForSuspend(leaseCtx, actorRef, precondition) if err != nil { return nil, err } @@ -137,8 +139,9 @@ func (w *ActorWorkflow) SuspendActor(ctx context.Context, actorRef resources.Act return actor, nil } -// loadActorForSuspend fetches the current actor record and its template. -func (w *ActorWorkflow) loadActorForSuspend(ctx context.Context, actorRef resources.ActorRef) (_ *ateapi.Actor, _ *ateapi.ActorTemplate, err error) { +// loadActorForSuspend fetches the current actor record, checks it against +// precondition, and fetches its template. +func (w *ActorWorkflow) loadActorForSuspend(ctx context.Context, actorRef resources.ActorRef, precondition store.Precondition) (_ *ateapi.Actor, _ *ateapi.ActorTemplate, err error) { ctx, done := stepSpan(ctx, "LoadActorForSuspend") defer func() { err = done(err) }() @@ -146,6 +149,9 @@ func (w *ActorWorkflow) loadActorForSuspend(ctx context.Context, actorRef resour if err != nil { return nil, nil, err } + if err := checkActorPreconditions(actorRef, precondition, actor); err != nil { + return nil, nil, err + } actorTemplate, err := resolveActorTemplate(ctx, w.store, actor) if err != nil { return nil, nil, err @@ -201,10 +207,7 @@ func (w *ActorWorkflow) ensureMarkedSuspending(ctx context.Context, actorRef res return nil }) if err != nil { - if errors.Is(err, store.ErrVersionConflict) { - return nil, apierror.Aborted("concurrent update conflict, please retry") - } - return nil, err + return nil, actorWriteError(actorRef, err) } logActorStateChanged(ctx, storedActor, ateattr.OperationSuspend) return storedActor, nil diff --git a/cmd/ateapi/internal/controlapi/workflow_suspend_async_test.go b/cmd/ateapi/internal/controlapi/workflow_suspend_async_test.go index bcae80ed32..f48a17805d 100644 --- a/cmd/ateapi/internal/controlapi/workflow_suspend_async_test.go +++ b/cmd/ateapi/internal/controlapi/workflow_suspend_async_test.go @@ -20,6 +20,7 @@ import ( "github.com/google/go-cmp/cmp" "go.ate.dev/substrate/api/ateapi/v1" + "go.ate.dev/substrate/cmd/ateapi/internal/store" "go.ate.dev/substrate/cmd/ateapi/internal/store/storetest" "go.ate.dev/substrate/internal/apierror" "go.ate.dev/substrate/internal/ateattr" @@ -54,7 +55,7 @@ func TestSuspendActorAsync_Finalized_NodeUnknown(t *testing.T) { }, }) - if _, err := w.SuspendActor(ctx, actorRef, suspendAsync); apierror.Code(err) != codes.FailedPrecondition { + if _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendAsync); apierror.Code(err) != codes.FailedPrecondition { t.Fatalf("Async SuspendActor error = %v, want FailedPrecondition for the actor it crashed", err) } if checkpoints, _ := atelet.calls(); checkpoints != 1 { @@ -113,7 +114,7 @@ func TestSuspendActorAsync_Finalized_KeepsCrashFromWorkerDelete(t *testing.T) { seedWireWorker(t, ctx, st, assignmentOf(created)) w, _ := newWireCaptureWorkflow(t, workerDeletedDuringReleaseStore{Interface: st}) - _, err := w.SuspendActor(ctx, actorRef, suspendAsync) + _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendAsync) assertConcurrentCrashKept(t, ctx, st, actorRef, err, "suspend failed: "+crashMessageWorkerPodGone) } @@ -163,7 +164,7 @@ func TestSuspendActorAsync_Finalized_RecordsFidelity(t *testing.T) { }) seedWireWorker(t, ctx, st, assignmentOf(created)) - got, err := w.SuspendActor(ctx, actorRef, suspendAsync) + got, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendAsync) if err != nil { t.Fatalf("SuspendActor: %v", err) } @@ -255,7 +256,7 @@ func TestSuspendActorAsync_Finalized_MissingSnapshotClearsAssignment(t *testing. seedWireWorker(t, ctx, st, assignmentOf(created)) updateDuringCheckpoint(t, atelet, st, actorRef, tt.clobber) - if _, err := w.SuspendActor(ctx, actorRef, suspendAsync); apierror.Code(err) != codes.FailedPrecondition { + if _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendAsync); apierror.Code(err) != codes.FailedPrecondition { t.Fatalf("Async SuspendActor error = %v, want FailedPrecondition for the actor it crashed", err) } got := mustReadActor(t, ctx, st, actorRef) @@ -323,7 +324,7 @@ func TestSuspendActorAsync_AteletPaused_DialFailureLeavesActorRetryable(t *testi storetest.MustCreateActor(t, ctx, persistence, actor) w := newMarkOnlyWorkflow(persistence) - _, err := w.SuspendActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "actor-1"}, suspendAsync) + _, err := w.SuspendActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "actor-1"}, store.Precondition{}, suspendAsync) assertStoppedAtDial(t, err) stored := mustReadActor(t, ctx, persistence, resources.ActorRef{Atespace: "team-a", Name: "actor-1"}) @@ -378,7 +379,7 @@ func TestSuspendActorAsync_AteletPaused_ForwardsPreferredFidelity(t *testing.T) }, }) - if _, err := w.SuspendActor(ctx, actorRef, suspendAsync); err != nil { + if _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendAsync); err != nil { t.Fatalf("SuspendActor: %v", err) } req := atelet.checkpointRequest() diff --git a/cmd/ateapi/internal/controlapi/workflow_suspend_test.go b/cmd/ateapi/internal/controlapi/workflow_suspend_test.go index a941d9bf23..bdc1d64f30 100644 --- a/cmd/ateapi/internal/controlapi/workflow_suspend_test.go +++ b/cmd/ateapi/internal/controlapi/workflow_suspend_test.go @@ -76,7 +76,7 @@ func TestSuspendActor_CheckpointError(t *testing.T) { } return tt.err } - _, err := w.SuspendActor(callCtx, actorRef, mode.suspendMode) + _, err := w.SuspendActor(callCtx, actorRef, store.Precondition{}, mode.suspendMode) if got := apierror.Code(err); got != tt.wantCode { t.Fatalf("SuspendActor error = %v (code %v), want %v", err, got, tt.wantCode) } @@ -118,7 +118,7 @@ func TestSuspendActor_CheckpointError(t *testing.T) { atelet.mu.Lock() atelet.onCheckpoint = nil atelet.mu.Unlock() - finished, err := w.SuspendActor(ctx, actorRef, mode.suspendMode) + finished, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, mode.suspendMode) if err != nil { t.Fatalf("SuspendActor retry: %v", err) } @@ -171,7 +171,7 @@ func TestSuspendActor_MarkedSuspending_SnapshotURI(t *testing.T) { }, }) w := newMarkOnlyWorkflow(persistence) - _, err := w.SuspendActor(ctx, actorRef, suspendSync) + _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync) assertStoppedAtDial(t, err) marked := mustReadActor(t, ctx, persistence, actorRef) @@ -233,7 +233,7 @@ func TestSuspendActor_MarkedSuspending_ReentryKeepsPersistedSnapshotLocation(t * }, }, }) - suspended, err := w.SuspendActor(ctx, actorRef, tt.mode) + suspended, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, tt.mode) if err != nil { t.Fatalf("SuspendActor: %v", err) } @@ -298,7 +298,7 @@ func TestSuspendActorWorkflow_SuspendedReturnsAsIs(t *testing.T) { seedWorkflowActor(t, ctx, st, actorRef, "ns", "tmpl1", ateapi.ActorState_ACTOR_STATE_SUSPENDED, tc.seedOpts...) seeded := mustReadActor(t, ctx, st, actorRef) - returned, err := w.SuspendActor(ctx, actorRef, mode.suspendMode) + returned, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, mode.suspendMode) if err != nil { t.Fatalf("SuspendActor: %v", err) } @@ -333,7 +333,7 @@ func TestSuspendActor_MarkedSuspending_StateMatrix(t *testing.T) { a.Status.WorkerAssignment = wireTestAssignment() }) - _, err := w.SuspendActor(ctx, actorRef, mode.suspendMode) + _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, mode.suspendMode) stored := mustReadActor(t, ctx, persistence, actorRef) switch seedState { case ateapi.ActorState_ACTOR_STATE_RUNNING, ateapi.ActorState_ACTOR_STATE_SUSPENDING: @@ -429,7 +429,7 @@ func TestSuspendActor_AteletSuspended_DialFailureLeavesActorRetryable(t *testing storetest.MustCreateActor(t, ctx, persistence, actor) w := newMarkOnlyWorkflow(persistence) - _, err := w.SuspendActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "actor-1"}, suspendSync) + _, err := w.SuspendActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "actor-1"}, store.Precondition{}, suspendSync) assertStoppedAtDial(t, err) // A dial failure is transient from this workflow's point of view: it @@ -481,7 +481,7 @@ func TestSuspendActor_AteletSuspended_WireRequest(t *testing.T) { }, }) - if _, err := w.SuspendActor(ctx, actorRef, suspendSync); err != nil { + if _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync); err != nil { t.Fatalf("SuspendActor: %v", err) } req := atelet.checkpointRequest() @@ -569,7 +569,7 @@ func TestSuspendActor_Finalized_ReleasesReplacedSnapshot(t *testing.T) { } }) - stored, err := w.SuspendActor(ctx, actorRef, suspendSync) + stored, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync) if err != nil { t.Fatalf("SuspendActor: %v", err) } @@ -654,7 +654,7 @@ func TestSuspendActor_Finalized_PauseReleasesReplacedSnapshot(t *testing.T) { Object: &ateletpb.ObjectStorage{SnapshotUri: paused.String()}, }}} - stored, err := w.SuspendActor(ctx, actorRef, suspendAsync) + stored, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendAsync) if err != nil { t.Fatalf("SuspendActor: %v", err) } @@ -779,7 +779,7 @@ func TestSuspendActor_Finalized_CommitsDespiteObjectStoreFailure(t *testing.T) { }) objects.OnDelete = func(string, string) error { return errObjectStore } - stored, err := w.SuspendActor(ctx, actorRef, suspendSync) + stored, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync) if err != nil { t.Fatalf("SuspendActor: %v", err) } @@ -836,7 +836,7 @@ func TestSuspendActor_Finalized_KeepsReplacedSnapshotOnConflict(t *testing.T) { } }) - if _, err := w.SuspendActor(ctx, actorRef, suspendSync); apierror.Code(err) != codes.Aborted { + if _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync); apierror.Code(err) != codes.Aborted { t.Fatalf("SuspendActor = %v, want code Aborted", err) } // Every actor update conflicts, so pin that the Aborted came from finalize @@ -889,7 +889,7 @@ func TestSuspendActor_Finalized_KeepsCrashFromWorkerDelete(t *testing.T) { seedWireWorker(t, ctx, persistence, assignmentOf(created)) w, _ := newWireCaptureWorkflow(t, workerDeletedDuringReleaseStore{Interface: persistence}) - _, err := w.SuspendActor(ctx, actorRef, suspendSync) + _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync) assertConcurrentCrashKept(t, ctx, persistence, actorRef, err, "suspend failed: "+crashMessageWorkerPodGone) } @@ -948,7 +948,7 @@ func TestSuspendActor_Finalized_ReleasesOnlyOwnWorker(t *testing.T) { ActorUid: uid, }) - if _, err := w.SuspendActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "shared"}, suspendSync); err != nil { + if _, err := w.SuspendActor(ctx, resources.ActorRef{Atespace: "team-a", Name: "shared"}, store.Precondition{}, suspendSync); err != nil { t.Fatalf("SuspendActor: %v", err) } @@ -990,7 +990,7 @@ func TestSuspendActor_Finalized_MissingDurableSnapshotClearsAssignment(t *testin s.Snapshots = nil }) - if _, err := w.SuspendActor(ctx, actorRef, suspendSync); apierror.Code(err) != codes.FailedPrecondition { + if _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync); apierror.Code(err) != codes.FailedPrecondition { t.Fatalf("SuspendActor error = %v, want FailedPrecondition for the actor it crashed", err) } got, err := st.GetActor(ctx, actorRef) @@ -1208,7 +1208,7 @@ func TestSuspendAndPause_CharacteristicMatrix(t *testing.T) { seedWireWorker(t, ctx, persistence, assignment) w, atelet := newWireCaptureWorkflow(t, persistence) - _, err := w.SuspendActor(ctx, actorRef, mode.suspendMode) + _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, mode.suspendMode) stored := mustReadActor(t, ctx, persistence, actorRef) got := suspendOutcome{ code: apierror.Code(err), @@ -1260,7 +1260,7 @@ func TestSuspendAndPause_FinalizeWithoutAssignment(t *testing.T) { s.WorkerAssignment = nil }) - returned, err := w.SuspendActor(ctx, actorRef, mode.suspendMode) + returned, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, mode.suspendMode) if got := apierror.Code(err); got != codes.FailedPrecondition { t.Fatalf("%s: code = %v (err %v), want FailedPrecondition", mode.name, got, err) } @@ -1299,7 +1299,7 @@ func TestSuspendAndPause_InvalidStorageLocationRejected(t *testing.T) { }, }) - if _, err := w.SuspendActor(ctx, actorRef, mode.suspendMode); err == nil { + if _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, mode.suspendMode); err == nil { t.Fatalf("%s: expected error for invalid storage location, got nil", mode.name) } stored := mustReadActor(t, ctx, persistence, actorRef) @@ -1536,7 +1536,7 @@ func TestSuspendActor_AppliesCheckpointState(t *testing.T) { return nil } - _, err := w.SuspendActor(ctx, actorRef, tt.mode) + _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, tt.mode) stored := mustReadActor(t, ctx, persistence, actorRef) if tt.wantCode != codes.OK { if got := apierror.Code(err); got != tt.wantCode { @@ -1640,7 +1640,7 @@ func TestSuspendActor_Finalized_RecordsLocalCopyWhenKept(t *testing.T) { return nil } - if _, err := w.SuspendActor(ctx, actorRef, suspendSync); err != nil { + if _, err := w.SuspendActor(ctx, actorRef, store.Precondition{}, suspendSync); err != nil { t.Fatalf("suspend: %v", err) } stored := mustReadActor(t, ctx, persistence, actorRef) diff --git a/cmd/ateapi/internal/controlapi/workflow_test.go b/cmd/ateapi/internal/controlapi/workflow_test.go index 4315f94e94..2fc4c2793a 100644 --- a/cmd/ateapi/internal/controlapi/workflow_test.go +++ b/cmd/ateapi/internal/controlapi/workflow_test.go @@ -78,7 +78,7 @@ func TestActorStateChangeRecords(t *testing.T) { }, }, transition: func(t *testing.T, w *ActorWorkflow, ref resources.ActorRef, _ *ateapi.Actor, _ *ateapi.ActorTemplate) { - if _, err := w.SuspendActor(context.Background(), ref, suspendAsync); err != nil { + if _, err := w.SuspendActor(context.Background(), ref, store.Precondition{}, suspendAsync); err != nil { t.Fatalf("SuspendActor: %v", err) } }, @@ -187,7 +187,7 @@ func markOnly(t *testing.T, w *ActorWorkflow, ref resources.ActorRef, actor *ate t.Fatalf("UpdateActor: %v", err) } w.dialer = newDanglingDialer() - _, err := w.SuspendActor(ctx, ref, mode) + _, err := w.SuspendActor(ctx, ref, store.Precondition{}, mode) assertStoppedAtDial(t, err) } diff --git a/cmd/ateapi/internal/workerservice/crash.go b/cmd/ateapi/internal/workerservice/crash.go index cdd064b038..a7cd82a696 100644 --- a/cmd/ateapi/internal/workerservice/crash.go +++ b/cmd/ateapi/internal/workerservice/crash.go @@ -38,7 +38,7 @@ func (s *Server) ReportActorCrashed(ctx context.Context, req *ateapi.ReportActor workerName := req.GetWorker().GetName() actorRef := resources.ActorRefFromObjectRef(req.GetActor()) - if err := s.authorizeHostedActor(ctx, caller, workerName, actorRef, req.GetActorUid()); err != nil { + if _, err := s.authorizeHostedActor(ctx, caller, workerName, actorRef, req.GetActorUid()); err != nil { return nil, err } actor, err := s.control.CrashActorReportedByWorker(ctx, actorRef, req.GetActorUid(), workerName, req.GetMessage()) diff --git a/cmd/ateapi/internal/workerservice/service_test.go b/cmd/ateapi/internal/workerservice/service_test.go index 01e21f0622..7abd9b1f10 100644 --- a/cmd/ateapi/internal/workerservice/service_test.go +++ b/cmd/ateapi/internal/workerservice/service_test.go @@ -42,6 +42,9 @@ type fakeControl struct { calls []*ateapi.SuspendActorRequest resp *ateapi.SuspendActorResponse err error + // onSuspend, if set, runs before SuspendActor returns, as a write that + // races the suspend would. + onSuspend func() reports []appliedReport reportErr error @@ -51,6 +54,9 @@ type fakeControl struct { func (f *fakeControl) SuspendActor(_ context.Context, req *ateapi.SuspendActorRequest) (*ateapi.SuspendActorResponse, error) { f.calls = append(f.calls, req) + if f.onSuspend != nil { + f.onSuspend() + } return f.resp, f.err } diff --git a/cmd/ateapi/internal/workerservice/suspend.go b/cmd/ateapi/internal/workerservice/suspend.go index 1205fe4e60..19a0d00047 100644 --- a/cmd/ateapi/internal/workerservice/suspend.go +++ b/cmd/ateapi/internal/workerservice/suspend.go @@ -20,6 +20,8 @@ import ( "fmt" "log/slog" + "google.golang.org/grpc/codes" + "go.ate.dev/substrate/api/ateapi/v1" "go.ate.dev/substrate/cmd/ateapi/internal/apivalidation" "go.ate.dev/substrate/cmd/ateapi/internal/ateletauth" @@ -41,7 +43,8 @@ func (s *Server) RequestActorSuspend(ctx context.Context, req *ateapi.RequestAct workerName := req.GetWorker().GetName() actorRef := resources.ActorRefFromObjectRef(req.GetActor()) - if err := s.authorizeHostedActor(ctx, caller, workerName, actorRef, req.GetActorUid()); err != nil { + actor, err := s.authorizeHostedActor(ctx, caller, workerName, actorRef, req.GetActorUid()) + if err != nil { return nil, err } @@ -50,12 +53,25 @@ func (s *Server) RequestActorSuspend(ctx context.Context, req *ateapi.RequestAct // suspendable, and a proposal that races a resume, suspend, or delete loses // to whichever holds the Actor's lease. // - // TODO: the checks above run outside the Actor's lease, so there is a small - // race with the suspend that follows: within the one round trip it takes - // the workflow to acquire the lease, the Actor can be resumed onto another - // Worker, or deleted and recreated under the same name, and the workflow - // suspends whatever the reference resolves to by then. See #1773. - resp, err := s.control.SuspendActor(ctx, &ateapi.SuspendActorRequest{Actor: req.GetActor()}) + // The checks above run outside the Actor's lease. The uid and version + // preconditions make the workflow refuse the Actor if anything wrote it + // since, such as a resume onto another Worker or a delete and recreate. + resp, err := s.control.SuspendActor(ctx, &ateapi.SuspendActorRequest{ + Actor: req.GetActor(), + Preconditions: &ateapi.Preconditions{ + Uid: actor.GetMetadata().GetUid(), + Version: actor.GetMetadata().GetVersion(), + }, + }) + if apierror.Code(err) == codes.Aborted { + // The workflow also refuses with ABORTED when a precondition fails. + // Check again so an Actor the caller no longer hosts is NotFound, as + // above. If the caller still hosts it, the ABORTED stands, and the + // worker retries against the Actor's new version. + if _, authErr := s.authorizeHostedActor(ctx, caller, workerName, actorRef, req.GetActorUid()); apierror.Code(authErr) == codes.NotFound { + return nil, authErr + } + } if err != nil { return nil, err } @@ -69,15 +85,16 @@ func (s *Server) RequestActorSuspend(ctx context.Context, req *ateapi.RequestAct // authorizeHostedActor checks that the calling atelet may speak for actorRef: // workerName must be on the caller's node, and the actor must be assigned to it. -func (s *Server) authorizeHostedActor(ctx context.Context, caller *ateletauth.Caller, workerName string, actorRef resources.ActorRef, actorUID string) error { +// It returns the actor it checked. +func (s *Server) authorizeHostedActor(ctx context.Context, caller *ateletauth.Caller, workerName string, actorRef resources.ActorRef, actorUID string) (*ateapi.Actor, error) { // Use authoritative state to authorize the request, never the request // itself: the caller proves which node it is on, and nothing else. worker, err := s.store.GetWorker(ctx, workerName) if err != nil { if errors.Is(err, store.ErrNotFound) { - return apierror.NotFound("Worker %s not found", workerName) + return nil, apierror.NotFound("Worker %s not found", workerName) } - return fmt.Errorf("while fetching worker %s: %w", workerName, err) + return nil, fmt.Errorf("while fetching worker %s: %w", workerName, err) } if worker.GetNodeName() != caller.NodeName { // Do not disclose Workers on other nodes. @@ -86,17 +103,20 @@ func (s *Server) authorizeHostedActor(ctx context.Context, caller *ateletauth.Ca slog.String("worker_node", worker.GetNodeName()), slog.String("caller_node", caller.NodeName), slog.String("caller_pod", caller.PodName)) - return apierror.NotFound("Worker %s not found", workerName) + return nil, apierror.NotFound("Worker %s not found", workerName) } actor, err := s.store.GetActor(ctx, actorRef) if err != nil { if errors.Is(err, store.ErrNotFound) { - return apierror.NotFound("Actor %s not found", actorRef) + return nil, apierror.NotFound("Actor %s not found", actorRef) } - return fmt.Errorf("while fetching actor %s: %w", actorRef, err) + return nil, fmt.Errorf("while fetching actor %s: %w", actorRef, err) + } + if err := checkActorHostedBy(ctx, actor, workerName, actorUID); err != nil { + return nil, err } - return checkActorHostedBy(ctx, actor, workerName, actorUID) + return actor, nil } // checkActorHostedBy reports whether the Worker may speak for this Actor: the diff --git a/cmd/ateapi/internal/workerservice/suspend_test.go b/cmd/ateapi/internal/workerservice/suspend_test.go index 1681461c28..b12b9a73f0 100644 --- a/cmd/ateapi/internal/workerservice/suspend_test.go +++ b/cmd/ateapi/internal/workerservice/suspend_test.go @@ -27,6 +27,7 @@ import ( "go.ate.dev/substrate/cmd/ateapi/internal/store" "go.ate.dev/substrate/cmd/ateapi/internal/store/storetest" "go.ate.dev/substrate/internal/apierror" + "go.ate.dev/substrate/internal/resources" ) const ( @@ -87,7 +88,8 @@ func TestRequestActorSuspend(t *testing.T) { t.Fatalf("RequestActorSuspend() failed: %v", err) } want := []*ateapi.SuspendActorRequest{{ - Actor: &ateapi.ObjectRef{Atespace: suspendAtespace, Name: suspendActor}, + Actor: &ateapi.ObjectRef{Atespace: suspendAtespace, Name: suspendActor}, + Preconditions: &ateapi.Preconditions{Uid: actor.GetMetadata().GetUid(), Version: actor.GetMetadata().GetVersion()}, }} if diff := cmp.Diff(want, control.calls, protocmp.Transform()); diff != "" { t.Errorf("suspend calls mismatch (-want +got):\n%s", diff) @@ -210,19 +212,51 @@ func TestRequestActorSuspend_Errors(t *testing.T) { // The suspend is a proposal, and the control plane's refusal is the answer: a // request that loses a race to a resume, suspend, or delete comes back as what -// the workflow said, not as something the worker has to interpret. +// the workflow said, not as something the worker has to interpret. The +// exception is an Actor the caller no longer hosts, which is NotFound as +// before the suspend. func TestRequestActorSuspend_PassesThroughTheWorkflowsRefusal(t *testing.T) { - st, cleanup := storetest.SetupTestStore(t) - defer cleanup() - seedReportedWorker(t, st, testNode, &ateapi.WorkerResources{Actors: 1}) - actor := seedHostedActor(t, st, testWorkerName) - control := &fakeControl{err: apierror.FailedPrecondition("Actor is RESUMING")} - s := New(st, control, testAteletSPIFFEID, nil, "", nil) + tests := []struct { + name string + controlErr error + recreate bool + want codes.Code + }{ + {name: "refused", controlErr: apierror.FailedPrecondition("Actor is RESUMING"), want: codes.FailedPrecondition}, + {name: "lease contention", controlErr: apierror.Aborted("concurrent update conflict, please retry"), want: codes.Aborted}, + {name: "actor recreated", controlErr: apierror.Aborted("Actor does not have uid"), recreate: true, want: codes.NotFound}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + st, cleanup := storetest.SetupTestStore(t) + defer cleanup() + seedReportedWorker(t, st, testNode, &ateapi.WorkerResources{Actors: 1}) + actor := seedHostedActor(t, st, testWorkerName) + control := &fakeControl{err: tc.controlErr} + if tc.recreate { + control.onSuspend = func() { + // The store deletes only an Actor with no assignment. + if _, err := st.UpdateActor(ctx, resources.ActorRefFromActor(actor), store.PreconditionFrom(actor), func(a *ateapi.Actor) error { + a.Status = &ateapi.ActorStatus{State: ateapi.ActorState_ACTOR_STATE_SUSPENDED} + return nil + }); err != nil { + t.Fatalf("UpdateActor() failed: %v", err) + } + if _, err := st.DeleteActor(ctx, resources.ActorRefFromActor(actor), store.Precondition{}); err != nil { + t.Fatalf("DeleteActor() failed: %v", err) + } + seedHostedActor(t, st, testWorkerName) + } + } + s := New(st, control, testAteletSPIFFEID, nil, "", nil) - _, err := s.RequestActorSuspend( - ateletauthtest.ContextWith(ateletauthtest.CertOn(t, testNode)), - suspendRequest(actor.GetMetadata().GetUid())) - if got := apierror.Code(err); got != codes.FailedPrecondition { - t.Fatalf("code = %v (err %v), want FailedPrecondition", got, err) + _, err := s.RequestActorSuspend( + ateletauthtest.ContextWith(ateletauthtest.CertOn(t, testNode)), + suspendRequest(actor.GetMetadata().GetUid())) + if got := apierror.Code(err); got != tc.want { + t.Fatalf("code = %v (err %v), want %v", got, err, tc.want) + } + }) } } diff --git a/docs/api-style-guide.md b/docs/api-style-guide.md index e360a1939b..aa8bf271eb 100644 --- a/docs/api-style-guide.md +++ b/docs/api-style-guide.md @@ -344,6 +344,8 @@ rpc SuspendActor(SuspendActorRequest) returns (SuspendActorResponse) {} message SuspendActorRequest { ObjectRef actor = 1; + SuspendOptions options = 2; + Preconditions preconditions = 3; } message SuspendActorResponse { @@ -357,6 +359,7 @@ Rules: - Request message name **must** match the RPC name with a `Request` suffix. - The request **must** identify the target resource using an `ObjectRef` field (for both atespace-scoped and global-scoped resources). - Response message name **must** match the RPC name with a `Response` suffix. A custom method **must not** return the resource directly; put it in a field of the response, so method-specific output can be added later (e.g., `ResumeActorResponse.resumed`). +- A custom method that mutates the target resource **must** accept an optional `Preconditions preconditions` field (see section #7.2). --- @@ -553,7 +556,7 @@ updated, err := client.UpdateActor(ctx, &UpdateActorRequest{ - `version` and `uid` are control fields managed by the server, not mutable fields. A client echoes them back as guards, it never edits them. - Both are **required**: an update that leaves `version` (0) or `uid` ("") unset is rejected with `INVALID_ARGUMENT`. There is no blind by-name update. A client that has not read the resource cannot update it; a client that has read it already holds both values. -- The requirement is on Update only. Delete's guards stay optional (below), and Create assigns both fields rather than checking them. +- The requirement is on Update only. The guards of Delete and of custom methods stay optional (below), and Create assigns both fields rather than checking them. - Modify what you read, do not reconstruct it: step 2 above mutates the message the server returned rather than assembling a new `Actor`. - This matters when the server is newer than the client: a reconstructed message does not carry the fields the client does not recognize, and an update that omits an immutable field is rejected rather than silently rewriting it. @@ -574,12 +577,22 @@ message DeleteOptions { } ``` +**Custom methods:** the guards are specified in a `Preconditions` message with the same fields and semantics as `DeleteOptions`. The server checks them against the resource it is about to act on, before any early return for a resource already in the requested state: + +```proto +message SuspendActorRequest { + ObjectRef actor = 1; + SuspendOptions options = 2; + Preconditions preconditions = 3; +} +``` + **Server behavior (applies to `version` and `uid` alike):** - If the client provides a `version` or `uid` that does not match the server's current value: return `ABORTED`. - On Update, if the client omits either guard: return `INVALID_ARGUMENT`. The request is malformed, so this is decided before the resource is read. -- On Delete, if the client omits a guard: skip that check. +- On Delete or a custom method, if the client omits a guard: skip that check. -So Update never gives last-writer-wins, while Delete still does by default. +So Update never gives last-writer-wins, while Delete and custom methods still do by default. --- diff --git a/docs/reference/api-guide.md b/docs/reference/api-guide.md index 35ee6bce4a..4afe81e47c 100644 --- a/docs/reference/api-guide.md +++ b/docs/reference/api-guide.md @@ -761,6 +761,7 @@ Because the guards are required and only a read supplies them, an update is alwa Activates a suspended actor by restoring it onto a physical worker. * **Request:** `ResumeActorRequest` * `actor`: `ObjectRef` of the actor to resume. + * `preconditions`: (Optional) `uid` and `version` guards on the actor, with the same semantics as `DeleteActor`'s `options`. A mismatch returns `ABORTED`. * **Response:** `ResumeActorResponse` containing the updated `Actor` object (including the physical worker placement in `status.worker_assignment`). * **Errors:** `RESOURCE_EXHAUSTED` if no eligible worker has room. `FAILED_PRECONDITION` if the actor is `ACTOR_STATE_CRASHED`, or if at least one worker is eligible and the actor is larger than each of them, even when empty. Unavailable workers count, so a short outage gives `RESOURCE_EXHAUSTED`. A new worker counts once it first registers. When a suspended actor's node is deleted, resume restores its local snapshot on another node from the snapshot's upload, even if atelet never reported the upload complete. Resume does this once another node has room. If atelet finds no upload, resume moves the actor to `ACTOR_STATE_CRASHED` and returns `FAILED_PRECONDITION`. `RevertActor` then returns it to its last completed external snapshot. Revert deletes an upload that was never reported complete, so a snapshot is lost if its restore fails for another reason, or if the actor is reverted before it resumes. @@ -768,9 +769,10 @@ Activates a suspended actor by restoring it onto a physical worker. Hibernate a running actor, capturing its current RAM and disk state into a snapshot. * **Request:** `SuspendActorRequest` * `actor`: `ObjectRef` of the actor to suspend. + * `preconditions`: (Optional) `uid` and `version` guards on the actor, with the same semantics as `DeleteActor`'s `options`. A mismatch returns `ABORTED`. * `options.mode`: (Optional) `DURABILITY_MODE_SYNCHRONOUS` returns once the snapshot is `COMPLETED` in object storage. `DURABILITY_MODE_ASYNCHRONOUS` returns once the snapshot is captured on the worker's node, and atelet uploads it in the background. Unset runs an asynchronous suspend. * **Response:** `SuspendActorResponse` containing the `Actor` object in `ACTOR_STATE_SUSPENDED`, with its snapshot in `status.snapshots`. -* Called on an actor that is already `ACTOR_STATE_SUSPENDED`, it returns the actor as it is, in either mode. After an asynchronous suspend, atelet uploads the snapshot in the background, so `status.snapshots` may still show a `PENDING` `durableSnapshot`. +* Called on an actor that is already `ACTOR_STATE_SUSPENDED`, it returns the actor as it is, in either mode, unless a `preconditions` guard does not match. After an asynchronous suspend, atelet uploads the snapshot in the background, so `status.snapshots` may still show a `PENDING` `durableSnapshot`. * A snapshot generation conflict returns `ABORTED` without crashing the actor. The actor can remain `ACTOR_STATE_SUSPENDING`, with its worker assignment and previous completed snapshot kept for recovery. Read the actor's latest state before retrying; repeating a stale request cannot resolve a persistent disagreement with atelet. * A successful suspend releases the actor's previous external snapshot: an actor keeps one, and only tags outlive it. To keep the snapshot a suspend just wrote, tag it with `CreateTag` while the actor is still suspended. After an asynchronous suspend, `CreateTag` first has atelet upload the snapshot if it has not already, so the call can take as long as that upload. If the upload fails, so does `CreateTag`, and the actor is left as it was. @@ -793,6 +795,7 @@ Deletion always runs before the database reference is dropped, and a failure fai Discards an actor's live or crashed execution and transitions it to `ACTOR_STATE_SUSPENDED` at its last completed external snapshot (`status.snapshots`). * **Request:** `RevertActorRequest` * `actor`: `ObjectRef` of the actor to revert. Accepted from `ACTOR_STATE_RUNNING` and `ACTOR_STATE_CRASHED` (plus `ACTOR_STATE_REVERTING` for idempotent retries), and from `ACTOR_STATE_SUSPENDED` when the actor's latest snapshot is node-local. Calling `RevertActor` on an `ACTOR_STATE_SUSPENDED` actor with no node-local snapshot returns `FAILED_PRECONDITION`. + * `preconditions`: (Optional) `uid` and `version` guards on the actor, with the same semantics as `DeleteActor`'s `options`. A mismatch returns `ABORTED`. * **Response:** `RevertActorResponse` containing the reverted `Actor` in `ACTOR_STATE_SUSPENDED`. * Reverting terminates any bound worker sandbox, clears node-local checkpoints, and garbage-collects any partial external snapshot left by an interrupted suspend while preserving the last committed durable snapshot in `status.snapshots`. * External volumes are not reverted. Their contents are never part of a snapshot, so a reverted actor comes back with its memory and root filesystem rewound but its volumes exactly as the discarded execution left them.