project_purger_workflow

package
v0.0.0-...-66c7a0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeleteProjectFromGraveyardWorkflowExecutor

func NewDeleteProjectFromGraveyardWorkflowExecutor() cereal.WorkflowExecutor

NewDeleteProjectFromGraveyardWorkflowExecutor returns a workflow executor that is based on the SingleTaskWorkflowExecutor with infinite retry after exponential backoff.

func NewMoveProjectToGraveyardWorkflowExecutor

func NewMoveProjectToGraveyardWorkflowExecutor() cereal.WorkflowExecutor

NewMoveProjectToGraveyardWorkflowExecutor returns a workflow executor that will retry on ErrTaskLost but fail on any other error.

func NewProjectPurgerWorkflowExecutor

func NewProjectPurgerWorkflowExecutor() (*patterns.ChainWorkflowExecutor, error)

NewProjectPurgerWorkflowExecutor mostly follows the pattern described in project_update_manager.go but here is a detailed description:

+--------------------------------------------------------------------+ProjectPurger+----------------------------------------------------------------------------------+ | | | ProjectPurger is a wrapper around a ChainWorkflowExecutor that contains the subworkflows required to purge projects. | | | | Executor: ParallelWorkflowExecutor contains multiple | | Executor: moveProjectToGraveyardWorkflowExecutor Executors: domainProjectPurgeWorkflowExecutor Executor: deleteProjectFromGraveyardWorkflowExecutor | | for each domain (authn, tokens) in parallel. | | +---------------------------------------------+ +---------------------------------------------+ +---------------------------------------------+ | | | Contains a single task per project: | | There is a | | Contains a single task per project: | | | | moveProjectToGraveyardTaskExecutor | | domainProjectPurgeTask for each | | deleteProjectFromGraveyardTaskExecutor | | | | | | domain that needs to delete projects that | | | | | | If this task fails, the subsequent | | run in parallel under the parent | | Removes the now completely purged task from | | | | workflows will be aborted. For example, | | ParallelWorkflowExecutor. Each child | | the project graveyard. | | | | if the database 500s or 404s. The initial | | runs a single task per project purge | | | | | | API request waits for this task to complete.| | that removes the project from its domain. | | Similar to the previous workflow, it will | | | | In the case of an error, it will return | +---> | ProjectPurger workflow will wait until | +---> | retry with exponential backoff and logging. | | | | either a 404 or a 500, and abort | | every domain is done before moving onto | | | | | | subsequent workflows. Except in the case | | the last workflow. We don't expect failures | | We never expect errors here unless the | | | | of the task getting lost, which will retry | | here unless the system is unhealthy and | | system is unhealthy. | | | | the idempotent db call to move the project | | now the project is in the graveyard so we | | | | | | to the graveyard | | retry with exponential backoff and logging. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---------------------------------------------+ +---------------------------------------------+ +---------------------------------------------+ | | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Types

type ProjectPurger

type ProjectPurger interface {
	Start(string) error
	GraveyardingCompleted(string) (bool, error)
}

ProjectPurger is a wrapper around a set of cereal workflows that is used to purge a project from authz and other dependent domains in a transactional way.

func RegisterCerealProjectPurger

func RegisterCerealProjectPurger(manager *cereal.Manager, log logger.Logger, s storage.Storage) (ProjectPurger, error)

RegisterCerealProjectPurger creates a new ProjectPurger with the default domains.

func RegisterCerealProjectPurgerWithDomainServices

func RegisterCerealProjectPurgerWithDomainServices(manager *cereal.Manager, log logger.Logger, s storage.Storage, domainServices []string) (ProjectPurger, error)

RegisterCerealProjectPurgerWithDomainServices creates a new ProjectPurger with domains specified (only used for testing).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL