mogilefs/MogileFS-Server — pull request #32 by shelling (2013-10-31 07:48:47+00:00)
Title: Add `delete_device` support

### abstract
This patch provides cmd to delete device permanently in `MogileFS::Worker::Query`.

Client-side usage is like following.

my $admin = MogileFS::Admin->new(hosts => ["ip:port"])
$admin->{backend}
->do_request(
"delete_device",
{devid => $devid, host => $hostname}
);

### implementation detail
Actually. this command keeps the primary key `devid` of specified device in TABLE `device`
that prevents reuse of identical `devid`

It moves the `hostid` of specified device to be `0` when `host` id starts from `1`.
Thus, hosts contains no devices can be removed permanently as well.

This patch also prevents any further interactions with deleted devices (`hostid = 0`)
That is, get_all_devices() returns devices with condition `hostid > 0`.

It also validates the specified device contains no file, accepts no incoming file, and is marked as dead,
which prevents deleting of incident and implosion of the cluster.