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

feat tools: bucket replicate allows to filter multiple compaction and… #2671

Merged
merged 8 commits into from
Jun 8, 2020

Conversation

FUSAKLA
Copy link
Member

@FUSAKLA FUSAKLA commented May 27, 2020

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.

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • thanos tools bucket replicate now allows repeated flags for compaction and resolution levels
  • thanos tools bucket replicate resolution flag is now in duraion format
  • thanos tools bucket replicate defaults now to migrate all blocks

Verification

tested it locally

@FUSAKLA FUSAKLA requested a review from bwplotka May 27, 2020 15:35
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Awesome!

Some suggestions (:

CHANGELOG.md Outdated Show resolved Hide resolved
cmd/thanos/tools_bucket.go Outdated Show resolved Hide resolved
cmd/thanos/tools_bucket.go Outdated Show resolved Hide resolved
pkg/objstore/swift/swift.go Outdated Show resolved Hide resolved

resolutionMatch := gotResolution == expectedResolution
resolutionMatch := false
for _, allowedResolution := range bf.resolutionLevels {
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about moving to map? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I hope I understood your intentions, is this what you had in mind? 76810cf

@FUSAKLA
Copy link
Member Author

FUSAKLA commented May 28, 2020

Also I was thinking about moveing to duration with the resolution?
--resolution=5m instead of --resolution=300000

// 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()
Copy link
Member Author

Choose a reason for hiding this comment

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

@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.

Copy link
Member

Choose a reason for hiding this comment

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

hm, I think that's ok (:

@FUSAKLA FUSAKLA force-pushed the fus-bucket-replicate branch 3 times, most recently from 19ce791 to bdfcc65 Compare May 28, 2020 13:04
FUSAKLA and others added 8 commits June 7, 2020 23:57
… 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>
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

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()
Copy link
Member

Choose a reason for hiding this comment

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

hm, I think that's ok (:

@bwplotka bwplotka merged commit 8c3f029 into thanos-io:master Jun 8, 2020
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