shard

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlFlowFailure added in v0.15.0

type ControlFlowFailure struct {
	Info        string
	InfoDetails string
}

ControlFlowFailure indicates an error occurred which makes it impossible to even attempt to check or fix one or more execution(s). Note that it is not a ControlFlowFailure if a check or fix fails, it is only a ControlFlowFailure if an error is encountered which makes even attempting to check or fix impossible.

type FixKeys added in v0.15.0

type FixKeys struct {
	Skipped *store.Keys
	Failed  *store.Keys
	Fixed   *store.Keys
}

FixKeys are the keys to the blobs that were uploaded during fix. Keys can be nil if there were no uploads.

type FixReport added in v0.15.0

type FixReport struct {
	ShardID int
	Stats   FixStats
	Result  FixResult
}

FixReport is the report of running Fix on a single shard

type FixResult added in v0.15.0

type FixResult struct {
	ShardFixKeys       *FixKeys
	ControlFlowFailure *ControlFlowFailure
}

FixResult indicates the result of running fix on a shard. Exactly one of ControlFlowFailure or FixKeys will be non-nil.

type FixStats added in v0.15.0

type FixStats struct {
	ExecutionCount int64
	FixedCount     int64
	SkippedCount   int64
	FailedCount    int64
}

FixStats indicates the stats of executions that were handled by shard Fix.

type Fixer added in v0.15.0

type Fixer interface {
	Fix() FixReport
}

Fixer is used to fix all executions in a shard. It is responsible for three things: 1. Confirming that each execution it scans is corrupted. 2. Attempting to fix any confirmed corrupted executions. 3. Recording skipped executions, failed to fix executions and successfully fix executions to durable store. 4. Producing a FixReport

func NewFixer

func NewFixer(
	ctx context.Context,
	shardID int,
	manager invariant.Manager,
	iterator store.ScanOutputIterator,
	blobstoreClient blobstore.Client,
	blobstoreFlushThreshold int,
	progressReportFn func(),
	domainCache cache.DomainCache,
	allowDomain dynamicconfig.BoolPropertyFnWithDomainFilter,
) Fixer

NewFixer constructs a new fixer

type ScanKeys added in v0.15.0

type ScanKeys struct {
	Corrupt *store.Keys
	Failed  *store.Keys
}

ScanKeys are the keys to the blobs that were uploaded during scan. Keys can be nil if there were no uploads.

type ScanReport added in v0.15.0

type ScanReport struct {
	ShardID int
	Stats   ScanStats
	Result  ScanResult
}

ScanReport is the report of running Scan on a single shard.

type ScanResult added in v0.15.0

type ScanResult struct {
	ShardScanKeys      *ScanKeys
	ControlFlowFailure *ControlFlowFailure
}

ScanResult indicates the result of running scan on a shard. Exactly one of ControlFlowFailure or ScanKeys will be non-nil

type ScanStats added in v0.15.0

type ScanStats struct {
	ExecutionsCount             int64
	CorruptedCount              int64
	CheckFailedCount            int64
	CorruptionByType            map[invariant.Name]int64
	CorruptedOpenExecutionCount int64
}

ScanStats indicates the stats of executions which were handled by shard Scan.

type Scanner added in v0.15.0

type Scanner interface {
	Scan() ScanReport
}

Scanner is used to scan over all executions in a shard. It is responsible for three things: 1. Checking invariants for each execution. 2. Recording corruption and failures to durable store. 3. Producing a ScanReport

func NewScanner

func NewScanner(
	ctx context.Context,
	shardID int,
	iterator pagination.Iterator,
	blobstoreClient blobstore.Client,
	blobstoreFlushThreshold int,
	manager invariant.Manager,
	progressReportFn func(),
) Scanner

NewScanner constructs a new scanner

Jump to

Keyboard shortcuts

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