Skip to content

Commit 8c19cfd

Browse files
pracuccibboreham
andauthored
Cherry pick PR 2998 into release 1.3 branch (#3001)
* 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 <[email protected]> Co-authored-by: Marco Pracucci <[email protected]> * Updated CHANGELOG Signed-off-by: Marco Pracucci <[email protected]> Co-authored-by: Bryan Boreham <[email protected]>
1 parent f0eda25 commit 8c19cfd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* `cortex_bucket_stores_gate_queries_concurrent_max`
1212
* `cortex_bucket_stores_gate_queries_in_flight`
1313
* `cortex_bucket_stores_gate_duration_seconds`
14-
* [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
14+
* [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
1515
* [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
1616
* [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
1717
* [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

pkg/ingester/flush.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ const (
111111
noSeries
112112
noChunks
113113
flushError
114+
reasonDropped
114115
maxFlushReason // Used for testing String() method. Should be last.
115116
)
116117

@@ -138,6 +139,8 @@ func (f flushReason) String() string {
138139
return "NoChunksToFlush"
139140
case flushError:
140141
return "FlushError"
142+
case reasonDropped:
143+
return "Dropped"
141144
default:
142145
panic("unrecognised flushReason")
143146
}
@@ -307,12 +310,17 @@ func (i *Ingester) flushUserSeries(flushQueueIndex int, userID string, fp model.
307310
"queue", flushQueueIndex,
308311
)
309312
chunks = nil
313+
reason = reasonDropped
310314
}
311315
}
312316
}
313317

314318
userState.fpLocker.Unlock(fp)
315319

320+
if reason == reasonDropped {
321+
return reason, nil
322+
}
323+
316324
// No need to flush these chunks again.
317325
for len(chunks) > 0 && chunks[0].flushed {
318326
chunks = chunks[1:]

0 commit comments

Comments
 (0)