Skip to content

Commit ee6da7a

Browse files
alexqylealanprotdsabsayDaniel Sabsaydependabot[bot]
committed
Create guide doc for partition compaction (cortexproject#6512)
* Purge expired postings cache items due inactivity (cortexproject#6502) * Purge expired postings cache items due inactivity Signed-off-by: alanprot <[email protected]> * Fix comments Signed-off-by: alanprot <[email protected]> --------- Signed-off-by: alanprot <[email protected]> Signed-off-by: Alex Le <[email protected]> * Update thanos to 4ba0ba403896 (cortexproject#6503) * Update thanos to 4ba0ba403896 Signed-off-by: Daniel Sabsay <[email protected]> * run go mod vendor Signed-off-by: Daniel Sabsay <[email protected]> --------- Signed-off-by: Daniel Sabsay <[email protected]> Co-authored-by: Daniel Sabsay <[email protected]> Signed-off-by: Alex Le <[email protected]> * Bump the actions-dependencies group across 1 directory with 2 updates (cortexproject#6505) Bumps the actions-dependencies group with 2 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [github/codeql-action](https://github.com/github/codeql-action). Updates `actions/upload-artifact` from 4.5.0 to 4.6.0 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@6f51ac0...65c4c4a) Updates `github/codeql-action` from 3.28.0 to 3.28.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@48ab28a...b6a472f) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-dependencies - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Alex Le <[email protected]> * calculate # of concurrency only once at the runner (cortexproject#6506) Signed-off-by: SungJin1212 <[email protected]> Signed-off-by: Alex Le <[email protected]> * Implement partition compaction planner (cortexproject#6469) * Implement partition compaction grouper Signed-off-by: Alex Le <[email protected]> * fix comment Signed-off-by: Alex Le <[email protected]> * replace level 1 compaction limits with ingestion replication factor Signed-off-by: Alex Le <[email protected]> * fix doc Signed-off-by: Alex Le <[email protected]> * update compaction_visit_marker_timeout default value Signed-off-by: Alex Le <[email protected]> * update default value for compactor_partition_index_size_limit_in_bytes Signed-off-by: Alex Le <[email protected]> * refactor code Signed-off-by: Alex Le <[email protected]> * address comments and refactor Signed-off-by: Alex Le <[email protected]> * address comment Signed-off-by: Alex Le <[email protected]> * address comment Signed-off-by: Alex Le <[email protected]> * update config name Signed-off-by: Alex Le <[email protected]> * Implement partition compaction planner Signed-off-by: Alex Le <[email protected]> * fix after rebase Signed-off-by: Alex Le <[email protected]> * addressed comments Signed-off-by: Alex Le <[email protected]> * updated doc and refactored metric Signed-off-by: Alex Le <[email protected]> * fix test Signed-off-by: Alex Le <[email protected]> --------- Signed-off-by: Alex Le <[email protected]> * Add max tenant config to tenant federation (cortexproject#6493) Signed-off-by: SungJin1212 <[email protected]> Signed-off-by: Alex Le <[email protected]> * Add cleaner logic to clean partition compaction blocks and related files (cortexproject#6507) * Add cleaner logic to clean partition compaction blocks and related files Signed-off-by: Alex Le <[email protected]> * refactored metrics Signed-off-by: Alex Le <[email protected]> * refactor Signed-off-by: Alex Le <[email protected]> * update logs Signed-off-by: Alex Le <[email protected]> --------- Signed-off-by: Alex Le <[email protected]> * Update RELEASE.md (cortexproject#6511) Maintainers would like an additional week to get the partition compactor changes in before the first release candidate for 1.19. Signed-off-by: Charlie Le <[email protected]> Signed-off-by: Alex Le <[email protected]> * update thanos version to 236777732278c64ca01c1c09d726f0f712c87164 (cortexproject#6514) Signed-off-by: yeya24 <[email protected]> Signed-off-by: Alex Le <[email protected]> * Fix race that can cause nil reference when using expanded postings (cortexproject#6518) Signed-off-by: alanprot <[email protected]> Signed-off-by: Alex Le <[email protected]> * Add more op label values to cortex_query_frontend_queries_total metric (cortexproject#6519) Signed-off-by: Alex Le <[email protected]> * Allow use of non-dualstack endpoints for S3 blocks storage (cortexproject#6522) Signed-off-by: Alex Le <[email protected]> * Expose grpc client connect timeout config and default to 5s (cortexproject#6523) * expose grpc client connect timeout config Signed-off-by: yeya24 <[email protected]> * changelog Signed-off-by: yeya24 <[email protected]> --------- Signed-off-by: yeya24 <[email protected]> Signed-off-by: Alex Le <[email protected]> * Hook up partition compaction end to end implementation (cortexproject#6510) * Implemented partition compaction end to end with custom compaction lifecycle Signed-off-by: Alex Le <[email protected]> * removed unused variable Signed-off-by: Alex Le <[email protected]> * tweak test Signed-off-by: Alex Le <[email protected]> * tweak test Signed-off-by: Alex Le <[email protected]> * refactor according to comments Signed-off-by: Alex Le <[email protected]> * tweak test Signed-off-by: Alex Le <[email protected]> * check context error inside sharded posting Signed-off-by: Alex Le <[email protected]> * fix lint Signed-off-by: Alex Le <[email protected]> * fix integration test for memberlist Signed-off-by: Alex Le <[email protected]> * make compactor initial wait cancellable Signed-off-by: Alex Le <[email protected]> --------- Signed-off-by: Alex Le <[email protected]> * Test for nil on expire expanded postings (cortexproject#6521) * Test for nil on expire expanded postings Signed-off-by: alanprot <[email protected]> * stopping ingester Signed-off-by: alanprot <[email protected]> * refactor the test to not timeout Signed-off-by: alanprot <[email protected]> --------- Signed-off-by: alanprot <[email protected]> Signed-off-by: Alex Le <[email protected]> * log when a request starts running in querier (cortexproject#6525) * log when a request starts running in querier Signed-off-by: Ahmed Hassan <[email protected]> * log when a request starts running in querier for frontend processor Signed-off-by: Ahmed Hassan <[email protected]> --------- Signed-off-by: Ahmed Hassan <[email protected]> Signed-off-by: Alex Le <[email protected]> * Update build image according to cortexproject@03a8f8c (cortexproject#6508) Signed-off-by: Friedrich Gonzalez <[email protected]> Signed-off-by: Alex Le <[email protected]> * Deprecate -blocks-storage.tsdb.wal-compression-enabled flag Signed-off-by: SungJin1212 <[email protected]> Signed-off-by: Alex Le <[email protected]> * Fix test (cortexproject#6537) Signed-off-by: Daniel Deluiggi <[email protected]> Signed-off-by: Alex Le <[email protected]> * Mark 1.19 release in progress https://github.com/cortexproject/cortex/blob/master/RELEASE.md#show-that-a-release-is-in-progress Signed-off-by: Charlie Le <[email protected]> Signed-off-by: Alex Le <[email protected]> * Prepare 1.19.0-rc.0 Signed-off-by: Charlie Le <[email protected]> Signed-off-by: Alex Le <[email protected]> * Revert "Prepare 1.19.0-rc.0" Signed-off-by: Alex Le <[email protected]> * Fixed blocksGroupWithPartition unable to reuse functions from blocksGroup (cortexproject#6547) * Fixed blocksGroupWithPartition unable to reuse functions from blocksGroup Signed-off-by: Alex Le <[email protected]> * update tests Signed-off-by: Alex Le <[email protected]> --------- Signed-off-by: Alex Le <[email protected]> * Remove TransferChunks gRPC method (cortexproject#6543) Signed-off-by: SungJin1212 <[email protected]> Signed-off-by: Alex Le <[email protected]> * Uupdate Ppromqlsmith (cortexproject#6557) Signed-off-by: alanprot <[email protected]> Signed-off-by: Alex Le <[email protected]> * Query Partial Data (cortexproject#6526) * Create partial_data Signed-off-by: Justin Jung <[email protected]> * Fix lazyquery so that warning message is returned Signed-off-by: Justin Jung <[email protected]> * Add QueryPartialData limit Signed-off-by: Justin Jung <[email protected]> * Fix broken mock Signed-off-by: Justin Jung <[email protected]> * Make response with warnings to be not cached Signed-off-by: Justin Jung <[email protected]> * Updated streamingSelect in distributor_queryable Signed-off-by: Justin Jung <[email protected]> * Update query.go Signed-off-by: Justin Jung <[email protected]> * Update replication_set Signed-off-by: Justin Jung <[email protected]> * Lint Signed-off-by: Justin Jung <[email protected]> * Lint again Signed-off-by: Justin Jung <[email protected]> * Generated doc Signed-off-by: Justin Jung <[email protected]> * Changelog Signed-off-by: Justin Jung <[email protected]> * Update config description Signed-off-by: Justin Jung <[email protected]> * Do not remove warnings from seriesSet Signed-off-by: Justin Jung <[email protected]> * Avoid cache only if the warning message contains partial data error Signed-off-by: Justin Jung <[email protected]> * Remove context usage for partial data Signed-off-by: Justin Jung <[email protected]> * Refactor how partial data info is passed + apply to series and label methods as well Signed-off-by: Justin Jung <[email protected]> * Lint + fix tests Signed-off-by: Justin Jung <[email protected]> * Fix build Signed-off-by: Justin Jung <[email protected]> * Create separate config for ruler partial data Signed-off-by: Justin Jung <[email protected]> * Genereta doc Signed-off-by: Justin Jung <[email protected]> * Add more tests Signed-off-by: Justin Jung <[email protected]> * Change error Signed-off-by: Justin Jung <[email protected]> * Fix test Signed-off-by: Justin Jung <[email protected]> * Update changelog Signed-off-by: Justin Jung <[email protected]> * Update changelog Signed-off-by: Justin Jung <[email protected]> * Nit Signed-off-by: Justin Jung <[email protected]> * Nit Signed-off-by: Justin Jung <[email protected]> --------- Signed-off-by: Justin Jung <[email protected]> Signed-off-by: Alex Le <[email protected]> * Add timeout for dynamodb ring kv (cortexproject#6544) * add dynamodb kv with timeout enforced Signed-off-by: yeya24 <[email protected]> * add tests Signed-off-by: yeya24 <[email protected]> * docs Signed-off-by: Ben Ye <[email protected]> * update changelog Signed-off-by: Ben Ye <[email protected]> --------- Signed-off-by: yeya24 <[email protected]> Signed-off-by: Ben Ye <[email protected]> Signed-off-by: Alex Le <[email protected]> * Bump the actions-dependencies group across 1 directory with 2 updates (cortexproject#6564) Bumps the actions-dependencies group with 2 updates in the / directory: [github/codeql-action](https://github.com/github/codeql-action) and [actions/setup-go](https://github.com/actions/setup-go). Updates `github/codeql-action` from 3.28.1 to 3.28.7 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@b6a472f...6e54559) Updates `actions/setup-go` from 5.2.0 to 5.3.0 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@3041bf5...f111f33) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-dependencies - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Alex Le <[email protected]> * Fix: expanded postings can cache wrong data when queries are issued "in the future" (cortexproject#6562) * improve fuzz test for expanded postings cache Signed-off-by: alanprot <[email protected]> * create more tests on the expanded postings cache Signed-off-by: alanprot <[email protected]> * adding get series call on the test Signed-off-by: alanprot <[email protected]> * no use CachedBlockChunkQuerier when query time range is completely after the last sample added in the head Signed-off-by: alanprot <[email protected]> * adding comments Signed-off-by: alanprot <[email protected]> * increase the number of fuzz test from 100 to 300 Signed-off-by: alanprot <[email protected]> * add get series fuzzy testing Signed-off-by: alanprot <[email protected]> --------- Signed-off-by: alanprot <[email protected]> Signed-off-by: Alex Le <[email protected]> * Extend ShuffleSharding on READONLY ingesters (cortexproject#6517) * Filter readOnly ingesters when sharding Signed-off-by: Daniel Deluiggi <[email protected]> * Extend shard on READONLY Signed-off-by: Daniel Deluiggi <[email protected]> * Remove old code Signed-off-by: Daniel Deluiggi <[email protected]> * Fix test Signed-off-by: Daniel Deluiggi <[email protected]> * update changelog Signed-off-by: Daniel Deluiggi <[email protected]> --------- Signed-off-by: Daniel Deluiggi <[email protected]> Signed-off-by: Alex Le <[email protected]> * Create guide doc for partition compaction Signed-off-by: Alex Le <[email protected]> * Update docs/guides/partitioning-compactor.md Co-authored-by: Charlie Le <[email protected]> Signed-off-by: Alex Le <[email protected]> Signed-off-by: Alex Le <[email protected]> * updated doc Signed-off-by: Alex Le <[email protected]> * clean white space Signed-off-by: Alex Le <[email protected]> --------- Signed-off-by: alanprot <[email protected]> Signed-off-by: Alex Le <[email protected]> Signed-off-by: Daniel Sabsay <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: SungJin1212 <[email protected]> Signed-off-by: Charlie Le <[email protected]> Signed-off-by: yeya24 <[email protected]> Signed-off-by: Ahmed Hassan <[email protected]> Signed-off-by: Friedrich Gonzalez <[email protected]> Signed-off-by: Daniel Deluiggi <[email protected]> Signed-off-by: Justin Jung <[email protected]> Signed-off-by: Ben Ye <[email protected]> Signed-off-by: Alex Le <[email protected]> Co-authored-by: Alan Protasio <[email protected]> Co-authored-by: Daniel Sabsay <[email protected]> Co-authored-by: Daniel Sabsay <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: SungJin1212 <[email protected]> Co-authored-by: Charlie Le <[email protected]> Co-authored-by: Ben Ye <[email protected]> Co-authored-by: Sam McBroom <[email protected]> Co-authored-by: Ahmed Hassan <[email protected]> Co-authored-by: Friedrich Gonzalez <[email protected]> Co-authored-by: Daniel Blando <[email protected]> Co-authored-by: Justin Jung <[email protected]>
1 parent a5698ac commit ee6da7a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

docs/guides/partitioning-compactor.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: "Use Partition Compaction in Cortex"
3+
linkTitle: "Partition Compaction"
4+
weight: 10
5+
slug: partition-compaction
6+
---
7+
8+
## Context
9+
10+
Compactor is bounded by maximum 64GB of index file size. If compaction failed due to exceeding index file size limit, partition compaction can be enabled to allow compactor compacting into multiple blocks that have index file size stays within limit.
11+
12+
## Enable Partition Compaction
13+
14+
In order to enable partition compaction, the following flag needs to be set:
15+
16+
```
17+
-compactor.sharding-enabled=true # Enable sharding tenants across multiple compactor instances. This is required to enable partition compaction
18+
-compactor.sharding-strategy=shuffle-sharding # Use Shuffle Sharding as sharding strategy. This is required to enable partition compaction
19+
-compactor.compaction-strategy=partitioning # Use Partition Compaction as compaction strategy. To turn if off, set it to `default`
20+
```
21+
22+
### Migration
23+
24+
There is no special migration process needed to enable partition compaction. End user could enable it by setting the above configurations all at once.
25+
26+
Enabling partition compaction would group previously compacted blocks (only those have time range smaller than the largest configured compaction time ranges) with uncompacted blocks and generate new compaction plans. This would group blocks having duplicated series together and those series would be deduped after compaction.
27+
28+
Disabling partition compaction after enabled it does not need migration either. After disabling partition compaction, compactor would group partitioned result blocks together and compact them into one block.
29+
30+
## Configure Partition Compaction
31+
32+
By default, partition compaction utilizes the following configurations and their values:
33+
34+
```
35+
-compactor.partition-index-size-bytes=68719476736 # 64GB
36+
-compactor.partition-series-count=0 # no limit
37+
```
38+
39+
The default value should start partitioning result blocks when sum of index files size of parent blocks exceeds 64GB. End user could also change those two configurations. Partition compaction would always calculate partition count based on both configuration and pick the one with higher partition count.
40+
41+
Both configurations support to be set per tenant.
42+
43+
Note: `compactor.partition-series-count` is using sum of series count of all parent blocks. If parent blocks were not deduped, the result block could have fewer series than the configuration value.
44+
45+
## Useful Metrics
46+
47+
- `cortex_compactor_group_partition_count`: can be used to keep track of how many partitions being compacted for each time range.
48+
- `cortex_compactor_group_compactions_not_planned_total`: can be used to alarm any compaction was failed to be planned due to error.
49+
- `cortex_compact_group_compaction_duration_seconds`: can be used to monitor compaction duration of each time range compactions.
50+
- `cortex_compactor_oldest_partition_offset`: can be used to monitor when was the oldest compaction that is still not completed.

0 commit comments

Comments
 (0)