[sheepdog] [PATCH v2 0/7] add basic raid support

Liu Yuan namei.unix at gmail.com
Mon Mar 11 09:19:26 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

v2:
 - rename raid.c as md.c
 - remove big macro for rmdir_r and purge_directory
 - add md group for tests

This patch set implements the basic multi-disk support that aims to manage 
multiple disks in one node. 

The basic idea of this MD is implement RAID-0 like mechanism that distributes
sheep objects on the local disks without parity or replicating, which instead 
relies on the sheepdog's replicated storage to recover the lost objects on the 
faulty disk.

The md module use a private consistent hash ring per sheep for object
distributing, which allow raid layer completely transparent to sheep node
managent. This means that hot plug/unplug the disk (include faulty disks) to the
local sheep won't cause many object movements between the nodes.

This series just implement basic object distribution control of raid module. The
missing part is internal object recovery between local disks inside the node and
collie command to hot plug/unplug the disk into the sheep daemon, which is meant
to be written by the next series.

To enable raid:
 $ sheep /path/to/meta-store,/path/to/disk1,/path/to/disk2[,...]

We need pass meta-store, which holds sheep's meta information like epoch, config
as the first parameter.

 $ sheep /path/to/store # works the same as before, which doesn't enable raid at all.

Liu Yuan (7):
  md: add dummy md proper
  util: add a helper to purge directory
  sheep, farm: adapt to md support
  sheep: teach stat_sheep to be md friendly
  tests: teach tests to test md feature
  plain: refine init() interface
  tests: add md group to group tests that is md capable

 include/util.h      |    2 +
 lib/util.c          |   28 +++++-
 sheep/Makefile.am   |    4 +-
 sheep/farm/farm.c   |   70 +++++---------
 sheep/farm/trunk.c  |   57 +++++------
 sheep/group.c       |    2 +-
 sheep/md.c          |  269 +++++++++++++++++++++++++++++++++++++++++++++++++++
 sheep/ops.c         |   44 +++------
 sheep/plain_store.c |  147 ++++++++++++----------------
 sheep/sheep.c       |   12 ++-
 sheep/sheep_priv.h  |   22 +++--
 sheep/store.c       |   61 ++++++++----
 tests/check         |    9 ++
 tests/common.rc     |    6 +-
 tests/group         |   91 ++++++++---------
 15 files changed, 551 insertions(+), 273 deletions(-)
 create mode 100644 sheep/md.c

-- 
1.7.9.5




More information about the sheepdog mailing list