Documentation
¶
Overview ¶
Package api is a generated GoMock package.
Index ¶
- Variables
- func ClientSupportsTranOrSpecEvents(ctx context.Context) bool
- func CreateMutableState(shard historyi.ShardContext, namespaceEntry *namespace.Namespace, ...) (historyi.MutableState, error)
- func DeserializeHistoryToken(bytes []byte) (*tokenspb.HistoryContinuation, error)
- func DeserializeRawHistoryToken(bytes []byte) (*tokenspb.RawHistoryContinuation, error)
- func FixFollowEvents(ctx context.Context, versionChecker headers.VersionChecker, ...) error
- func GenerateFirstWorkflowTask(mutableState historyi.MutableState, ...) (int64, error)
- func GeneratePaginationToken(request *historyservice.GetWorkflowExecutionRawHistoryRequest, ...) *tokenspb.RawHistoryContinuation
- func GeneratePaginationTokenV2Request(request *historyservice.GetWorkflowExecutionRawHistoryV2Request, ...) *tokenspb.RawHistoryContinuation
- func GenerateRequestIDRefLink(namespace, workflowID, runID, requestID string, eventType enumspb.EventType) *commonpb.Link
- func GenerateStartedEventRefLink(namespace, workflowID, runID string) *commonpb.Link
- func GetActiveNamespace(shard historyi.ShardContext, namespaceUUID namespace.ID, businessID string) (*namespace.Namespace, error)
- func GetActivityScheduledEventID(activityID string, mutableState historyi.MutableState) (int64, error)
- func GetAndUpdateWorkflowWithConsistencyCheck(ctx context.Context, reqClock *clockspb.VectorClock, ...) (retError error)
- func GetAndUpdateWorkflowWithNew(ctx context.Context, reqClock *clockspb.VectorClock, ...) (retError error)
- func GetHistory(ctx context.Context, shardContext historyi.ShardContext, ...) (history *historypb.History, token []byte, retError error)
- func GetHistoryReverse(ctx context.Context, shardContext historyi.ShardContext, ...) (history *historypb.History, token []byte, lastFirstTransactionID int64, ...)
- func GetMutableState(ctx context.Context, shardContext historyi.ShardContext, ...) (_ *historyservice.GetMutableStateResponse, retError error)
- func GetMutableStateWithConsistencyCheck(ctx context.Context, shardContext historyi.ShardContext, ...) (_ *historyservice.GetMutableStateResponse, retError error)
- func GetNamespace(shard historyi.ShardContext, namespaceUUID namespace.ID) (*namespace.Namespace, error)
- func GetOrPollWorkflowMutableState(ctx context.Context, shardContext historyi.ShardContext, ...) (*historyservice.GetMutableStateResponse, error)
- func GetRawHistory(ctx context.Context, shardContext historyi.ShardContext, ...) (_ []*commonpb.DataBlob, _ []byte, retError error)
- func GetTaskCategory(categoryID int, registry tasks.TaskCategoryRegistry) (tasks.Category, error)
- func IsActivityTaskNotFoundForToken(token *tokenspb.Task, ai *persistencespb.ActivityInfo, isCompletedByID *bool) bool
- func IsHistoryEventOnCurrentBranch(mutableState historyi.MutableState, eventID int64, eventVersion int64) (bool, error)
- func IsRetryableError(err error) bool
- func MigrateWorkflowIDReusePolicyForRunningWorkflow(wfIDReusePolicy *enumspb.WorkflowIdReusePolicy, ...)
- func MutableStateToGetResponse(mutableState historyi.MutableState) (*historyservice.GetMutableStateResponse, error)
- func NewWorkflowVersionCheck(shard historyi.ShardContext, prevLastWriteVersion int64, ...) error
- func NewWorkflowWithSignal(shard historyi.ShardContext, namespaceEntry *namespace.Namespace, ...) (historyi.MutableState, error)
- func OverrideStartWorkflowExecutionRequest(request *workflowservice.StartWorkflowExecutionRequest, operation string, ...)
- func ProcessInternalRawHistory(requestContext context.Context, saProvider searchattribute.Provider, ...) error
- func ProcessOutgoingSearchAttributes(saProvider searchattribute.Provider, ...) error
- func ReactivateVersionWorkflowIfPinned(ctx context.Context, namespaceEntry *namespace.Namespace, ...)
- func ResolveWorkflowIDReusePolicy(shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, ...) error
- func SerializeHistoryToken(token *tokenspb.HistoryContinuation) ([]byte, error)
- func SerializeRawHistoryToken(token *tokenspb.RawHistoryContinuation) ([]byte, error)
- func SetActivityTaskRunID(ctx context.Context, token *tokenspb.Task, ...) error
- func TrimHistoryNode(ctx context.Context, shardContext historyi.ShardContext, ...)
- func UpdateWorkflowWithNew(shardContext historyi.ShardContext, ctx context.Context, ...) (retError error)
- func ValidateBranchTokenForExecution(ctx context.Context, shardContext historyi.ShardContext, ...) error
- func ValidateNamespaceUUID(namespaceUUID namespace.ID) error
- func ValidatePaginationToken(request *historyservice.GetWorkflowExecutionRawHistoryRequest, ...) error
- func ValidatePaginationTokenV2Request(request *historyservice.GetWorkflowExecutionRawHistoryV2Request, ...) error
- func ValidateReplicationConfig(clusterMetadata cluster.Metadata) error
- func ValidateSignal(ctx context.Context, shard historyi.ShardContext, ...) error
- func ValidateStart(ctx context.Context, shard historyi.ShardContext, ...) error
- func ValidateStartWorkflowExecutionRequest(ctx context.Context, request *workflowservice.StartWorkflowExecutionRequest, ...) error
- func ValidateTransientWorkflowTaskEvents(eventIDOffset int64, ...) error
- func VerifyHistoryIsComplete(logger log.Logger, firstEvent *historyspb.StrippedHistoryEvent, ...) error
- type CommandAttrValidator
- func (v *CommandAttrValidator) ValidateActivityCancelAttributes(attributes *commandpb.RequestCancelActivityTaskCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateActivityScheduleAttributes(namespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateCancelExternalWorkflowExecutionAttributes(namespaceID namespace.ID, workflowID string, targetNamespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateCancelWorkflowExecutionAttributes(attributes *commandpb.CancelWorkflowExecutionCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateCommandSequence(commands []*commandpb.Command) error
- func (v *CommandAttrValidator) ValidateCompleteWorkflowExecutionAttributes(attributes *commandpb.CompleteWorkflowExecutionCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateContinueAsNewWorkflowExecutionAttributes(namespaceName namespace.Name, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateFailWorkflowExecutionAttributes(attributes *commandpb.FailWorkflowExecutionCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateModifyWorkflowProperties(attributes *commandpb.ModifyWorkflowPropertiesCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateProtocolMessageAttributes(namespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateRecordMarkerAttributes(attributes *commandpb.RecordMarkerCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateSignalExternalWorkflowExecutionAttributes(namespaceID namespace.ID, workflowID string, targetNamespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateStartChildExecutionAttributes(namespaceID namespace.ID, targetNamespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateTimerCancelAttributes(attributes *commandpb.CancelTimerCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateTimerScheduleAttributes(attributes *commandpb.StartTimerCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateUpsertWorkflowSearchAttributes(namespaceName namespace.Name, ...) (enumspb.WorkflowTaskFailedCause, error)
- type CreateOrUpdateLeaseFunc
- type MockWorkflowConsistencyChecker
- func (m *MockWorkflowConsistencyChecker) EXPECT() *MockWorkflowConsistencyCheckerMockRecorder
- func (m *MockWorkflowConsistencyChecker) GetChasmLease(ctx context.Context, reqClock *clock.VectorClock, ...) (WorkflowLease, error)
- func (m *MockWorkflowConsistencyChecker) GetChasmLeaseWithConsistencyCheck(ctx context.Context, reqClock *clock.VectorClock, ...) (WorkflowLease, error)
- func (m *MockWorkflowConsistencyChecker) GetCurrentChasmRunID(ctx context.Context, namespaceID, workflowID string, ...) (string, error)
- func (m *MockWorkflowConsistencyChecker) GetCurrentWorkflowRunID(ctx context.Context, namespaceID, workflowID string, ...) (string, error)
- func (m *MockWorkflowConsistencyChecker) GetWorkflowCache() cache.Cache
- func (m *MockWorkflowConsistencyChecker) GetWorkflowLease(ctx context.Context, reqClock *clock.VectorClock, ...) (WorkflowLease, error)
- func (m *MockWorkflowConsistencyChecker) GetWorkflowLeaseWithConsistencyCheck(ctx context.Context, reqClock *clock.VectorClock, ...) (WorkflowLease, error)
- type MockWorkflowConsistencyCheckerMockRecorder
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetChasmLease(ctx, reqClock, workflowKey, archetypeID, lockPriority any) *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetChasmLeaseWithConsistencyCheck(...) *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetCurrentChasmRunID(ctx, namespaceID, workflowID, archetypeID, lockPriority any) *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetCurrentWorkflowRunID(ctx, namespaceID, workflowID, lockPriority any) *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowCache() *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLease(ctx, reqClock, workflowKey, lockPriority any) *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLeaseWithConsistencyCheck(ctx, reqClock, consistencyPredicate, workflowKey, lockPriority any) *gomock.Call
- type MutableStateConsistencyPredicate
- type UpdateWorkflowAction
- type UpdateWorkflowActionFunc
- type VersionReactivationSignalerFn
- type VersionedRunID
- type WorkflowConsistencyChecker
- type WorkflowConsistencyCheckerImpl
- func (c *WorkflowConsistencyCheckerImpl) GetChasmLease(ctx context.Context, reqClock *clockspb.VectorClock, ...) (WorkflowLease, error)
- func (c *WorkflowConsistencyCheckerImpl) GetChasmLeaseWithConsistencyCheck(ctx context.Context, reqClock *clockspb.VectorClock, ...) (WorkflowLease, error)
- func (c *WorkflowConsistencyCheckerImpl) GetCurrentChasmRunID(ctx context.Context, namespaceID string, workflowID string, ...) (runID string, retErr error)
- func (c *WorkflowConsistencyCheckerImpl) GetCurrentWorkflowRunID(ctx context.Context, namespaceID string, workflowID string, ...) (runID string, retErr error)
- func (c *WorkflowConsistencyCheckerImpl) GetWorkflowCache() wcache.Cache
- func (c *WorkflowConsistencyCheckerImpl) GetWorkflowLease(ctx context.Context, reqClock *clockspb.VectorClock, ...) (WorkflowLease, error)
- func (c *WorkflowConsistencyCheckerImpl) GetWorkflowLeaseWithConsistencyCheck(ctx context.Context, reqClock *clockspb.VectorClock, ...) (WorkflowLease, error)
- type WorkflowLease
Constants ¶
This section is empty.
Variables ¶
var ( UpdateWorkflowWithNewWorkflowTask = &UpdateWorkflowAction{ CreateWorkflowTask: true, } UpdateWorkflowWithoutWorkflowTask = &UpdateWorkflowAction{ CreateWorkflowTask: false, } UpdateWorkflowTerminate = &UpdateWorkflowAction{ CreateWorkflowTask: false, AbortUpdates: true, } )
var ErrUseCurrentExecution = errors.New("ErrUseCurrentExecution")
ErrUseCurrentExecution is a sentinel error to indicate to the caller to use the current workflow execution instead of creating a new one
Functions ¶
func ClientSupportsTranOrSpecEvents ¶
ClientSupportsTranOrSpecEvents detects if client supports transient events Default to include transient events for clients, only CLI and UI are explicitly excluded for backward compatability
func CreateMutableState ¶
func CreateMutableState( shard historyi.ShardContext, namespaceEntry *namespace.Namespace, executionTimeout *durationpb.Duration, runTimeout *durationpb.Duration, workflowID string, runID string, ) (historyi.MutableState, error)
func DeserializeHistoryToken ¶
func DeserializeHistoryToken(bytes []byte) (*tokenspb.HistoryContinuation, error)
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func DeserializeRawHistoryToken ¶
func DeserializeRawHistoryToken(bytes []byte) (*tokenspb.RawHistoryContinuation, error)
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func FixFollowEvents ¶
func GenerateFirstWorkflowTask ¶
func GenerateFirstWorkflowTask( mutableState historyi.MutableState, parentInfo *workflowspb.ParentExecutionInfo, startEvent *historypb.HistoryEvent, bypassTaskGeneration bool, ) (int64, error)
func GeneratePaginationToken ¶
func GeneratePaginationToken( request *historyservice.GetWorkflowExecutionRawHistoryRequest, versionHistories *historyspb.VersionHistories, ) *tokenspb.RawHistoryContinuation
func GeneratePaginationTokenV2Request ¶
func GeneratePaginationTokenV2Request( request *historyservice.GetWorkflowExecutionRawHistoryV2Request, versionHistories *historyspb.VersionHistories, ) *tokenspb.RawHistoryContinuation
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func GenerateRequestIDRefLink ¶
func GenerateRequestIDRefLink(namespace, workflowID, runID, requestID string, eventType enumspb.EventType) *commonpb.Link
GenerateRequestIDRefLink builds a Link with a RequestIdReference. Use this for events that are buffered at signal time (e.g. SIGNALED), where the concrete EventId is not yet known. The server resolves the RequestId to a real EventId once the buffer flushes.
func GenerateStartedEventRefLink ¶
GenerateStartedEventRefLink builds a Link pointing to the WORKFLOW_EXECUTION_STARTED event. Use this for backlinks to workflow start: the started event is always EventId=1 (FirstEventID) and is never buffered, so a concrete EventReference is appropriate.
func GetActiveNamespace ¶
func GetActivityScheduledEventID ¶
func GetActivityScheduledEventID( activityID string, mutableState historyi.MutableState, ) (int64, error)
func GetAndUpdateWorkflowWithConsistencyCheck ¶
func GetAndUpdateWorkflowWithConsistencyCheck( ctx context.Context, reqClock *clockspb.VectorClock, consistencyCheckFn MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, action UpdateWorkflowActionFunc, newWorkflowFn func() (historyi.WorkflowContext, historyi.MutableState, error), shardContext historyi.ShardContext, workflowConsistencyChecker WorkflowConsistencyChecker, ) (retError error)
func GetAndUpdateWorkflowWithNew ¶
func GetAndUpdateWorkflowWithNew( ctx context.Context, reqClock *clockspb.VectorClock, workflowKey definition.WorkflowKey, action UpdateWorkflowActionFunc, newWorkflowFn func() (historyi.WorkflowContext, historyi.MutableState, error), shard historyi.ShardContext, workflowConsistencyChecker WorkflowConsistencyChecker, ) (retError error)
func GetHistory ¶
func GetHistory( ctx context.Context, shardContext historyi.ShardContext, namespaceName namespace.Name, namespaceID namespace.ID, execution *commonpb.WorkflowExecution, firstEventID int64, nextEventID int64, pageSize int32, nextPageToken []byte, transientWorkflowTaskInfo *historyspb.TransientWorkflowTaskInfo, branchToken []byte, persistenceVisibilityMgr manager.VisibilityManager, ) (history *historypb.History, token []byte, retError error)
func GetHistoryReverse ¶
func GetHistoryReverse( ctx context.Context, shardContext historyi.ShardContext, namespaceID namespace.ID, execution *commonpb.WorkflowExecution, nextEventID int64, lastFirstTxnID int64, pageSize int32, nextPageToken []byte, branchToken []byte, persistenceVisibilityMgr manager.VisibilityManager, ) (history *historypb.History, token []byte, lastFirstTransactionID int64, retError error)
func GetMutableState ¶
func GetMutableState( ctx context.Context, shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, workflowConsistencyChecker WorkflowConsistencyChecker, ) (_ *historyservice.GetMutableStateResponse, retError error)
func GetMutableStateWithConsistencyCheck ¶
func GetMutableStateWithConsistencyCheck( ctx context.Context, shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, currentVersion int64, currentEventID int64, versionedTransition *persistencespb.VersionedTransition, workflowConsistencyChecker WorkflowConsistencyChecker, ) (_ *historyservice.GetMutableStateResponse, retError error)
func GetNamespace ¶
func GetOrPollWorkflowMutableState ¶
func GetOrPollWorkflowMutableState( ctx context.Context, shardContext historyi.ShardContext, request *historyservice.GetMutableStateRequest, workflowConsistencyChecker WorkflowConsistencyChecker, eventNotifier events.Notifier, ) (*historyservice.GetMutableStateResponse, error)
func GetRawHistory ¶
func GetRawHistory( ctx context.Context, shardContext historyi.ShardContext, namespaceName namespace.Name, namespaceID namespace.ID, execution *commonpb.WorkflowExecution, firstEventID int64, nextEventID int64, pageSize int32, token []byte, transientWorkflowTaskInfo *historyspb.TransientWorkflowTaskInfo, branchToken []byte, ) (_ []*commonpb.DataBlob, _ []byte, retError error)
func GetTaskCategory ¶
func IsActivityTaskNotFoundForToken ¶
func IsActivityTaskNotFoundForToken( token *tokenspb.Task, ai *persistencespb.ActivityInfo, isCompletedByID *bool, ) bool
func IsRetryableError ¶
func MigrateWorkflowIDReusePolicyForRunningWorkflow ¶
func MigrateWorkflowIDReusePolicyForRunningWorkflow( wfIDReusePolicy *enumspb.WorkflowIdReusePolicy, wfIDConflictPolicy *enumspb.WorkflowIdConflictPolicy, )
func MutableStateToGetResponse ¶
func MutableStateToGetResponse( mutableState historyi.MutableState, ) (*historyservice.GetMutableStateResponse, error)
func NewWorkflowVersionCheck ¶
func NewWorkflowVersionCheck( shard historyi.ShardContext, prevLastWriteVersion int64, newMutableState historyi.MutableState, ) error
func NewWorkflowWithSignal ¶
func NewWorkflowWithSignal( shard historyi.ShardContext, namespaceEntry *namespace.Namespace, workflowID string, runID string, startRequest *historyservice.StartWorkflowExecutionRequest, signalWithStartRequest *workflowservice.SignalWithStartWorkflowExecutionRequest, ) (historyi.MutableState, error)
func OverrideStartWorkflowExecutionRequest ¶
func OverrideStartWorkflowExecutionRequest( request *workflowservice.StartWorkflowExecutionRequest, operation string, shard historyi.ShardContext, metricsHandler metrics.Handler, )
func ProcessInternalRawHistory ¶
func ProcessInternalRawHistory( requestContext context.Context, saProvider searchattribute.Provider, saMapperProvider searchattribute.MapperProvider, response *historyservice.GetWorkflowExecutionHistoryResponse, visibilityManager manager.VisibilityManager, versionChecker headers.VersionChecker, ns namespace.Name, isCloseEventOnly bool, ) error
ProcessInternalRawHistory processes history in the field response.History. History service can send history events in response.History.Events. In that case, process the events and move them to response.Response.History. Usually this is done by history service but when history.sendRawHistoryBetweenInternalServices is enabled, history service sends raw history events to frontend without any processing.
func ProcessOutgoingSearchAttributes ¶
func ProcessOutgoingSearchAttributes( saProvider searchattribute.Provider, saMapperProvider searchattribute.MapperProvider, events []*historypb.HistoryEvent, ns namespace.Name, persistenceVisibilityMgr manager.VisibilityManager, ) error
func ReactivateVersionWorkflowIfPinned ¶
func ReactivateVersionWorkflowIfPinned( ctx context.Context, namespaceEntry *namespace.Namespace, override *workflowpb.VersioningOverride, signaler VersionReactivationSignalerFn, enabled bool, shouldSkipReactivation bool, revisionNumber int64, )
ReactivateVersionWorkflowIfPinned sends a reactivation signal to the version workflow when workflow execution options target a potentially DRAINED/INACTIVE version (for example, by specifying a Pinned or OneTime override via update options). This is a fire-and-forget operation - the signal is sent asynchronously and errors are logged by the signaler implementation. The signaler itself is responsible for per-pod dedup by revision number; cross-pod duplicates fold at the receiver via a deterministic UUID RequestId.
func ResolveWorkflowIDReusePolicy ¶
func ResolveWorkflowIDReusePolicy( shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, namespaceEntry *namespace.Namespace, currentStatus enumspb.WorkflowExecutionStatus, currentRequestIDs map[string]*persistencespb.RequestIDInfo, currentFirstExecutionRunID string, wfIDReusePolicy enumspb.WorkflowIdReusePolicy, currentWorkflowStartTime time.Time, ) error
func SerializeHistoryToken ¶
func SerializeHistoryToken(token *tokenspb.HistoryContinuation) ([]byte, error)
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func SerializeRawHistoryToken ¶
func SerializeRawHistoryToken(token *tokenspb.RawHistoryContinuation) ([]byte, error)
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func SetActivityTaskRunID ¶
func TrimHistoryNode ¶
func TrimHistoryNode( ctx context.Context, shardContext historyi.ShardContext, workflowConsistencyChecker WorkflowConsistencyChecker, eventNotifier events.Notifier, namespaceID string, workflowID string, runID string, )
func UpdateWorkflowWithNew ¶
func UpdateWorkflowWithNew( shardContext historyi.ShardContext, ctx context.Context, workflowLease WorkflowLease, action UpdateWorkflowActionFunc, newWorkflowFn func() (historyi.WorkflowContext, historyi.MutableState, error), ) (retError error)
func ValidateBranchTokenForExecution ¶
func ValidateBranchTokenForExecution( ctx context.Context, shardContext historyi.ShardContext, workflowConsistencyChecker WorkflowConsistencyChecker, eventNotifier events.Notifier, namespaceName namespace.Name, namespaceID namespace.ID, execution *commonpb.WorkflowExecution, requestBranchToken []byte, ) error
ValidateBranchTokenForExecution rejects a paging branch token that is not the execution's current one.
func ValidateNamespaceUUID ¶
func ValidatePaginationToken ¶
func ValidatePaginationToken( request *historyservice.GetWorkflowExecutionRawHistoryRequest, token *tokenspb.RawHistoryContinuation, ) error
func ValidatePaginationTokenV2Request ¶
func ValidatePaginationTokenV2Request( request *historyservice.GetWorkflowExecutionRawHistoryV2Request, token *tokenspb.RawHistoryContinuation, ) error
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func ValidateSignal ¶
func ValidateSignal( ctx context.Context, shard historyi.ShardContext, mutableState historyi.MutableState, signalPayloadSize int, signalHeaderSize int, operation string, ) error
func ValidateStart ¶
func ValidateStartWorkflowExecutionRequest ¶
func ValidateStartWorkflowExecutionRequest( ctx context.Context, request *workflowservice.StartWorkflowExecutionRequest, shard historyi.ShardContext, namespaceEntry *namespace.Namespace, operation string, ) error
func ValidateTransientWorkflowTaskEvents ¶
func ValidateTransientWorkflowTaskEvents( eventIDOffset int64, transientWorkflowTaskInfo *historyspb.TransientWorkflowTaskInfo, ) error
ValidateTransientWorkflowTaskEvents validates that transient workflow task events have sequential event IDs starting from the given offset. Returns an error if any event ID doesn't match the expected sequence.
func VerifyHistoryIsComplete ¶
func VerifyHistoryIsComplete( logger log.Logger, firstEvent *historyspb.StrippedHistoryEvent, lastEvent *historyspb.StrippedHistoryEvent, eventCount int, expectedFirstEventID int64, expectedLastEventID int64, isFirstPage bool, isLastPage bool, pageSize int, ) error
Types ¶
type CommandAttrValidator ¶
type CommandAttrValidator struct {
// contains filtered or unexported fields
}
func NewCommandAttrValidator ¶
func NewCommandAttrValidator( namespaceRegistry namespace.Registry, config *configs.Config, searchAttributesValidator *searchattribute.Validator, ) *CommandAttrValidator
func (*CommandAttrValidator) ValidateActivityCancelAttributes ¶
func (v *CommandAttrValidator) ValidateActivityCancelAttributes( attributes *commandpb.RequestCancelActivityTaskCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateActivityScheduleAttributes ¶
func (v *CommandAttrValidator) ValidateActivityScheduleAttributes( namespaceID namespace.ID, attributes *commandpb.ScheduleActivityTaskCommandAttributes, runTimeout *durationpb.Duration, workflowTaskQueue string, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateCancelExternalWorkflowExecutionAttributes ¶
func (v *CommandAttrValidator) ValidateCancelExternalWorkflowExecutionAttributes( namespaceID namespace.ID, workflowID string, targetNamespaceID namespace.ID, initiatedChildExecutionsInSession map[string]struct{}, attributes *commandpb.RequestCancelExternalWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateCancelWorkflowExecutionAttributes ¶
func (v *CommandAttrValidator) ValidateCancelWorkflowExecutionAttributes( attributes *commandpb.CancelWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateCommandSequence ¶
func (v *CommandAttrValidator) ValidateCommandSequence( commands []*commandpb.Command, ) error
func (*CommandAttrValidator) ValidateCompleteWorkflowExecutionAttributes ¶
func (v *CommandAttrValidator) ValidateCompleteWorkflowExecutionAttributes( attributes *commandpb.CompleteWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateContinueAsNewWorkflowExecutionAttributes ¶
func (v *CommandAttrValidator) ValidateContinueAsNewWorkflowExecutionAttributes( namespaceName namespace.Name, attributes *commandpb.ContinueAsNewWorkflowExecutionCommandAttributes, executionInfo *persistencespb.WorkflowExecutionInfo, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateFailWorkflowExecutionAttributes ¶
func (v *CommandAttrValidator) ValidateFailWorkflowExecutionAttributes( attributes *commandpb.FailWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateModifyWorkflowProperties ¶
func (v *CommandAttrValidator) ValidateModifyWorkflowProperties( attributes *commandpb.ModifyWorkflowPropertiesCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateProtocolMessageAttributes ¶
func (v *CommandAttrValidator) ValidateProtocolMessageAttributes( namespaceID namespace.ID, attributes *commandpb.ProtocolMessageCommandAttributes, runTimeout *durationpb.Duration, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateRecordMarkerAttributes ¶
func (v *CommandAttrValidator) ValidateRecordMarkerAttributes( attributes *commandpb.RecordMarkerCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateSignalExternalWorkflowExecutionAttributes ¶
func (v *CommandAttrValidator) ValidateSignalExternalWorkflowExecutionAttributes( namespaceID namespace.ID, workflowID string, targetNamespaceID namespace.ID, attributes *commandpb.SignalExternalWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateStartChildExecutionAttributes ¶
func (v *CommandAttrValidator) ValidateStartChildExecutionAttributes( namespaceID namespace.ID, targetNamespaceID namespace.ID, targetNamespace namespace.Name, attributes *commandpb.StartChildWorkflowExecutionCommandAttributes, parentInfo *persistencespb.WorkflowExecutionInfo, defaultWorkflowTaskTimeoutFn dynamicconfig.DurationPropertyFnWithNamespaceFilter, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateTimerCancelAttributes ¶
func (v *CommandAttrValidator) ValidateTimerCancelAttributes( attributes *commandpb.CancelTimerCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateTimerScheduleAttributes ¶
func (v *CommandAttrValidator) ValidateTimerScheduleAttributes( attributes *commandpb.StartTimerCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateUpsertWorkflowSearchAttributes ¶
func (v *CommandAttrValidator) ValidateUpsertWorkflowSearchAttributes( namespaceName namespace.Name, attributes *commandpb.UpsertWorkflowSearchAttributesCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
type CreateOrUpdateLeaseFunc ¶
type CreateOrUpdateLeaseFunc func( WorkflowLease, historyi.ShardContext, historyi.MutableState, ) (WorkflowLease, error)
type MockWorkflowConsistencyChecker ¶
type MockWorkflowConsistencyChecker struct {
// contains filtered or unexported fields
}
MockWorkflowConsistencyChecker is a mock of WorkflowConsistencyChecker interface.
func NewMockWorkflowConsistencyChecker ¶
func NewMockWorkflowConsistencyChecker(ctrl *gomock.Controller) *MockWorkflowConsistencyChecker
NewMockWorkflowConsistencyChecker creates a new mock instance.
func (*MockWorkflowConsistencyChecker) EXPECT ¶
func (m *MockWorkflowConsistencyChecker) EXPECT() *MockWorkflowConsistencyCheckerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockWorkflowConsistencyChecker) GetChasmLease ¶
func (m *MockWorkflowConsistencyChecker) GetChasmLease(ctx context.Context, reqClock *clock.VectorClock, workflowKey definition.WorkflowKey, archetypeID chasm.ArchetypeID, lockPriority locks.Priority) (WorkflowLease, error)
GetChasmLease mocks base method.
func (*MockWorkflowConsistencyChecker) GetChasmLeaseWithConsistencyCheck ¶
func (m *MockWorkflowConsistencyChecker) GetChasmLeaseWithConsistencyCheck(ctx context.Context, reqClock *clock.VectorClock, consistencyPredicate MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, archetypeID chasm.ArchetypeID, lockPriority locks.Priority) (WorkflowLease, error)
GetChasmLeaseWithConsistencyCheck mocks base method.
func (*MockWorkflowConsistencyChecker) GetCurrentChasmRunID ¶
func (m *MockWorkflowConsistencyChecker) GetCurrentChasmRunID(ctx context.Context, namespaceID, workflowID string, archetypeID chasm.ArchetypeID, lockPriority locks.Priority) (string, error)
GetCurrentChasmRunID mocks base method.
func (*MockWorkflowConsistencyChecker) GetCurrentWorkflowRunID ¶
func (m *MockWorkflowConsistencyChecker) GetCurrentWorkflowRunID(ctx context.Context, namespaceID, workflowID string, lockPriority locks.Priority) (string, error)
GetCurrentWorkflowRunID mocks base method.
func (*MockWorkflowConsistencyChecker) GetWorkflowCache ¶
func (m *MockWorkflowConsistencyChecker) GetWorkflowCache() cache.Cache
GetWorkflowCache mocks base method.
func (*MockWorkflowConsistencyChecker) GetWorkflowLease ¶
func (m *MockWorkflowConsistencyChecker) GetWorkflowLease(ctx context.Context, reqClock *clock.VectorClock, workflowKey definition.WorkflowKey, lockPriority locks.Priority) (WorkflowLease, error)
GetWorkflowLease mocks base method.
func (*MockWorkflowConsistencyChecker) GetWorkflowLeaseWithConsistencyCheck ¶
func (m *MockWorkflowConsistencyChecker) GetWorkflowLeaseWithConsistencyCheck(ctx context.Context, reqClock *clock.VectorClock, consistencyPredicate MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, lockPriority locks.Priority) (WorkflowLease, error)
GetWorkflowLeaseWithConsistencyCheck mocks base method.
type MockWorkflowConsistencyCheckerMockRecorder ¶
type MockWorkflowConsistencyCheckerMockRecorder struct {
// contains filtered or unexported fields
}
MockWorkflowConsistencyCheckerMockRecorder is the mock recorder for MockWorkflowConsistencyChecker.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetChasmLease ¶
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetChasmLease(ctx, reqClock, workflowKey, archetypeID, lockPriority any) *gomock.Call
GetChasmLease indicates an expected call of GetChasmLease.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetChasmLeaseWithConsistencyCheck ¶
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetChasmLeaseWithConsistencyCheck(ctx, reqClock, consistencyPredicate, workflowKey, archetypeID, lockPriority any) *gomock.Call
GetChasmLeaseWithConsistencyCheck indicates an expected call of GetChasmLeaseWithConsistencyCheck.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetCurrentChasmRunID ¶
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetCurrentChasmRunID(ctx, namespaceID, workflowID, archetypeID, lockPriority any) *gomock.Call
GetCurrentChasmRunID indicates an expected call of GetCurrentChasmRunID.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetCurrentWorkflowRunID ¶
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetCurrentWorkflowRunID(ctx, namespaceID, workflowID, lockPriority any) *gomock.Call
GetCurrentWorkflowRunID indicates an expected call of GetCurrentWorkflowRunID.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowCache ¶
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowCache() *gomock.Call
GetWorkflowCache indicates an expected call of GetWorkflowCache.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLease ¶
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLease(ctx, reqClock, workflowKey, lockPriority any) *gomock.Call
GetWorkflowLease indicates an expected call of GetWorkflowLease.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLeaseWithConsistencyCheck ¶
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLeaseWithConsistencyCheck(ctx, reqClock, consistencyPredicate, workflowKey, lockPriority any) *gomock.Call
GetWorkflowLeaseWithConsistencyCheck indicates an expected call of GetWorkflowLeaseWithConsistencyCheck.
type MutableStateConsistencyPredicate ¶
type MutableStateConsistencyPredicate func(mutableState historyi.MutableState) bool
type UpdateWorkflowAction ¶
type UpdateWorkflowActionFunc ¶
type UpdateWorkflowActionFunc func(WorkflowLease) (*UpdateWorkflowAction, error)
func ResolveDuplicateWorkflowID ¶
func ResolveDuplicateWorkflowID( shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, namespaceEntry *namespace.Namespace, newRunID string, currentState enumsspb.WorkflowExecutionState, currentStatus enumspb.WorkflowExecutionStatus, currentRequestIDs map[string]*persistencespb.RequestIDInfo, currentFirstExecutionRunID string, wfIDReusePolicy enumspb.WorkflowIdReusePolicy, wfIDConflictPolicy enumspb.WorkflowIdConflictPolicy, currentWorkflowStartTime time.Time, parentExecutionInfo *workflowspb.ParentExecutionInfo, childWorkflowOnly bool, ) (UpdateWorkflowActionFunc, error)
ResolveDuplicateWorkflowID determines how to resolve a workflow ID duplication upon workflow start according to the WorkflowIdReusePolicy (for *completed* workflow) or WorkflowIdConflictPolicy (for *running* workflow).
NOTE: this function assumes the workflow id reuse policy Terminate-if-Running has been migrated to the workflow id conflict policy Terminate-Existing before it is invoked.
An action (ie "mitigate and allow"), an error (ie "deny") or neither (ie "allow") is returned.
func ResolveWorkflowIDConflictPolicy ¶
func ResolveWorkflowIDConflictPolicy( shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, namespaceEntry *namespace.Namespace, newRunID string, currentRequestIDs map[string]*persistencespb.RequestIDInfo, currentFirstExecutionRunID string, wfIDConflictPolicy enumspb.WorkflowIdConflictPolicy, currentWorkflowStartTime time.Time, parentExecutionInfo *workflowspb.ParentExecutionInfo, childWorkflowOnly bool, ) (UpdateWorkflowActionFunc, error)
type VersionReactivationSignalerFn ¶
type VersionReactivationSignalerFn func( ctx context.Context, namespaceEntry *namespace.Namespace, deploymentName, buildID string, revisionNumber int64, ) error
VersionReactivationSignalerFn is a function type for sending reactivation signals to version workflows. This abstraction allows the history API layer to use the deployment client without importing it directly, avoiding import cycles between history/api and worker/workerdeployment packages. revisionNumber is the version's current revision per matching's view and is used by the signaler to compose a cluster-wide-deterministic RequestId on the signal for receiver-side dedup.
type VersionedRunID ¶
type WorkflowConsistencyChecker ¶
type WorkflowConsistencyChecker interface {
GetWorkflowCache() wcache.Cache
GetCurrentWorkflowRunID(
ctx context.Context,
namespaceID string,
workflowID string,
lockPriority locks.Priority,
) (string, error)
GetWorkflowLease(
ctx context.Context,
reqClock *clockspb.VectorClock,
workflowKey definition.WorkflowKey,
lockPriority locks.Priority,
) (WorkflowLease, error)
GetWorkflowLeaseWithConsistencyCheck(
ctx context.Context,
reqClock *clockspb.VectorClock,
consistencyPredicate MutableStateConsistencyPredicate,
workflowKey definition.WorkflowKey,
lockPriority locks.Priority,
) (WorkflowLease, error)
GetCurrentChasmRunID(
ctx context.Context,
namespaceID string,
workflowID string,
archetypeID chasm.ArchetypeID,
lockPriority locks.Priority,
) (string, error)
GetChasmLease(
ctx context.Context,
reqClock *clockspb.VectorClock,
workflowKey definition.WorkflowKey,
archetypeID chasm.ArchetypeID,
lockPriority locks.Priority,
) (WorkflowLease, error)
GetChasmLeaseWithConsistencyCheck(
ctx context.Context,
reqClock *clockspb.VectorClock,
consistencyPredicate MutableStateConsistencyPredicate,
workflowKey definition.WorkflowKey,
archetypeID chasm.ArchetypeID,
lockPriority locks.Priority,
) (WorkflowLease, error)
}
type WorkflowConsistencyCheckerImpl ¶
type WorkflowConsistencyCheckerImpl struct {
// contains filtered or unexported fields
}
func NewWorkflowConsistencyChecker ¶
func NewWorkflowConsistencyChecker( shardContext historyi.ShardContext, workflowCache wcache.Cache, ) *WorkflowConsistencyCheckerImpl
func (*WorkflowConsistencyCheckerImpl) GetChasmLease ¶
func (c *WorkflowConsistencyCheckerImpl) GetChasmLease( ctx context.Context, reqClock *clockspb.VectorClock, workflowKey definition.WorkflowKey, archetypeID chasm.ArchetypeID, lockPriority locks.Priority, ) (WorkflowLease, error)
func (*WorkflowConsistencyCheckerImpl) GetChasmLeaseWithConsistencyCheck ¶
func (c *WorkflowConsistencyCheckerImpl) GetChasmLeaseWithConsistencyCheck( ctx context.Context, reqClock *clockspb.VectorClock, consistencyPredicate MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, archetypeID chasm.ArchetypeID, lockPriority locks.Priority, ) (WorkflowLease, error)
func (*WorkflowConsistencyCheckerImpl) GetCurrentChasmRunID ¶
func (*WorkflowConsistencyCheckerImpl) GetCurrentWorkflowRunID ¶
func (*WorkflowConsistencyCheckerImpl) GetWorkflowCache ¶
func (c *WorkflowConsistencyCheckerImpl) GetWorkflowCache() wcache.Cache
func (*WorkflowConsistencyCheckerImpl) GetWorkflowLease ¶
func (c *WorkflowConsistencyCheckerImpl) GetWorkflowLease( ctx context.Context, reqClock *clockspb.VectorClock, workflowKey definition.WorkflowKey, lockPriority locks.Priority, ) (WorkflowLease, error)
func (*WorkflowConsistencyCheckerImpl) GetWorkflowLeaseWithConsistencyCheck ¶
func (c *WorkflowConsistencyCheckerImpl) GetWorkflowLeaseWithConsistencyCheck( ctx context.Context, reqClock *clockspb.VectorClock, consistencyPredicate MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, lockPriority locks.Priority, ) (WorkflowLease, error)
The code below should be used when custom workflow state validation is required. If consistencyPredicate failed (thus detecting a stale workflow state) workflow state will be cleared, and mutable state will be reloaded.
type WorkflowLease ¶
type WorkflowLease interface {
GetContext() historyi.WorkflowContext
GetMutableState() historyi.MutableState
GetReleaseFn() historyi.ReleaseWorkflowContextFunc
}
func NewWorkflowLease ¶
func NewWorkflowLease( wfContext historyi.WorkflowContext, releaseFn historyi.ReleaseWorkflowContextFunc, mutableState historyi.MutableState, ) WorkflowLease
func NewWorkflowLeaseAndContext ¶
func NewWorkflowLeaseAndContext( existingLease WorkflowLease, shardCtx historyi.ShardContext, ms historyi.MutableState, ) (WorkflowLease, error)
NOTE: must implement CreateOrUpdateLeaseFunc.
Source Files
¶
- activity_util.go
- command_attr_validator.go
- consistency_checker.go
- consistency_checker_mock.go
- create_workflow_util.go
- get_history_util.go
- get_workflow_util.go
- link_util.go
- namespace.go
- replication_util.go
- retry_util.go
- signal_workflow_util.go
- task_category.go
- token.go
- trim_history_util.go
- update_workflow_util.go
- worker_versioning_util.go
- workflow_id_dedup.go
- workflow_lease.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package getdlqtasks contains the logic to implement the historyservice.HistoryServiceServer.GetDLQTasks API.
|
Package getdlqtasks contains the logic to implement the historyservice.HistoryServiceServer.GetDLQTasks API. |