-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid flush too many small sst file (#1003)
## 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
- Loading branch information
1 parent
f8471d2
commit cd2b688
Showing
6 changed files
with
142 additions
and
112 deletions.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.