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

Manually trigger major compaction #3882

Closed
v0y4g3r opened this issue May 8, 2024 · 0 comments · Fixed by #3988
Closed

Manually trigger major compaction #3882

v0y4g3r opened this issue May 8, 2024 · 0 comments · Fixed by #3988
Assignees
Labels
A-compaction Involves compaction related components help wanted Extra attention is needed

Comments

@v0y4g3r
Copy link
Contributor

v0y4g3r commented May 8, 2024

What problem does the new feature solve?

Currently GrepgtimeDB supports triggering compaction using SELECT COMPACT_TABLE, but this statement only triggers regular compaction that assigns SSTs into windows and compact those files inside same window together to alleviate the overhead of compactions. We also need to support more compaction strategies when it's manually triggered so that we can enforce a more efficient data layout.

What does the feature do?

Adds options to SELECT COMPACT_TABLE statements so that we can trigger major compactions using strategies like:

  • merge all SST files in some time range into one single file
  • split SST files strictly by time windows
    • the time window can be inferred from level 0 files or manually specified

We can start with the easy one which splits SST files according to time windows
The syntax would be like:

SELECT COMPACT_TABLE(some_table, type="strict_window");

Before the compaction, suppose the data layout is:
image

We can find that these 3 files overlaps with each other.

And we expect the compaction output is like (given time window is 50):

image

Implementation challenges

We have to accommodate different compaction startegies in current compaction framework and reuse the scheduling and IO component.

@v0y4g3r v0y4g3r added help wanted Extra attention is needed Difficulty: Mid A-compaction Involves compaction related components labels May 8, 2024
@v0y4g3r v0y4g3r self-assigned this May 8, 2024
@v0y4g3r v0y4g3r mentioned this issue May 20, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compaction Involves compaction related components help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants