-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(db): Fix root cause of RocksDB misbehavior (#301)
# What ❔ Fixes (hopefully) the root cause of recent RocksDB misbehavior. After recent refactoring, it improperly cancels background compactions / flushes each time a `RocksDB` instance is dropped, which leads to compactions / flushes being constantly interrupted. (After refactoring, `RocksDB` instances are `Clone`eable and act essentially as `Arc` wrappers; a new instance is created and dropped, in particular, [when processing](https://github.com/matter-labs/zksync-era/blob/ec41692063909742005acd656694a8f0838fcf33/core/lib/zksync_core/src/metadata_calculator/updater.rs#L385) each chunk of L1 batches.) A proper solution, implemented by this PR, is to cancel background work when dropping an internal, non-`Arc`'d DB instance. ## Why ❔ That's a bug that makes RocksDB behave *very* unstably, as witnessed by recent issues with it. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Code has been formatted via `zk fmt` and `zk lint`. --------- Co-authored-by: Igor Borodin <[email protected]>
- Loading branch information
1 parent
c1f2f5e
commit d6c30ab
Showing
2 changed files
with
39 additions
and
11 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