Skip to content
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

Added block.MetaFetcher logic for resilient sync of meta files. #1934

Merged
merged 3 commits into from
Jan 6, 2020

Conversation

bwplotka
Copy link
Member

@bwplotka bwplotka commented Jan 3, 2020

This is meant to replace least 5 inconsistent meta.json syncs places across components.

Usage of those will be done in follow up chained PRs.

In the first commit: Transactional gauge allowing to have atomic gauge across different labels.

Signed-off-by: Bartlomiej Plotka bwplotka@gmail.com

@bwplotka bwplotka force-pushed the meta-syncer branch 2 times, most recently from 28e5519 to c12fda9 Compare January 3, 2020 16:51
@bwplotka bwplotka marked this pull request as ready for review January 3, 2020 16:52
Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
@bwplotka bwplotka changed the title Added single block.MetaFetcher logic for resilient sync of meta files. Added block.MetaFetcher logic for resilient sync of meta files. Jan 3, 2020
This is meant to replace many inconsistent meta.json syncs places in other components.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

m := &metadata.Meta{}
if err := json.Unmarshal(metaContent, m); err != nil {
return nil, errors.Wrapf(ErrorSyncMetaCorrupted, "meta.json %v unmarshal: %v ", metaFile, err)
Copy link
Member

Choose a reason for hiding this comment

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

Small nit: that space at the end seems unnecessary. The same happened on some other lines as well.

// Filter's label values.
labelExcludedMeta = "label-excluded"
timeExcludedMeta = "time-excluded"
TooFreshMeta = "too-fresh"
Copy link
Member

@GiedriusS GiedriusS Jan 4, 2020

Choose a reason for hiding this comment

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

Nit: does this need to be exposed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes - used in #1937 (:

Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

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

Besides those small nits LGTM - nice attention to the detail and nice tests!

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
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.

2 participants