Skip to content

Conversation

@yhr
Copy link

@yhr yhr commented Feb 18, 2021

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
Copy link
Author

yhr commented Feb 18, 2021

@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
Copy link
Author

yhr commented Mar 2, 2021

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

Copy link
Contributor

@ajkr ajkr left a comment

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 join this conversation on GitHub. Already have an account? Sign in to comment

4 participants