Skip to content

Commit

Permalink
rewrite: optimize the interval of sync when rewriting memtables. (#347
Browse files Browse the repository at this point in the history
)) (#349)

* [cherry-pick] rewrite: optimize the interval of `sync` when rewriting memtables. (#347)

In a cloud environment, refraining from unscheduling sync operations
when rewriting memtables might result in an accumulation of unsynced bytes
in the buffer. This accumulation has the potential to impede the foreground
write progress during sync.

This pull request introduces periodic sync operations when the amount of
stashed unsynced bytes exceeds a predefined threshold. This optimization
aims to address the issue and enhance performance.

Signed-off-by: lucasliang <[email protected]>
  • Loading branch information
LykxSassinator authored Jan 11, 2024
1 parent 39f4db4 commit 895ca93
Show file tree
Hide file tree
Showing 8 changed files with 2,359 additions and 51 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ jobs:
sharedKey: ${{ matrix.os }}
- name: Cache dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install --locked grcov --version 0.8.9; fi
- name: Format
run: |
make format
git diff --exit-code
- name: Clippy
run: make clippy
env:
EXTRA_CARGO_ARGS: '--fix'
- name: Run tests
run: make test
env:
Expand All @@ -60,7 +62,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.61.0
toolchain: 1.63.0
override: true
components: rustfmt, clippy, rust-src
- uses: Swatinem/rust-cache@v1
Expand Down Expand Up @@ -94,7 +96,7 @@ jobs:
with:
sharedKey: ubuntu-latest
- name: Install grcov
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install --locked grcov; fi
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install --locked grcov --version 0.8.9; fi
- name: Run tests
run: |
make test
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## File system
.DS_Store
Cargo.lock
##Cargo.lock

## Build
/target
Expand Down
Loading

0 comments on commit 895ca93

Please sign in to comment.