Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to disable extended writes #677

Merged
merged 4 commits into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## main / unreleased

* [ENHANCEMENT] Improve WAL Replay by not rebuilding the WAL. [#668](https://github.com/grafana/tempo/pull/668)
* [ENHANCEMENT] Add config option to disable write extension to the ingesters. [#677](https://github.com/grafana/tempo/pull/677)

## v0.7.0

Expand Down
1 change: 1 addition & 0 deletions docs/tempo/website/configuration/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ distributor:
instance_addr: ""
receivers: {}
override_ring_key: distributor
extend_writes: true
ingester_client:
pool_config:
checkinterval: 15s
Expand Down
5 changes: 5 additions & 0 deletions modules/distributor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ type Config struct {
Receivers map[string]interface{} `yaml:"receivers"`
OverrideRingKey string `yaml:"override_ring_key"`

// disables write extension with inactive ingesters. Use this along with ingester.lifecycler.unregister_on_shutdown = true
// note that setting these two config values reduces tolerance to failures on rollout b/c there is always one guaranteed to be failing replica
ExtendWrites bool `yaml:"extend_writes"`

// For testing.
factory func(addr string) (ring_client.PoolClient, error) `yaml:"-"`
}
Expand All @@ -45,4 +49,5 @@ func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet)
cfg.DistributorRing.HeartbeatTimeout = 5 * time.Minute

cfg.OverrideRingKey = ring.DistributorRingKey
cfg.ExtendWrites = true
}
7 changes: 6 additions & 1 deletion modules/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ func (d *Distributor) sendToIngestersViaBytes(ctx context.Context, userID string
rawRequests[i] = b
}

err := ring.DoBatch(ctx, ring.Write, d.ingestersRing, keys, func(ingester ring.InstanceDesc, indexes []int) error {
op := ring.WriteNoExtend
if d.cfg.ExtendWrites {
op = ring.Write
}

err := ring.DoBatch(ctx, op, d.ingestersRing, keys, func(ingester ring.InstanceDesc, indexes []int) error {

localCtx, cancel := context.WithTimeout(context.Background(), d.clientCfg.RemoteTimeout)
defer cancel()
Expand Down