-
Notifications
You must be signed in to change notification settings - Fork 62
Development Processes
This document describes two things:
-
First, check out the relevant repos:
-
Create a symlink for
jemalloc
and buildft-index
. We want to "install" the result somewhere.-
For a debug build:
cd ft-index ln -s $PWD/../jemalloc third_party/ mkdir dbg cd dbg cmake \ -D CMAKE_BUILD_TYPE=Debug \ -D USE_VALGRIND=ON \ -D TOKU_DEBUG_PARANOID=ON \ -D BUILD_TESTING=OFF \ -D CMAKE_INSTALL_PREFIX=$PWD/install \ .. make install
-
For a release build:
cd ft-index ln -s $PWD/../jemalloc third_party/ mkdir opt cd opt cmake \ -D CMAKE_BUILD_TYPE=Release \ -D USE_VALGRIND=OFF \ -D TOKU_DEBUG_PARANOID=OFF \ -D BUILD_TESTING=OFF \ -D CMAKE_INSTALL_PREFIX=$PWD/install \ .. make install
-
-
Next, make a symlink from inside the
tokumxse
repo to the "install directory" where the builtft-index
libs live:-
For a debug build:
cd tokumxse ln -s $PWD/../ft-index/dbg/install src/third_party/tokuft
-
For a release build:
cd tokumxse ln -s $PWD/../ft-index/opt/install src/third_party/tokuft
-
-
Finally, invoke
scons
with the magic options:scons --extrapath=$PWD/src/third_party/tokuft --tokuft --allocator=jemalloc mongod mongos mongo
If you like, you can add
--dbg=[on|off] --opt=[on|off]
or-jN
toscons
.--mute
is also quite nice. -
You can run some C++ unit tests with scons:
scons --extrapath=$PWD/src/third_party/tokuft --tokuft --allocator=jemalloc smokeCppUnittests
-
You can also run some javascript tests with
smoke.py
oncemongod
,mongos
, andmongo
are built:python buildscripts/smoke.py --storageEngine=tokuft jsCore
Apart from
jsCore
you can also run other suites, refer to this map for all of them.
Upstream MongoDB manages multi-version development by maintaining separate branches for each stable minor version (v2.4
, v2.6
, v3.0
), as well as an active development branch (master
), and they cherry-pick
any changes that need to hit multiple branches. We do the same for master
and v3.0
. About once a day, check for upstream changes (on branches master
and v3.0
), and if there are some, go ahead and merge them to tokumxse
:
-
If you haven't set it up already, create an
upstream
remote in your git checkout oftokumxse
:git remote add upstream https://github.com/mongodb/mongo
-
Fetch new commits from upstream:
git fetch upstream
-
Make sure your
master
andv3.0
branches are up to date:git checkout master git pull git checkout v3.0 git pull
-
Into each branch, merge the corresponding upstream branch:
git checkout master git merge upstream/master git checkout v3.0 git merge upstream/v3.0
-
Try building. If they've removed or added part of the API, you should notice with a failed compile. You can also watch the
src/mongo/db/storage
directory for interesting looking changes that might break things.Additionally, there's a mechanism that makes sure that the "assert ids" are unique. You may see a build fail with a message like this:
DUPLICATE IDS: 28610 ./src/mongo/db/storage/tokuft/tokuft_init.cpp:75:fassertFailedNoTrace(28610); ./src/mongo/db/repl/replication_coordinator_impl.cpp:2275:fassert(28610, cbh.getStatus()); next id to use:28620
In this case, this means that upstream, they've added a new assert id that conflicts with one we had already. To avoid conflicts, we should change ours, so in the above example, you'd go to
tokuft_init.cpp
and change28610
to28620
. Then commit the change on eithermaster
orv3.0
, and make sure you cherry-pick it to the other branch as well. For example, this particular conflict was fixed by this commit onmaster
and this commit onv3.0
.