feat tools: bucket replicate allows to filter multiple compaction and…#2671
Merged
bwplotka merged 8 commits intothanos-io:masterfrom Jun 8, 2020
Merged
feat tools: bucket replicate allows to filter multiple compaction and…#2671bwplotka merged 8 commits intothanos-io:masterfrom
bwplotka merged 8 commits intothanos-io:masterfrom
Conversation
bwplotka
reviewed
May 27, 2020
Member
bwplotka
left a comment
There was a problem hiding this comment.
Awesome!
Some suggestions (:
pkg/replicate/scheme.go
Outdated
|
|
||
| resolutionMatch := gotResolution == expectedResolution | ||
| resolutionMatch := false | ||
| for _, allowedResolution := range bf.resolutionLevels { |
Member
There was a problem hiding this comment.
What do you think about moving to map? 🤔
Member
Author
There was a problem hiding this comment.
I hope I understood your intentions, is this what you had in mind? 76810cf
fd3995f to
2dfc46d
Compare
Member
Author
|
Also I was thinking about moveing to |
76810cf to
b7453d9
Compare
FUSAKLA
commented
May 28, 2020
| // TODO(bwplotka): Allow to replicate many compaction levels. | ||
| compaction := cmd.Flag("compaction", "Only blocks with this compaction level will be replicated.").Default("1").Int() | ||
| resolutions := cmd.Flag("resolution", "Only blocks with these resolutions will be replicated. Repeated flag.").Default("0s", "5m", "1h").HintAction(listResLevel).DurationList() | ||
| compactions := cmd.Flag("compaction", "Only blocks with these compaction levels will be replicated. Repeated flag.").Default("1", "2", "3", "4").Ints() |
Member
Author
There was a problem hiding this comment.
@bwplotka I eventually took a stab and changed the defaults and the format of --resolution flag to Go duration.
But if you are against it I'll be happy to roll it back it just felt bit more user friendly.
19ce791 to
bdfcc65
Compare
… resolution lvls Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com> Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com> Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
…to use map Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
… resolution Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
bdfcc65 to
1f4ce5e
Compare
bwplotka
approved these changes
Jun 8, 2020
Member
bwplotka
left a comment
There was a problem hiding this comment.
This looks amazing to me, thanks 👍
| // TODO(bwplotka): Allow to replicate many compaction levels. | ||
| compaction := cmd.Flag("compaction", "Only blocks with this compaction level will be replicated.").Default("1").Int() | ||
| resolutions := cmd.Flag("resolution", "Only blocks with these resolutions will be replicated. Repeated flag.").Default("0s", "5m", "1h").HintAction(listResLevel).DurationList() | ||
| compactions := cmd.Flag("compaction", "Only blocks with these compaction levels will be replicated. Repeated flag.").Default("1", "2", "3", "4").Ints() |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Just bumped into this when migrating from one S3 to Swift.
Is this how you imagined it @bwplotka ?
Didn't want to change the defaults even though I'd maybe prefer to replicate all the data by default and make the filtering as blacklist instead of whitelist. But maybe my use-case is different.
Changes
Verification
tested it locally