From 77f5a1d89bbfab54e0b140a03fdd92f905a3f211 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 29 May 2020 11:05:19 +0000 Subject: [PATCH] Remove -store.fullsize-chunks option It broke ingester hand-overs, and is not needed now we use BigChunk. I left in the code which allows non-full-size chunks to be read in: maybe someone has some in a database. Signed-off-by: Bryan Boreham --- CHANGELOG.md | 1 + pkg/chunk/encoding/chunk_test.go | 1 - pkg/chunk/encoding/factory.go | 6 ++---- pkg/chunk/encoding/varbit.go | 6 ++---- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1885d6b9d4c..e6ebdfa8a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ * [CHANGE] Experimental Memberlist ring: randomize gossip node names to avoid conflicts when running multiple clients on the same host, or reusing host names (eg. pods in statefulset). Node name randomization can be disabled by using `-memberlist.randomize-node-name=false`. #2715 * [CHANGE] Memberlist KV client is no longer considered experimental. #2725 * [CHANGE] Change target flag for purger from `data-purger` to `purger` and make delete request cancellation duration configurable. #2760 +* [CHANGE] Removed `-store.fullsize-chunks` option which was undocumented and unused (it broke ingester hand-overs). #2656 * [FEATURE] TLS config options added for GRPC clients in Querier (Query-frontend client & Ingester client), Ruler, Store Gateway, as well as HTTP client in Config store client. #2502 * [FEATURE] The flag `-frontend.max-cache-freshness` is now supported within the limits overrides, to specify per-tenant max cache freshness values. The corresponding YAML config parameter has been changed from `results_cache.max_freshness` to `limits_config.max_cache_freshness`. The legacy YAML config parameter (`results_cache.max_freshness`) will continue to be supported till Cortex release `v1.4.0`. #2609 * [FEATURE] Experimental gRPC Store: Added support to 3rd parties index and chunk stores using gRPC client/server plugin mechanism. #2220 diff --git a/pkg/chunk/encoding/chunk_test.go b/pkg/chunk/encoding/chunk_test.go index f0815649611..c78e06381b0 100644 --- a/pkg/chunk/encoding/chunk_test.go +++ b/pkg/chunk/encoding/chunk_test.go @@ -56,7 +56,6 @@ func TestLen(t *testing.T) { var step = int(15 * time.Second / time.Millisecond) func TestChunk(t *testing.T) { - alwaysMarshalFullsizeChunks = false for _, tc := range []struct { encoding Encoding maxSamples int diff --git a/pkg/chunk/encoding/factory.go b/pkg/chunk/encoding/factory.go index 95f2a61ccdc..e69a51a2229 100644 --- a/pkg/chunk/encoding/factory.go +++ b/pkg/chunk/encoding/factory.go @@ -15,15 +15,13 @@ type Config struct{} var ( // DefaultEncoding exported for use in unit tests elsewhere - DefaultEncoding = Bigchunk - alwaysMarshalFullsizeChunks = true - bigchunkSizeCapBytes = 0 + DefaultEncoding = Bigchunk + bigchunkSizeCapBytes = 0 ) // RegisterFlags registers configuration settings. func (Config) RegisterFlags(f *flag.FlagSet) { f.Var(&DefaultEncoding, "ingester.chunk-encoding", "Encoding version to use for chunks.") - flag.BoolVar(&alwaysMarshalFullsizeChunks, "store.fullsize-chunks", alwaysMarshalFullsizeChunks, "When saving varbit chunks, pad to 1024 bytes") flag.IntVar(&bigchunkSizeCapBytes, "store.bigchunk-size-cap-bytes", bigchunkSizeCapBytes, "When using bigchunk encoding, start a new bigchunk if over this size (0 = unlimited)") } diff --git a/pkg/chunk/encoding/varbit.go b/pkg/chunk/encoding/varbit.go index c9580214d2c..a9d1c2f2877 100644 --- a/pkg/chunk/encoding/varbit.go +++ b/pkg/chunk/encoding/varbit.go @@ -318,6 +318,7 @@ func (c varbitChunk) Utilization() float64 { } // marshalLen returns the number of bytes that should be marshalled for this chunk +// (if someone has used a version of this code that doesn't just send 1024 every time) func (c varbitChunk) marshalLen() int { bits := c.nextSampleOffset() if bits < varbitThirdSampleBitOffset { @@ -340,10 +341,7 @@ func (c varbitChunk) Len() int { } func (c varbitChunk) Size() int { - if alwaysMarshalFullsizeChunks { - return cap(c) - } - return c.marshalLen() + return cap(c) } func (c varbitChunk) firstTime() model.Time {