-
Notifications
You must be signed in to change notification settings - Fork 816
Create guide doc for partition compaction #6512
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
Merged
yeya24
merged 35 commits into
cortexproject:master
from
alexqyle:partition-compaction-doc
Mar 27, 2025
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
df10150
Purge expired postings cache items due inactivity (#6502)
alanprot f53d0bc
Update thanos to 4ba0ba403896 (#6503)
dsabsay d6de77c
Bump the actions-dependencies group across 1 directory with 2 updates…
dependabot[bot] b95024f
calculate # of concurrency only once at the runner (#6506)
SungJin1212 0d17b32
Implement partition compaction planner (#6469)
alexqyle 5ebdb83
Add max tenant config to tenant federation (#6493)
SungJin1212 963d7bd
Add cleaner logic to clean partition compaction blocks and related fi…
alexqyle 0aa9048
Update RELEASE.md (#6511)
CharlieTLe 51772d4
update thanos version to 236777732278c64ca01c1c09d726f0f712c87164 (#6…
yeya24 3666e70
Fix race that can cause nil reference when using expanded postings (#…
alanprot 22d231c
Add more op label values to cortex_query_frontend_queries_total metri…
SungJin1212 c0e64d5
Allow use of non-dualstack endpoints for S3 blocks storage (#6522)
sam-mcbr a64382d
Expose grpc client connect timeout config and default to 5s (#6523)
yeya24 12e8808
Hook up partition compaction end to end implementation (#6510)
alexqyle 79adc33
Test for nil on expire expanded postings (#6521)
alanprot 8203621
log when a request starts running in querier (#6525)
afhassan 44032df
Update build image according to https://github.com/cortexproject/cort…
friedrichg 6c5ce8e
Deprecate -blocks-storage.tsdb.wal-compression-enabled flag
SungJin1212 47af5e5
Fix test (#6537)
danielblando e3cc297
Mark 1.19 release in progress
CharlieTLe e9584c0
Prepare 1.19.0-rc.0
CharlieTLe 83ddfb8
Revert "Prepare 1.19.0-rc.0"
CharlieTLe a9d69a6
Fixed blocksGroupWithPartition unable to reuse functions from blocksG…
alexqyle 1035fa1
Remove TransferChunks gRPC method (#6543)
SungJin1212 cdc6781
Uupdate Ppromqlsmith (#6557)
alanprot 550a559
Query Partial Data (#6526)
justinjung04 1c7157c
Add timeout for dynamodb ring kv (#6544)
yeya24 4ec7588
Bump the actions-dependencies group across 1 directory with 2 updates…
dependabot[bot] d97f610
Fix: expanded postings can cache wrong data when queries are issued "…
alanprot 0350068
Extend ShuffleSharding on READONLY ingesters (#6517)
danielblando 71fa878
Create guide doc for partition compaction
alexqyle 117373a
Update docs/guides/partitioning-compactor.md
alexqyle a7466d1
updated doc
alexqyle c83f552
Merge commit 'b48f93b12ee3deb5ae251cc52cda55754f109efb' into partitio…
alexqyle 6b8066b
clean white space
alexqyle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: "Use Partition Compaction in Cortex" | ||
linkTitle: "Partition Compaction" | ||
weight: 10 | ||
slug: partition-compaction | ||
--- | ||
|
||
## Context | ||
|
||
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. | ||
|
||
## Enable Partition Compaction | ||
|
||
In order to enable partition compaction, the following flag needs to be set: | ||
|
||
``` | ||
-compactor.sharding-enabled=true # Enable sharding tenants across multiple compactor instances. This is required to enable partition compaction | ||
-compactor.sharding-strategy=shuffle-sharding # Use Shuffle Sharding as sharding strategy. This is required to enable partition compaction | ||
-compactor.compaction-strategy=partitioning # Use Partition Compaction as compaction strategy. To turn if off, set it to `default` | ||
``` | ||
|
||
alexqyle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Migration | ||
|
||
There is no special migration process needed to enable partition compaction. End user could enable it by setting the above configurations all at once. | ||
|
||
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. | ||
|
||
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. | ||
|
||
## Configure Partition Compaction | ||
|
||
By default, partition compaction utilizes the following configurations and their values: | ||
|
||
``` | ||
-compactor.partition-index-size-bytes=68719476736 # 64GB | ||
-compactor.partition-series-count=0 # no limit | ||
``` | ||
|
||
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. | ||
|
||
Both configurations support to be set per tenant. | ||
|
||
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. | ||
|
||
## Useful Metrics | ||
|
||
- `cortex_compactor_group_partition_count`: can be used to keep track of how many partitions being compacted for each time range. | ||
- `cortex_compactor_group_compactions_not_planned_total`: can be used to alarm any compaction was failed to be planned due to error. | ||
- `cortex_compact_group_compaction_duration_seconds`: can be used to monitor compaction duration of each time range compactions. | ||
- `cortex_compactor_oldest_partition_offset`: can be used to monitor when was the oldest compaction that is still not completed. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.