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

Improve tsdb-index and tsdb-index-health. #1503

Merged
merged 4 commits into from
Mar 17, 2022
Merged

Improve tsdb-index and tsdb-index-health. #1503

merged 4 commits into from
Mar 17, 2022

Conversation

pstibrany
Copy link
Member

What this PR does

This PR adds

  • printing of formatted chunk minT/maxT to tsdb-index
  • chunks verification to tsdb-index-health (which doesn't really belong to "index health", but it's useful check. We can find a better place of it at some point.)

Related to internal investigation of blocks with OOO chunks after compaction.

Checklist

  • [na] Tests updated
  • [na] Documentation added
  • [na] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM, but do you have data on which I could test this and see how it works?

Update: I'll try to source some affected blocks later today.

@aknuds1 aknuds1 requested a review from a team March 17, 2022 09:42
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for pushing this, only a minor nit

@@ -26,7 +27,10 @@ import (
var logger = log.NewLogfmtLogger(os.Stderr)

func main() {
if len(os.Args) < 2 {
verifyChunks := flag.Bool("check-chunks", false, "Verify chunks in segment files.")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: when i use the flag, I get an error saying Failed to read meta from block dir --check-chunks error: open --check-chunks/meta.json: no such file or directory. This is because on lines 38-42 we don't check whether the CLI arg is a directory or a block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch, thanks! Updated PR to use only remaining (non-CLI flag arguments) as block directories.

Copy link
Contributor

Choose a reason for hiding this comment

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

A problem here is that the --help output doesn't mention the required argument:

$ ./tools/tsdb-index-health/tsdb-index-health --help
Usage of ./tools/tsdb-index-health/tsdb-index-health:
  -check-chunks
    	Verify chunks in segment files.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM, just the issue with CLI help as I pointed out.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
@pstibrany
Copy link
Member Author

Help should be fixed now. Thanks!

@pstibrany pstibrany merged commit 43df3f7 into main Mar 17, 2022
@pstibrany pstibrany deleted the verify-chunks branch March 17, 2022 17:01
pracucci pushed a commit that referenced this pull request Mar 21, 2022
* Improve tsdb-index and tsdb-index-health.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>

* Only process remaining args as block directories.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>

* Fix help string.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>

* Fix help string.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
@pracucci pracucci mentioned this pull request Mar 21, 2022
3 tasks
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.

3 participants