Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
Herman Lee edited this page Sep 15, 2015 · 5 revisions

Attention

MySQL on RocksDB was merged into Facebook public branch. The work is continuing here: https://github.com/facebook/mysql-5.6/ Clone it to get the latest version, don't use MySQLOnRocksDB repo anymore.

Switching from MyRocks to Facebook Repository

Rename the current origin repository to myrocks. The default upstream server for git is typically named origin.

git remote rename origin myrocks

Pull in the facebook/mysql-5.6 repository.

For ssh access, run:

git remote add -f origin git@github.com:facebook/mysql-5.6.git

For http access, run:

git remote add -f origin https://github.com/facebook/mysql-5.6.git

Verify you have both myrocks and origin

git remote -v

The output should look something like:

myrocks	git@github.com:MySQLOnRocksDB/mysql-5.6.git (fetch)
myrocks	git@github.com:MySQLOnRocksDB/mysql-5.6.git (push)
origin	git@github.com:facebook/mysql-5.6.git (fetch)
origin	git@github.com:facebook/mysql-5.6.git (push)

Update origin to date

git fetch origin

Cherry-picking changes

Checkout the facebook/mysql-5.6 tree. Feel free to replace fb-webscalesql-5.6.24.97 with a name of your choice:

git checkout -b fb-webscalesql-5.6.24.97 origin/webscalesql-5.6.24.97

Then cherry-pick changes from the old branch to the new branch (fb-webscalesql-5.6.24.97)

git checkout fb-webscalesql-5.6.24.97
git cherry-pick <old_branch>

Remove the old respository

git remote remove myrocks

Overview

This describes how to build and contribute to the MySQL storage engine for RocksDB. The engine is an integration layer to get RocksDB working with MySQL. A lot of the work was done by SkySQL and based on LevelDB and upstream MySQL. The version of MySQL used here is a fork of Facebook's MySQL repo.

Building MySQL + RocksDB

The following steps can be used to build a branch of MySQL with the latest RocksDB-SE support.

First, check out the repo and tools directories:

git clone https://github.com/MySQLOnRocksDB/mysql-5.6.git

Now we need to retrieve the source for the rocksdb folder:

git submodule update --init

And now we can build using CMake:

mkdir bld
cd bld
cmake .. -DMYSQL_MAINTAINER_MODE=1 -DBUILD_CONFIG=mysql_release
make

For more detailed build instructions, check out the official wiki.

Updating

To update the MySQL repo:

git pull --rebase

Note that this will NOT update the rocksdb subfolder. If you want to fast-forward to the latest version of rocksdb:

git submodule update

When you commit a new MySQL diff, it will also save the checksum of the version of rocksdb it was compiled against, guaranteeing that the two will stay in sync.

Contributing Diffs

Diffs in the MySQL codebase can be written as normal. Code reviews should be done using Phabricator, and diffs will appear on reviews.facebook.net. Make sure you have Arcanist installed.

arc diff

When a diff is accepted, land it using arc amend / git push:

arc amend
git checkout master
git rebase mybranch
git push
git branch -d mybranch