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

Add min/max time filter to blockscopy and change min duration default to 0 #261

Merged
merged 2 commits into from
Sep 28, 2022

Conversation

pracucci
Copy link
Contributor

I'm running a migration between two Grafana Mimir clusters and using the blockscopy tool to copy blocks. I've done some changes to blockscopy to support me, which I would like to upstream in this PR:

  • Add min/max time filter (optional)
  • Change min duration filter from 24h to 0 (so that all blocks get copied by default)

… to 0

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci requested a review from a team as a code owner September 27, 2022 12:51
Copy link

@jhesketh jhesketh left a comment

Choose a reason for hiding this comment

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

Change seems reasonable to me. Should we have test coverage for this?

(The linting error appears unrelated).

@pracucci
Copy link
Contributor Author

Should we have test coverage for this?

We don't have tests for this tool. Ideally yes, but for many tools we don't have tests.

Copy link

@56quarters 56quarters left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -50,7 +52,9 @@ type config struct {
func (c *config) RegisterFlags(f *flag.FlagSet) {
f.StringVar(&c.sourceBucket, "source-bucket", "", "Source GCS bucket with blocks.")
f.StringVar(&c.destBucket, "destination-bucket", "", "Destination GCS bucket with blocks.")
f.DurationVar(&c.minBlockDuration, "min-block-duration", 24*time.Hour, "If non-zero, ignore blocks that cover block range smaller than this.")
f.DurationVar(&c.minBlockDuration, "min-block-duration", 0, "If non-zero, ignore blocks that cover block range smaller than this.")
f.Var(&c.minTime, "min-time", "If set, only blocks with MinTime >= this value are copied.")

Choose a reason for hiding this comment

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

Can you add an example of the expected format for these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Done in: ce4619c

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci
Copy link
Contributor Author

Lint fails because of the old go version required. I'm going to merge cause I will move this tool to Mimir repo.

@pracucci pracucci merged commit c88f1fa into main Sep 28, 2022
@pracucci pracucci deleted the add-min-max-time-filter-blockslist branch September 28, 2022 08:13
friedrichg pushed a commit to cortexproject/cortex-tools that referenced this pull request Aug 1, 2023
Signed-off-by: Josh Carp <jm.carp@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.

None yet

3 participants