Skip to content

Enable setting default chunk encoding by config file (#2077) #4086

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

Closed
wants to merge 3 commits into from

Conversation

ChinYing-Li
Copy link
Contributor

@ChinYing-Li ChinYing-Li commented Apr 19, 2021

What this PR does:
Adds a field to Encoding.Config to allow parsing the string value from config files.
DefaultEncoding is later set in func New at cortex.go.
Please let me know if some tests should be introduced.
Any suggestion is appreciated!

Which issue(s) this PR fixes:
Fixes #2077

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@ChinYing-Li ChinYing-Li force-pushed the issue_2077 branch 4 times, most recently from 1434b99 to 8a64704 Compare April 19, 2021 10:28
)

Signed-off-by: ChinYing-Li <chinying.li@mail.utoronto.ca>
@gouthamve
Copy link
Contributor

Can you please rebase against master to pull in #4137 and move the changelog entry to the top?

New: func() Chunk {
return newVarbitChunk(varbitZeroEncoding)
},
},
Bigchunk: {
Name: "Bigchunk",
Name: "big-chunk",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: If anyone is currently using the existing flag will this be a breaking change? Maybe it'd be best to keep the values for encoding types as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

func (Config) RegisterFlags(f *flag.FlagSet) {
f.Var(&DefaultEncoding, "ingester.chunk-encoding", "Encoding version to use for chunks.")
func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
f.StringVar(&cfg.EncodingName, "encoding.chunk-encoding", "BigChunk", "Encoding version to use for chunks.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately we can't change CLI flag names or default values, otherwise we break our backward compatibility guarantee (see https://cortexmetrics.io/docs/configuration/v1guarantees/).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reminding!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pracucci Is it allowed to set a value using different names in CLI and json?
E.g. set DefaultEnconding using the CLI flag ingester.chunk-encoding, but set it as

encoding:  
  chunk_encoding: BigChunk 

in yaml config files?

@stale
Copy link

stale bot commented Sep 5, 2021

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 5, 2021
@bboreham
Copy link
Contributor

Chunk storage has now been deprecated: #4268
We will not add any new capabilities for chunks.

@bboreham bboreham closed this Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot set -ingester.chunk-encoding by config file
5 participants