sheep: reanme {set, get}_cluster_space as _node_space

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests: use mkfs.ext4 only for _make_device

This is a preparation patch for 'remove -s option'. After '-s' is removed,
since every file system has its own metadata allocation mechanism, so we can't
use different file system to get the same size after formatting.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: remove '-s' option

We use '-s' option as a hint of weighting. This actually doesn's stop sheep from
using extar space that '-s' specifies. Ask users to give weight hint is
nonsense if we can weight the node transparently.

'-s' would be meaningless too when we add reweight support.

This is a prepare patch for reweight patch.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: fix 'node info'

Always return the actual size instead of from sys->disk_space

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: fix 'md info'

Show the output format as 'node info'

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: show available command only for subcommand

The new help usage tips would be:

yliu@K55VM-ubuntu:~/sheepdog$ collie/collie cluster
Available cluster commands:
  cluster info
  cluster format
  cluster shutdown
  cluster snapshot
  cluster recover

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
recovery: don't assume old_epoch is sys->eopch - 1

When md recovery happens, old_epoch == sys->epoch

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: add 'cluster reweight' support

usage:
$ colloe cluster reweight'

This command is used to recalculate the vnodes of all the nodes of the cluster
when size of some nodes changes (for e.g, after plug/unplug) and users expect
to rebalance data manually.

The rationale for reweighting instead of auto-reweighting for every plug/unplug
event is that, people don't want plug/unplug or disk crashes in one node put the
the whole cluster in recovery. Instead, people can do manual reweighting at
their will because md event doesn't degrade the data reliability or availibility.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
recovery: don't notify completion for md recovery

If we do, stale objects will be removed before the recovery, that goes after the
md recovery, tries to recovery objects from other nodes.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests: add 063 to test reweight

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests: test node failure while reweighting

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>