-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: force snapshot under memory pressure
- The main change is to detach wal and snapshot, in a way all 3 of the following things can happen - flush the wal buffer only (already handled, before this commit) - flush wal buffer and snapshot (already handled, before this commit) - snapshot without flushing wal buffer (introduced in this commit) This is achieved by introducing another method `snapshot` in `WalFileNotifier` trait. The main dependency between wal and snapshot is the `wal_file_number`, since this is tracked in `SnapshotTracker` separately we can switch to using `SnapshotTracker`'s `last_wal_file_number` instead of the one that comes through the `WalContents`. - A higher level background loop is introduced that checks the overall table buffer size every `N` seconds and if it is greater than a threshold (`X`) then it calls `snapshot` method. Both `N` and `X` are configurable through cli. `N` defaults to 10s and `X` defaults to 70% - Some refactoring of code so that existing methods can be reused when only snapshotting closes: #25685
- Loading branch information
1 parent
0cb00d8
commit d842d86
Showing
9 changed files
with
537 additions
and
203 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.