-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix: avoid flush too many small sst file #1003
Merged
ShiKaiWi
merged 9 commits into
apache:main
from
MichaelLeeHZ:chore-select-maxmutable-memory-to-flush
Jun 27, 2023
Merged
fix: avoid flush too many small sst file #1003
ShiKaiWi
merged 9 commits into
apache:main
from
MichaelLeeHZ:chore-select-maxmutable-memory-to-flush
Jun 27, 2023
Conversation
This file contains 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
MichaelLeeHZ
changed the title
Chore: select max mutable memory usage table to flush
fix: select max mutable memory usage table to flush
Jun 19, 2023
ShiKaiWi
reviewed
Jun 20, 2023
ShiKaiWi
reviewed
Jun 20, 2023
MichaelLeeHZ
changed the title
fix: select max mutable memory usage table to flush
fix: avoid flush too many sst file
Jun 20, 2023
MichaelLeeHZ
changed the title
fix: avoid flush too many sst file
fix: avoid flush too many small sst file
Jun 20, 2023
ShiKaiWi
approved these changes
Jun 27, 2023
dust1
pushed a commit
to dust1/ceresdb
that referenced
this pull request
Aug 9, 2023
## Rationale Currently, we attempt to flush the table that consumes the maximum memory when the system memory usage limit is reached for either `space_write_buffer_size` or `db_write_buffer_size`. However, if the target table is currently undergoing flushing, its memory usage will not be released, causing the `preprocess_flush` (freeze small memtables) function to be repeatedly triggered. This can result in the creation of many small SST files, potentially causing query issues. ## Detailed Changes * Move `preprocess_flush` into `flush_job` * Split `swith_memtables_or_suggest_duration` into 2 methods, and make `swith_memtables` return maxium sequence number. ## Test Plan
Merged
tanruixiang
pushed a commit
that referenced
this pull request
Dec 21, 2023
## Rationale #1003 tries to avoid frequent flush requests which may generate massive small ssts, but the write stall is also removed in the normal write path. ## Detailed Changes Introduce the `min_flush_interval` to avoid frequent flush requests and recover the write stall mechanism. ## Test Plan Add unit tests for the frequent flush check.
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.
Rationale
Currently, we attempt to flush the table that consumes the maximum memory when the system memory usage limit is reached for either
space_write_buffer_size
ordb_write_buffer_size
. However, if the target table is currently undergoing flushing, its memory usage will not be released, causing thepreprocess_flush
(freeze small memtables) function to be repeatedly triggered. This can result in the creation of many small SST files, potentially causing query issues.Detailed Changes
preprocess_flush
intoflush_job
swith_memtables_or_suggest_duration
into 2 methods, and makeswith_memtables
return maxium sequence number.Test Plan