Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delete_device support #32

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

shelling
Copy link

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.

@shelling
Copy link
Author

shelling commented Nov 1, 2013

@dormando hello, any comment or recommendation for this pull request? thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant