ring

package
v0.0.0-...-39c03fc Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg ring.Config, name, key string, reg prometheus.Registerer) (*ring.Ring, error)

New creates a new distributed consistent hash ring. It shadows the cortex ring.New method so we can use our own replication strategy for repl factor = 2

Types

type EventuallyConsistentStrategy

type EventuallyConsistentStrategy struct{}

EventuallyConsistentStrategy represents a repl strategy with a consistency of 1 on read and write. Note this is NOT strongly consistent! It is _eventually_ consistent :)

func (*EventuallyConsistentStrategy) Filter

func (s *EventuallyConsistentStrategy) Filter(ingesters []ring.InstanceDesc, op ring.Operation, replicationFactor int, heartbeatTimeout time.Duration, zoneAwarenessEnabled bool) ([]ring.InstanceDesc, int, error)

Filter decides, given the set of ingesters eligible for a key, which ingesters you will try and write to and how many failures you will tolerate. - Filters out dead ingesters so the one doesn't even try to write to them. - Checks there is enough ingesters for an operation to succeed. The ingesters argument may be overwritten.

func (*EventuallyConsistentStrategy) ShouldExtendReplicaSet

func (s *EventuallyConsistentStrategy) ShouldExtendReplicaSet(ingester ring.InstanceDesc, op ring.Operation) bool

Jump to

Keyboard shortcuts

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