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

Block v2: Paged indexes/data #577

Merged
merged 28 commits into from
Mar 10, 2021
Merged

Conversation

joe-elliott
Copy link
Member

@joe-elliott joe-elliott commented Mar 8, 2021

What this PR does:
Creates a v2 block that accesses its index by page instead of as a whole. This will allow us to grow our index sizes signficantly.

Generally, I think this PR is solid, but I do have some concerns about the .Find() method on the v2.indexReader. When I first started this I thought we were going to use the "fact" that ids should be roughly linearly distributed from minID to maxID in the block. I was intending to estimate the first page based on the requested ID and check that page and go from there. However, trace ids are either 64 bit OR 128 bit. In a scenario where a block had a single 128 bit id it would skew the linearity assumption so badly, that I felt the consistency of binary search was preferred (even if it underperforms in a lot of cases).

  • Adjusts the default index downsample bytes to 1MB. This will double the size of our indexes.
  • Sets the default size of index page to 250KB. This implies roughly 10 pages on our largest blocks.
  • A side effect of moving index access from .Read() to .ReadRange() is that we are no longer caching indexes. I am fine with this for now, but we will need to revisit soon. If anything the index pages should make them far more cacheable then before.
  • Added 2 fields to the meta needed to read the block: IndexPageSize and TotalRecords. I am unexcited about further bloat in the meta.json file, but I don't know where else to put this.
  • Wrapped the data in the same page object. This allows parsing of a data file even without an index.
  • Renamed PageReader/Writer => DataReader/Writer for clarity

Which issue(s) this PR fixes:
Fixes #32

Checklist

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

Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Copy link
Contributor

@annanay25 annanay25 left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

Organize storage/access around a page
3 participants