]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Improve MemPurge sampling (#8656)
authorBaptiste Lemaire <blemaire@fb.com>
Fri, 13 Aug 2021 21:34:43 +0000 (14:34 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 13 Aug 2021 21:35:41 +0000 (14:35 -0700)
commite51be2c5a1ea66f2e79ef10f7d43b9338c0a7ef1
tree6bca48ffcbb7e7d672e9e2f18431f3cd30b3824e
parent74a652a45ff63350640245ba7994bebc748bb0d4
Improve MemPurge sampling (#8656)

Summary:
Previously, the `MemPurge` sampling function was assessing whether a random entry from a memtable was garbage or not by simply querying the given memtable (see https://github.com/facebook/rocksdb/issues/8628 for more details).
In this diff, I am updating the sampling function by querying not only the memtable the entry was drawn from, but also all subsequent memtables that have a greater memtable ID.
I also added the size of the value for KV entries in the payload/useful payload estimates (which was also one of the reasons why sampling was not as good as mempurging all the time in terms of L0 SST files reduction).
Once these changes were made, I was able to clean obsolete objects and functions from the `MemtableList` struct, and did a bit of cleanup everywhere.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8656

Reviewed By: pdillinger

Differential Revision: D30288583

Pulled By: bjlemaire

fbshipit-source-id: 7646a545ec56f4715949daa59ab5eee74540feb3
db/flush_job.cc
db/flush_job.h
db/memtable_list.cc
db/memtable_list.h
include/rocksdb/memtablerep.h
memtable/skiplistrep.cc