Repository navigation
kv/RocksDBStore: Add minimum key limit before invoking DeleteRange. - #31442
Merged
Merged
Conversation
Member
|
How is the behavior with objects with >1024 keys? |
liewegas
reviewed
Nov 7, 2019
Member
There was a problem hiding this comment.
this is just twiddling the in-memory transaction/WriteBatch, right? it's not creating a snapshot view on the db?
Member
|
credit @Aran85 in the commit message? |
liewegas
approved these changes
Nov 7, 2019
Co-authored-by: Zengran Zhang [email protected] Signed-off-by: Mark Nelson <[email protected]>
markhpc
force-pushed
the
wip-rocksdb-deleterange-keys
branch
from
November 7, 2019 17:31
bad2ae4 to
b493e96
Compare
Member
Author
neha-ojha
added a commit
to neha-ojha/ceph
that referenced
this pull request
Nov 14, 2019
This reverts commit 29bafe5. We have observed drastically poor performance when rocksdb_rmrange is used for every key deletion. This change is specific to nautilus, since we are experimenting with rocksdb_rmrange along with ceph#31442 in master. Signed-off-by: Neha Ojha <[email protected]>
liewegas
added a commit
that referenced
this pull request
Dec 2, 2019
* refs/pull/31442/head: kv/RocksDBStore: Add minimum key limit before invoking DeleteRange. Reviewed-by: Sage Weil <[email protected]> Reviewed-by: Casey Bodley <[email protected]>
alfonsomthd
pushed a commit
to rhcs-dashboard/ceph
that referenced
this pull request
Dec 13, 2019
This reverts commit 29bafe5. We have observed drastically poor performance when rocksdb_rmrange is used for every key deletion. This change is specific to nautilus, since we are experimenting with rocksdb_rmrange along with ceph#31442 in master. Signed-off-by: Neha Ojha <[email protected]> (cherry picked from commit 8758697) Resolves: rhbz#1773137
Contributor
|
nautilus backport - #30949 |
Member
|
Hi @markhpc - Can the bench described in this PR still be valid for testing https://tracker.ceph.com/issues/70108? |
This file contains hidden or 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
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.
This is a spiritual resurrection of #27317 after the changes were reverted in #15183. It turns out that DeleteRange is still incredibly problematic. Multiple range tombstones will very quickly fragment RocksDB's memtables leading to exceptionally bad RocksDB performance and ultimately extremely slow and resource intensive OSDs. This PR works the same way as #27317 by creating a threshold where N (1024 by default) keys must be deleted at once before DeleteRange is invoked.
An easy to reproduce test that showcases this behavior is to create 10000 RGW buckets, then immediately delete them. Optionally a subsequent workload can be immediately invoked to showcase that performance continues to suffer in general until a memtable flush is invoked.
Creating 10000 buckets is relatively fast in both cases...
...However deleting 10000 buckets is roughly 67 times slower when DeleteRange is used... (Note: this is across multiple DeleteRange calls rather than a single call based on bucket deletion works)
...Worse, after many RangeTombstones are placed in the memtable subsequent operations are also slow until the memtable is flushed. Creating 10000 new buckets in master is now 144 times slower...
...And even worse, the OSD will consume massive amounts of CPU when this is happening. Deleting 10000 buckets used ~10 cores for 675 seconds on master and ~2-3 cores for 9 seconds with this PR applied. The reason for this is that DeleteRange induced fragmentation in the memtables causes a huge amount of iterator overhead as can be seen by a wallclock profile of the TP_OSD_TP threads:
This PR fixes the current issue by essentially never or rarely invoking DeleteRange. If we start using it more often again in the future (say by regularly deleting >1024 keys at once) we will also need to flush the memtables after concurrent DeleteRange calls to avoid fragmentation.
Signed-off-by: Mark Nelson [email protected]
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard backendjenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox