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

[WIP] internal/manifest: l0SubLevels data-structure and methods to #563

Closed
wants to merge 11 commits into from

Conversation

sumeerbhola
Copy link
Collaborator

measure stack depth, compaction score, pick L0->Lbase and intra-L0
compactions.

The main construction here (beyond the sub-levels introduced in
of intervals is O(N) where N is the number of files in L0, but
we expect that typically each interval will have a file count that
is sublinear in N. These intervals allow for precisely tracking
the depth and are used as the seed for computing compactions.

This code lacks any tests (see the work todos listed in l0_sublevels.go).

@petermattis
Copy link
Collaborator

This change is Reviewable

Copy link
Collaborator Author

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

Only the second commit is relevant. This is very much WIP.

Reviewable status: 0 of 22 files reviewed, all discussions resolved (waiting on @itsbilal and @petermattis)

@petermattis
Copy link
Collaborator

@sumeerbhola I probably won't be able to look at this until next week.

@sumeerbhola sumeerbhola force-pushed the sublevel branch 4 times, most recently from d1f48f6 to af6f1d5 Compare March 11, 2020 19:10
petermattis and others added 3 commits March 11, 2020 16:38
This is a work in progress. We need to plumb knowledge of L0 sublevels
into compaction.
measure stack depth, compaction score, pick L0->Lbase and intra-L0
compactions.

The main construction here (beyond the sub-levels introduced in
of intervals is O(N) where N is the number of files in L0, but
we expect that typically each interval will have a file count that
is sublinear in N. These intervals allow for precisely tracking
the depth and are used as the seed for computing compactions.

This code lacks any tests (see the work todos listed in l0_sublevels.go).
added preliminary testing

Used a MANIFEST with > 600 files and 2GB in L0 from one of the
slow imports. Results from it are summarized as a comment in the
test file.
@sumeerbhola sumeerbhola force-pushed the sublevel branch 4 times, most recently from 2a527ca to 9a982e4 Compare March 13, 2020 00:44
and picking up files in L0 that overlapped with Lbase files that
were not picked. Resulting in two files in Lbase overlapping.
- reduce intra-L0. Lbase and higher levels should be
given priority only if the cost of a high score is high (measured
by currentByteRatios). This mostly eliminated intra-L0.
- not have huge compactions involving L0. Try to cutoff at 500MB
- don't completely starve Lbase: if the score becomes very high
  do them even if it sacrifices L0=>Lbase.
The previous code was generating more wide files than desirable.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 16, 2020
This change introduces L0SubLevels, a data structure to encaptulate
all information to compute L0 Sublevels, flush split keys, and
base / intra-L0 compactions. This data structure will be generated
every time there's a file addition/deletion in L0, the integration
bits will come in future PRs.

The methods to pick base / intra-L0 compactions will come in a
separate PR.

Captures some of the largest code pieces of cockroachdb#563, and effectively
replaces a part of that PR. Sumeer wrote the bulk of this code as
part of his prototype, so thanks Sumeer for his work.

Most of these functions are dead code at the moment, only invoked
by the provided datadriven and non-datadriven tests.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 20, 2020
This change introduces L0SubLevels, a data structure to encaptulate
all information to compute L0 Sublevels, flush split keys, and
base / intra-L0 compactions. This data structure will be generated
every time there's a file addition/deletion in L0, the integration
bits will come in future PRs.

The methods to pick base / intra-L0 compactions will come in a
separate PR.

Captures some of the largest code pieces of cockroachdb#563, and effectively
replaces a part of that PR. Sumeer wrote the bulk of this code as
part of his prototype, so thanks Sumeer for his work.

Most of these functions are dead code at the moment, only invoked
by the provided datadriven and non-datadriven tests.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 21, 2020
This change introduces L0SubLevels, a data structure to encaptulate
all information to compute L0 Sublevels, flush split keys, and
base / intra-L0 compactions. This data structure will be generated
every time there's a file addition/deletion in L0, the integration
bits will come in future PRs.

The methods to pick base / intra-L0 compactions will come in a
separate PR.

Captures some of the largest code pieces of cockroachdb#563, and effectively
replaces a part of that PR. Sumeer wrote the bulk of this code as
part of his prototype, so thanks Sumeer for his work.

Most of these functions are dead code at the moment, only invoked
by the provided datadriven and non-datadriven tests.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 21, 2020
This change introduces L0SubLevels, a data structure to encaptulate
all information to compute L0 Sublevels, flush split keys, and
base / intra-L0 compactions. This data structure will be generated
every time there's a file addition/deletion in L0, the integration
bits will come in future PRs.

The methods to pick base / intra-L0 compactions will come in a
separate PR.

Captures some of the largest code pieces of cockroachdb#563, and effectively
replaces a part of that PR. Sumeer wrote the bulk of this code as
part of his prototype, so thanks Sumeer for his work.

Most of these functions are dead code at the moment, only invoked
by the provided datadriven and non-datadriven tests.
itsbilal added a commit that referenced this pull request Apr 21, 2020
This change introduces L0SubLevels, a data structure to encaptulate
all information to compute L0 Sublevels, flush split keys, and
base / intra-L0 compactions. This data structure will be generated
every time there's a file addition/deletion in L0, the integration
bits will come in future PRs.

The methods to pick base / intra-L0 compactions will come in a
separate PR.

Captures some of the largest code pieces of #563, and effectively
replaces a part of that PR. Sumeer wrote the bulk of this code as
part of his prototype, so thanks Sumeer for his work.

Most of these functions are dead code at the moment, only invoked
by the provided datadriven and non-datadriven tests.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 23, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 27, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 28, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 29, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 30, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Apr 30, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request May 1, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request May 1, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request May 4, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit to itsbilal/pebble that referenced this pull request May 4, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of cockroachdb#563. Thanks Sumeer for his work, most of
this was written by him.
itsbilal added a commit that referenced this pull request May 5, 2020
This change adds methods to L0SubLevels to help pick, score,
and generate L0 -> LBase, and L0 -> L0 compactions, based on
information captured in the data structure about L0 sublevels.

These functions will be called from in compaction.go and
compaction_picker.go in a future change.

Also adds associated datadriven unit tests, and a benchmark.

Covers a large part of #563. Thanks Sumeer for his work, most of
this was written by him.
@petermattis
Copy link
Collaborator

This was taken over by @itsbilal's work.

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.

2 participants