feat: implement STCS compaction#430
Open
dkharms wants to merge 2 commits into
Open
Conversation
forshev
approved these changes
Jun 5, 2026
| fracManagerStop func() | ||
|
|
||
| SkipMaskManager *skipmaskmanager.SkipMaskManager | ||
| Executor *compaction.Executor |
Collaborator
There was a problem hiding this comment.
nit: maybe rename Executor field to something associated with compaction? like CompactionExecutor or Compactor
| zap.Strings("names", names), | ||
| ) | ||
|
|
||
| preloaded, err := Merge(t.filename, common.SealParams{}, srcs...) |
Collaborator
There was a problem hiding this comment.
nit: should seal params be empty here?
|
|
||
| "go.uber.org/zap" | ||
|
|
||
| "github.com/alecthomas/units" |
d3e1c9e to
0f1955e
Compare
dkharms
commented
Jun 11, 2026
| @@ -115,6 +118,8 @@ func (fp *fractionProvider) NewRemote(ctx context.Context, name string, cachedIn | |||
| // IMPORTANT: This method is not thread-safe. When used in concurrent environments, | |||
Member
Author
There was a problem hiding this comment.
I need to remove the comment.
dkharms
commented
Jun 11, 2026
| } | ||
|
|
||
| func (s *IndexWriter) newIndexBlockZSTD(raw []byte, level int) indexBlock { | ||
| if level <= 0 { |
Member
Author
There was a problem hiding this comment.
ZSTD can have negative compression levels -- need to handle it correctly.
dkharms
commented
Jun 11, 2026
| DocBlockZstdCompressionLevel int `config:"doc_block_zstd_compression_level" default:"3"` | ||
| } `config:"compression"` | ||
|
|
||
| Compaction struct { |
Member
Author
There was a problem hiding this comment.
Add comments here and introduce new compaction section in the documentation as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a STCS (Size-Tiered Compaction Strategy) planner that groups sealed fractions into time-bins and selects compaction candidates, and an executor that merges them into a new sealed fraction via k-way merge.
If you have used LLM/AI assistance please provide model name and full prompt: