Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Support for building RocksDB plugins and custom file systems#1160

Open
yhr wants to merge 2 commits into
facebook:fb-mysql-8.0.17from
yhr:pluggable_filesystems-fb-mysql-8.0
Open

Support for building RocksDB plugins and custom file systems#1160
yhr wants to merge 2 commits into
facebook:fb-mysql-8.0.17from
yhr:pluggable_filesystems-fb-mysql-8.0

Conversation

@yhr

@yhr yhr commented Feb 18, 2021

Copy link
Copy Markdown

RocksDB now supports building plugins from external repos (facebook/rocksdb#7918) and this pull request adds the needed cmake magic to include these in myrocks builds. The plugins to include are specified by ROCKSDB_PLUGINS:

git clone https://github.com/ajkr/dedupfs rocksdb/plugin/dedupfs
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=system -DWITH_ZLIB=bundled\
DMYSQL_MAINTAINER_MODE=0 -DENABLED_LOCAL_INFILE=1 -DCMAKE_CXX_FLAGS="-march=native" \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DROCKSDB_PLUGINS=dedupfs

Note: as this branch is not yet including the above pull request, the plugin directory does not exist, but can be created manually and the above example will work.

A configuration parameter, rocksdb_fs_uri is also added to allow the user to specify custom file systems.

rocksdb_fs_uri=dedupfs

These two changes allows external file systems to be included and used in myrocks. I've tested using dedupfs and a custom filesystem that i've developed for zoned block devices: zenfs.

Summary:

Add support for specifying custom RocksDB file system implementations
through the parameter rocksdb_fs_uri.

Examples:
    rocksdb_fs_uri=zenfs://dev:nvme0n1
    rocksdb_fs_uri=posix://

Custom file systems may be built as plugins in rocksdb and can be
created through a factory function that will be looked up by the
object registry. The posix file system is built in.
@yhr

yhr commented Feb 18, 2021

Copy link
Copy Markdown
Author

@yizhang82 : could you have a look at this? Andrew Kryczka mentioned that you have been part of the plugin discussions.
I've also submitted a PR for 5.6, see #1159
Cheers!

Summary:

RocksDB supports external plugin projects in plugins/ enabling
e.g. custom file system implementations.

Add support for building RocksDB plugins by including the plugins
listed in ROCKSDB_PLUGINS into the cmake build.
@yhr yhr force-pushed the pluggable_filesystems-fb-mysql-8.0 branch from 59ab2dd to 9ff6e1f Compare March 2, 2021 09:04
@yhr

yhr commented Mar 2, 2021

Copy link
Copy Markdown
Author

Pushed a small update, aligning with the rocksdb makefile build: allowing plugin makefile to be called anything, as long as it has the extension .mk

@ajkr ajkr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @yizhang82 - this should work with RocksDB 6.18.0 and later

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

4 participants