-
Notifications
You must be signed in to change notification settings - Fork 875
Parquet add no convert marker #7625
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
SungJin1212
merged 7 commits into
cortexproject:master
from
siddarth2810:parquet-add-no-convert-marker
Sep 7, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
58d2e8b
parquetconverter: skip blocks with too many label names
siddarth2810 fe2a759
Update config docs for max-block-label-names
siddarth2810 63846e7
parquetconverter: skip manually marked no-convert blocks
siddarth2810 9397919
parquetconverter: track limits in no-convert
siddarth2810 b40cdb3
parquetconverter: split no-convert skip reasons
siddarth2810 4bfa3fd
Merge remote-tracking branch 'origin/master' into parquet-add-no-conv…
siddarth2810 6674a96
parquetconverter: use requires_docker build tag so integration test r…
siddarth2810 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
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
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
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,142 @@ | ||
| //go:build requires_docker | ||
|
|
||
| package integration | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "math/rand" | ||
| "path/filepath" | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/prometheus/prometheus/model/labels" | ||
| "github.com/stretchr/testify/require" | ||
| "github.com/thanos-io/objstore" | ||
| "github.com/thanos-io/thanos/pkg/block" | ||
| "github.com/thanos-io/thanos/pkg/block/metadata" | ||
|
|
||
| "github.com/cortexproject/cortex/integration/e2e" | ||
| e2ecache "github.com/cortexproject/cortex/integration/e2e/cache" | ||
| e2edb "github.com/cortexproject/cortex/integration/e2e/db" | ||
| "github.com/cortexproject/cortex/integration/e2ecortex" | ||
| "github.com/cortexproject/cortex/pkg/storage/bucket" | ||
| "github.com/cortexproject/cortex/pkg/storage/tsdb" | ||
| "github.com/cortexproject/cortex/pkg/util/log" | ||
| cortex_testutil "github.com/cortexproject/cortex/pkg/util/test" | ||
| ) | ||
|
|
||
| func TestParquetConverter_NoConvertMarkWithTooManyLabels(t *testing.T) { | ||
| s, err := e2e.NewScenario(networkName) | ||
| require.NoError(t, err) | ||
| defer s.Close() | ||
|
|
||
| consul := e2edb.NewConsulWithName("consul") | ||
| memcached := e2ecache.NewMemcached() | ||
| require.NoError(t, s.StartAndWaitReady(consul, memcached)) | ||
|
|
||
| baseFlags := mergeFlags(AlertmanagerLocalFlags(), BlocksStorageFlags()) | ||
| flags := mergeFlags( | ||
| baseFlags, | ||
| map[string]string{ | ||
| "-target": "all,parquet-converter", | ||
| "-blocks-storage.tsdb.block-ranges-period": "1m,24h", | ||
| "-blocks-storage.tsdb.ship-interval": "1s", | ||
| "-blocks-storage.bucket-store.sync-interval": "1s", | ||
| "-blocks-storage.bucket-store.metadata-cache.bucket-index-content-ttl": "1s", | ||
| "-blocks-storage.bucket-store.bucket-index.idle-timeout": "1s", | ||
| "-blocks-storage.bucket-store.bucket-index.enabled": "true", | ||
| "-blocks-storage.bucket-store.index-cache.backend": tsdb.IndexCacheBackendInMemory, | ||
| // compactor | ||
| "-compactor.cleanup-interval": "1s", | ||
| // Ingester. | ||
| "-ring.store": "consul", | ||
| "-consul.hostname": consul.NetworkHTTPEndpoint(), | ||
| // Distributor. | ||
| "-distributor.replication-factor": "1", | ||
| // Store-gateway. | ||
| "-store-gateway.sharding-enabled": "false", | ||
| "--querier.store-gateway-addresses": "nonExistent", // Make sure we do not call Store gateways | ||
| // alert manager | ||
| "-alertmanager.web.external-url": "http://localhost/alertmanager", | ||
| // Enable vertical sharding. | ||
| "-frontend.query-vertical-shard-size": "3", | ||
| "-frontend.max-cache-freshness": "1m", | ||
| // enable experimental promQL funcs | ||
| "-querier.enable-promql-experimental-functions": "true", | ||
| // parquet-converter | ||
| "-parquet-converter.ring.consul.hostname": consul.NetworkHTTPEndpoint(), | ||
| "-parquet-converter.conversion-interval": "1s", | ||
| "-parquet-converter.enabled": "true", | ||
| "-parquet-converter.max-block-label-names": "1", | ||
| // Querier | ||
| "-querier.enable-parquet-queryable": "true", | ||
| // Enable cache for parquet labels and chunks | ||
| "-blocks-storage.bucket-store.parquet-labels-cache.backend": "inmemory,memcached", | ||
| "-blocks-storage.bucket-store.parquet-labels-cache.memcached.addresses": "dns+" + memcached.NetworkEndpoint(e2ecache.MemcachedPort), | ||
| "-blocks-storage.bucket-store.chunks-cache.backend": "inmemory,memcached", | ||
| "-blocks-storage.bucket-store.chunks-cache.memcached.addresses": "dns+" + memcached.NetworkEndpoint(e2ecache.MemcachedPort), | ||
| }, | ||
| ) | ||
|
|
||
| // make alert manager config dir | ||
| require.NoError(t, writeFileToSharedDir(s, "alertmanager_configs", []byte{})) | ||
|
|
||
| ctx := context.Background() | ||
| rnd := rand.New(rand.NewSource(time.Now().Unix())) | ||
| dir := filepath.Join(s.SharedDir(), "data") | ||
| lbls := []labels.Labels{ | ||
| labels.FromStrings("__name__", "test_series_a", "job", "test"), | ||
| } | ||
|
|
||
| numSamples := 60 | ||
| scrapeInterval := time.Minute | ||
| now := time.Now() | ||
| start := now.Add(-time.Hour * 24) | ||
| end := now.Add(-time.Hour) | ||
|
|
||
| minio := e2edb.NewMinio(9000, flags["-blocks-storage.s3.bucket-name"]) | ||
| require.NoError(t, s.StartAndWaitReady(minio)) | ||
|
|
||
| cortex := e2ecortex.NewSingleBinary("cortex", flags, "") | ||
| require.NoError(t, s.StartAndWaitReady(cortex)) | ||
| storage, err := e2ecortex.NewS3ClientForMinio(minio, flags["-blocks-storage.s3.bucket-name"]) | ||
| require.NoError(t, err) | ||
| bkt := bucket.NewUserBucketClient("user-1", storage.GetBucket(), nil) | ||
|
|
||
| id, err := e2e.CreateBlock(ctx, rnd, dir, lbls, numSamples, | ||
| start.UnixMilli(), | ||
| end.UnixMilli(), | ||
| scrapeInterval.Milliseconds(), 10, | ||
| ) | ||
| require.NoError(t, err) | ||
|
|
||
| err = block.Upload(ctx, log.Logger, bkt, filepath.Join(dir, id.String()), metadata.NoneFunc) | ||
| require.NoError(t, err) | ||
|
|
||
| // Wait for the converter to write the no-convert marker | ||
| cortex_testutil.Poll(t, 30*time.Second, true, func() interface{} { | ||
| noConvertMarkerPath := fmt.Sprintf("%s/parquet-no-convert-mark.json", id.String()) | ||
| found := false | ||
| err := bkt.Iter(ctx, "", func(name string) error { | ||
| if name == noConvertMarkerPath { | ||
| found = true | ||
| } | ||
| return nil | ||
| }, objstore.WithRecursiveIter()) | ||
| require.NoError(t, err) | ||
| return found | ||
| }) | ||
|
|
||
| // confirm the conversion did not happen (check both paths) | ||
| blockID := id.String() | ||
| markerPaths := []string{ | ||
| fmt.Sprintf("%s/parquet-converter-mark.json", blockID), | ||
| fmt.Sprintf("parquet-markers/%s-parquet-converter-mark.json", blockID), | ||
| } | ||
| for _, markerPath := range markerPaths { | ||
| exists, err := bkt.Exists(ctx, markerPath) | ||
| require.NoError(t, err) | ||
| require.False(t, exists, "converter mark should not exist at %s", markerPath) | ||
| } | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice if we use the
parquetConverterDataColumnDurationinbaseConverterOptions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@siddarth2810
Can you get the rebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, sorry for the delay