From 586f28a27f4d6800cd6024f93d354581bd13bc9b Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 10 Aug 2020 09:20:26 +0100 Subject: [PATCH 1/2] Add chunk flush outcome "Dropped", for short series (#2998) If the series is below a configured length it gets dropped instead of flushed. Add a separate `outcome` for this case, otherwise it is reported as "NoChunksToFlush". Signed-off-by: Bryan Boreham Co-authored-by: Marco Pracucci --- pkg/ingester/flush.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/ingester/flush.go b/pkg/ingester/flush.go index 9c619f78778..1b3d0806a2d 100644 --- a/pkg/ingester/flush.go +++ b/pkg/ingester/flush.go @@ -111,6 +111,7 @@ const ( noSeries noChunks flushError + reasonDropped maxFlushReason // Used for testing String() method. Should be last. ) @@ -138,6 +139,8 @@ func (f flushReason) String() string { return "NoChunksToFlush" case flushError: return "FlushError" + case reasonDropped: + return "Dropped" default: panic("unrecognised flushReason") } @@ -307,12 +310,17 @@ func (i *Ingester) flushUserSeries(flushQueueIndex int, userID string, fp model. "queue", flushQueueIndex, ) chunks = nil + reason = reasonDropped } } } userState.fpLocker.Unlock(fp) + if reason == reasonDropped { + return reason, nil + } + // No need to flush these chunks again. for len(chunks) > 0 && chunks[0].flushed { chunks = chunks[1:] From 27a34d87706361c501c143ab19dc58d0f8b87b24 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Mon, 10 Aug 2020 10:22:06 +0200 Subject: [PATCH 2/2] Updated CHANGELOG Signed-off-by: Marco Pracucci --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6bee44c175..2f6c4650863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ * `cortex_bucket_stores_gate_queries_concurrent_max` * `cortex_bucket_stores_gate_queries_in_flight` * `cortex_bucket_stores_gate_duration_seconds` -* [CHANGE] Metric `cortex_ingester_flush_reasons` has been renamed to `cortex_ingester_flushing_enqueued_series_total`, and new metric `cortex_ingester_flushing_dequeued_series_total` with `outcome` label (superset of reason) has been added. #2802, #2818 +* [CHANGE] Metric `cortex_ingester_flush_reasons` has been renamed to `cortex_ingester_flushing_enqueued_series_total`, and new metric `cortex_ingester_flushing_dequeued_series_total` with `outcome` label (superset of reason) has been added. #2802 #2818 #2998 * [CHANGE] Experimental Delete Series: Metric `cortex_purger_oldest_pending_delete_request_age_seconds` would track age of delete requests since they are over their cancellation period instead of their creation time. #2806 * [CHANGE] Experimental blocks storage: the store-gateway service is required in a Cortex cluster running with the experimental blocks storage. Removed the `-experimental.tsdb.store-gateway-enabled` CLI flag and `store_gateway_enabled` YAML config option. The store-gateway is now always enabled when the storage engine is `blocks`. #2822 * [CHANGE] Experimental blocks storage: removed support for `-experimental.blocks-storage.bucket-store.max-sample-count` flag because the implementation was flawed. To limit the number of samples/chunks processed by a single query you can set `-store.query-chunk-limit`, which is now supported by the blocks storage too. #2852