Documentation ¶
Index ¶
- func BackupAndDelete(ctx Context, id ulid.ULID) error
- func BackupAndDeleteDownloaded(ctx Context, bdir string, id ulid.ULID) error
- func TSDBBlockExistsInBucket(ctx context.Context, bkt objstore.Bucket, id ulid.ULID) (bool, error)
- type Context
- type DuplicatedCompactionBlocks
- type IndexKnownIssues
- type Manager
- type OverlappedBlocksIssue
- type Registry
- type Verifier
- type VerifierRepairer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupAndDelete ¶ added in v0.7.0
BackupAndDelete moves a TSDB block to a backup bucket and on success removes it from the source bucket. If deleteDelay is zero, block is removed from source bucket. else the block is marked for deletion. It returns error if block dir already exists in the backup bucket (blocks should be immutable) or if any of the operations fail.
func BackupAndDeleteDownloaded ¶ added in v0.7.0
BackupAndDeleteDownloaded works much like BackupAndDelete in that it will move a TSDB block from a bucket to a backup bucket. If deleteDelay param is zero, block is removed from source bucket. else the block is marked for deletion. The bdir parameter points to the location on disk where the TSDB block was previously downloaded allowing this function to avoid downloading the TSDB block from the source bucket again. An error is returned if any operation fails.
func TSDBBlockExistsInBucket ¶ added in v0.7.0
TSDBBlockExistsInBucket checks to see if a given TSDB block ID exists in a bucket. If so, true is returned. An error is returned on failure and in such case the boolean result has no meaning.
Types ¶
type Context ¶ added in v0.18.0
type Context struct { context.Context Logger log.Logger Bkt objstore.Bucket BackupBkt objstore.Bucket Fetcher block.MetadataFetcher DeleteDelay time.Duration // contains filtered or unexported fields }
Context is an verifier config.
type DuplicatedCompactionBlocks ¶ added in v0.17.0
type DuplicatedCompactionBlocks struct{}
DuplicatedCompactionBlocks is for bug fixed in https://github.com/thanos-io/thanos/commit/94e26c63e52ba45b713fd998638d0e7b2492664f. Bug resulted in source block not being removed immediately after compaction, so we were compacting again and again same sources until sync-delay passes. The expected print of this are same overlapped blocks with exactly the same sources, time ranges and stats. If repair is enabled, all but one duplicates are safely deleted.
func (DuplicatedCompactionBlocks) IssueID ¶ added in v0.17.0
func (DuplicatedCompactionBlocks) IssueID() string
func (DuplicatedCompactionBlocks) VerifyRepair ¶ added in v0.17.0
type IndexKnownIssues ¶ added in v0.17.0
type IndexKnownIssues struct{}
IndexKnownIssues verifies any known index issue. It rewrites the problematic blocks while fixing repairable inconsistencies. If the replacement was created successfully it is uploaded to the bucket and the input block is deleted. NOTE: This also verifies all indexes against chunks mismatches and duplicates.
func (IndexKnownIssues) IssueID ¶ added in v0.17.0
func (IndexKnownIssues) IssueID() string
func (IndexKnownIssues) VerifyRepair ¶ added in v0.17.0
type Manager ¶ added in v0.17.0
type Manager struct { Context // contains filtered or unexported fields }
Manager runs given issues to verify if bucket is healthy.
func NewManager ¶ added in v0.17.0
func NewManager(reg prometheus.Registerer, logger log.Logger, bkt, backupBkt objstore.Bucket, fetcher block.MetadataFetcher, deleteDelay time.Duration, vs Registry) *Manager
New returns verifier's manager.
func (*Manager) Verify ¶ added in v0.17.0
Verify verifies matching blocks using registered list of Verifier and VerifierRepairer. TODO(blotka): Wrap bucket with BucketWithMetrics and print metrics after each issue (e.g how many blocks where touched).
func (*Manager) VerifyAndRepair ¶ added in v0.17.0
VerifyAndRepair verifies and repairs matching blocks using registered list of VerifierRepairer. TODO(blotka): Wrap bucket with BucketWithMetrics and print metrics after each issue (e.g how many blocks where touched).
type OverlappedBlocksIssue ¶
type OverlappedBlocksIssue struct{}
OverlappedBlocksIssue checks bucket for blocks with overlapped time ranges. No repair is available for this issue.
func (OverlappedBlocksIssue) IssueID ¶ added in v0.17.0
func (OverlappedBlocksIssue) IssueID() string
type Registry ¶ added in v0.17.0
type Registry struct { Verifiers []Verifier VerifierRepairers []VerifierRepairer }