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(rf1): Store index ref in metastore #13613

Merged
merged 5 commits into from
Jul 23, 2024

Conversation

cyriltovena
Copy link
Contributor

What this PR does / why we need it:

This stores in the metastore the offset and size of the index for each WAL segment.

We'll be able to use this to avoid downloading all chunks that we don't need in the future read path.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@cyriltovena cyriltovena requested a review from a team as a code owner July 22, 2024 13:25
return DataRef(offset<<32 | size)
}

func (b DataRef) Unpack() (int, int) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Whats the reason to pack these values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None really, we could use 2 int64 or 2 int32. The code was just available and I copy pasted.

Do you prefer to change it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're using it elsewhere then I'm happy to continue using it. If this is the first usage I'm less inclined to introduce this as a way of storing multiple values unless there is a good reason (maybe due to perf, storage concerns etc.)

@@ -0,0 +1,13 @@
package wal
Copy link
Contributor

Choose a reason for hiding this comment

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

this file can be removed now

@pull-request-size pull-request-size bot added size/S and removed size/M labels Jul 23, 2024
@cyriltovena cyriltovena merged commit 5f5fd4e into grafana:main Jul 23, 2024
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants