Repository navigation
Implement hybrid mode for Store Gateway - #7689
SungJin1212 wants to merge 4 commits into
Conversation
ce7c27f to
ccb6de4
Compare
d1d08b0 to
4f3054a
Compare
64f6f88 to
0a14e4f
Compare
27c3282 to
aa3dd5c
Compare
|
#7892 should be merged to fix |
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
f093cbf to
8fc21bf
Compare
sandy2008
left a comment
There was a problem hiding this comment.
LGTM. I traced the handover: the TSDB sub-store's filter drops converted blocks and records their IDs from the same bucket index snapshot, and the Parquet store reads the converter mark when its own index view doesn't have a block yet, so a block is servable whichever side it is routed to. The merge path cancels and closes both producers correctly, and the hybrid, filter and streaming-server tests pass with -race; generated docs and schema are in sync. The failing test-no-race (amd64) job is TestCompactor_ShouldSkipOutOrOrderBlocks in pkg/compactor, which this PR doesn't touch: the test checks the counter as soon as no-compact-mark.json exists, but Thanos uploads the mark before incrementing it.
|
|
||
| * [FEATURE] Ruler: Add experimental support for federated rule groups. A rule group listing tenants in its `source_tenants` field is evaluated against those tenants while the resulting series and alerts are written to the tenant owning the rule group. Enabled with `-ruler.enable-federated-rules` (requires `-tenant-federation.enabled`), and restricted to selected tenants with `-ruler.allowed-federated-tenants` and `-ruler.disallowed-federated-tenants`. #7828 | ||
| * [FEATURE] Distributor: Add experimental OTLP metrics ingestion over gRPC (`opentelemetry.proto.collector.metrics.v1.MetricsService/Export`) on the gRPC server port. Enable it with `-distributor.otlp.grpc-enabled`. The tenant is read from the `X-Scope-OrgID` gRPC metadata, and the request size is limited by `-server.grpc-max-recv-msg-size-bytes`. #7873 | ||
| * [FEATURE] StoreGateway: Add a hybrid mode to the parquet bucket store (`-blocks-storage.bucket-store.bucket-store-type=parquet`), which serves blocks not yet converted to Parquet from TSDB blocks so they stay queryable. Hybrid mode is the default and requires the bucket index. Set `-blocks-storage.bucket-store.parquet-fallback-disabled=true` to keep the previous Parquet-only behavior. #7689 |
There was a problem hiding this comment.
Nit: since this changes what an existing bucket_store_type=parquet deployment does by default (it now keeps index-headers on local disk and requires the bucket index), a [CHANGE] line might help operators notice it on upgrade.
What this PR does:
Problem Statement
In the current Parquet mode, the store-gateway only serves blocks that have already been converted to Parquet. Any block that hasn't been converted yet is not queryable at all, since the Parquet store has no way to read TSDB blocks.
In practice, this forces operators to either stay on tsdb mode or wait for full conversion of all historical blocks before flipping the switch. Even then, the gap doesn't fully go away: new blocks are produced continuously (from Compactor) and take some time to be converted.
Solutions
This PR adds a hybrid mode to the Parquet bucket store. The store-gateway runs both a Parquet store and a TSDB sub-store and routes each requested block to one of them, so every block is queryable regardless of its conversion state.
IgnoreParquetBlocksFilterexcludes converted blocks using the bucket index.Seriesqueries both concurrently and stream-merges their label-sorted results without buffering either side.LabelNames/LabelValuesresults and the response hints (QueriedBlocks,QueryStats) are merged as well. If one sub-store fails, its own error is returned so the querier can still classify it (retry, limit, access denied).Configuration
-blocks-storage.bucket-store.bucket-store-type=parquetand requires the bucket index. The config validation fails if the bucket index is disabled.-blocks-storage.bucket-store.parquet-fallback-disabled(defaultfalse). Setting it totruekeeps the previous Parquet-only behavior: no TSDB sub-store, no local state, and the bucket index is not required.Behavior change
With the default hybrid mode, the Parquet bucket store changes from stateless to semi-stateful: it keeps index-headers on local disk for blocks that are not converted yet. A block that is later converted has its index-header downloaded while the conversion is pending and removed once the store-gateway syncs the converted state.
New metrics
cortex_hybrid_bucket_stores_blocks_routed_total{store}: requested blocks routed to each sub-store.cortex_hybrid_bucket_stores_operations_total{store, method}: operations served byparquet,tsdbormixed.cortex_blocks_meta_synced{state="parquet-converted"}: blocks excluded from the TSDB sub-store because they are converted.Which issue(s) this PR fixes:
Fixes #7140
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]docs/configuration/v1-guarantees.mdupdated if this PR introduces experimental flags