-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
28e5519
to
c12fda9
Compare
Signed-off-by: Bartek Plotka <[email protected]>
This is meant to replace many inconsistent meta.json syncs places in other components. Signed-off-by: Bartlomiej Plotka <[email protected]>
pkg/block/fetcher.go
Outdated
|
||
m := &metadata.Meta{} | ||
if err := json.Unmarshal(metaContent, m); err != nil { | ||
return nil, errors.Wrapf(ErrorSyncMetaCorrupted, "meta.json %v unmarshal: %v ", metaFile, err) |
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.
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" |
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.
Nit: does this need to be exposed?
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.
Yes - used in #1937 (:
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.
Besides those small nits LGTM - nice attention to the detail and nice tests!
Signed-off-by: Bartlomiej Plotka <[email protected]>
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 [email protected]