Skip to content

fix wal config not work on config.yml #2071

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
merged 4 commits into from
Feb 5, 2020

Conversation

Wing924
Copy link
Contributor

@Wing924 Wing924 commented Feb 3, 2020

Signed-off-by: Wing924 [email protected]

What this PR does:
Fix bug: walconfig on config file don't work

YAML library use reflect to assign fields, but reflect can't access private fields.
This PR make all ingester.WALConfig public so that walconfig.* can work without error.

Which issue(s) this PR fixes:

Checklist

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

Signed-off-by: Wing924 <[email protected]>
Signed-off-by: Wing924 <[email protected]>
recover bool `yaml:"recover_from_wal,omitempty"`
dir string `yaml:"wal_dir,omitempty"`
checkpointDuration time.Duration `yaml:"checkpoint_duration,omitempty"`
WalEnabled bool `yaml:"wal_enabled,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

WALEnabled

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Thanks for this fix! LGTM, with few nits.

@codesome May you review it too, please?

CHANGELOG.md Outdated
@@ -10,6 +10,7 @@
* [ENHANCEMENT] Experimental TSDB: Added dedicated flag `-experimental.tsdb.bucket-store.tenant-sync-concurrency` to configure the maximum number of concurrent tenants for which blocks are synched. #2026
* [ENHANCEMENT] Experimental TSDB: Expose metrics for objstore operations (prefixed with `cortex_<component>_thanos_objstore_`, component being one of `ingester`, `querier` and `compactor`). #2027
* [BUGFIX] Experimental TSDB: fixed `/all_user_stats` and `/api/prom/user_stats` endpoints when using the experimental TSDB blocks storage. #2042
* [BUGFIX] Ingester: fixed `ingester.walconfig` not work on config.yml. #2071
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rephrase it to make it a bit more clear, something like:

* [BUGFIX] Fixed parsing of the WAL configuration when specified in the YAML config file. #2071

@@ -141,7 +141,7 @@ func New(cfg Config, clientConfig client.Config, limits *validation.Overrides, c
return NewV2(cfg, clientConfig, limits, registerer)
}

if cfg.WALConfig.walEnabled {
if cfg.WALConfig.WalEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

May you rename WalEnabled to WALEnabled , please?

CheckpointEnabled bool `yaml:"checkpoint_enabled,omitempty"`
Recover bool `yaml:"recover_from_wal,omitempty"`
Dir string `yaml:"wal_dir,omitempty"`
CheckpointDuration time.Duration `yaml:"checkpoint_duration,omitempty"`
metricsRegisterer prometheus.Registerer
Copy link
Contributor

Choose a reason for hiding this comment

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

Despite correct, please also add yaml:"-" to enforce we don't want it to be configurable.

Signed-off-by: Wing924 <[email protected]>
Copy link
Contributor

@khaines khaines left a comment

Choose a reason for hiding this comment

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

Great bug to fix! Thank you for submitting this

@pracucci pracucci merged commit 4dc270f into cortexproject:master Feb 5, 2020
@Wing924 Wing924 deleted the fix_wal_config branch February 5, 2020 07:54
pracucci pushed a commit to pracucci/cortex that referenced this pull request Feb 5, 2020
pracucci added a commit that referenced this pull request Feb 5, 2020
Signed-off-by: Marco Pracucci <[email protected]>
Co-authored-by: Wei He <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants