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

Store gateway mmap removal: introduce Decbuf.Position() to simplify logic #3785

Merged
merged 10 commits into from
Dec 22, 2022

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Dec 21, 2022

What this PR does

This PR introduces a Position() method to Decbuf. This allows us to remove a number of confusing calculations involving the remaining length of a Decbuf. (This is one example of the confusion the current implementation can cause.)

I've tried to do this incrementally. I'd suggest reviewing each commit individually rather than trying to review the entire PR's changes in one go.

Which issue(s) this PR fixes or relates to

Relates to #3465, builds upon #3742.

Checklist

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

@charleskorn charleskorn requested a review from a team as a code owner December 21, 2022 03:04
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

I checked the offsets math and LGTM! Let's wait for @56quarters review too, since he knows this code better than me.

pkg/storegateway/indexheader/encoding/encoding.go Outdated Show resolved Hide resolved
Copy link
Contributor

@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, much easier to follow now!

@pracucci pracucci enabled auto-merge (squash) December 22, 2022 15:05
@pracucci pracucci merged commit 1c8cd69 into main Dec 22, 2022
@pracucci pracucci deleted the charleskorn/mmap-less-index-header-reader-optimisation branch December 22, 2022 15:19
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