{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/2878","repository_url":"https://api.github.com/repos/zfsonlinux/zfs","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/2878/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/2878/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/2878/events","html_url":"https://github.com/zfsonlinux/zfs/issues/2878","id":48078750,"number":2878,"title":"zpool destroy fails on zpool with suspended IO","user":{"login":"kiranfractal","id":8971831,"avatar_url":"https://avatars.githubusercontent.com/u/8971831?v=3","gravatar_id":"","url":"https://api.github.com/users/kiranfractal","html_url":"https://github.com/kiranfractal","followers_url":"https://api.github.com/users/kiranfractal/followers","following_url":"https://api.github.com/users/kiranfractal/following{/other_user}","gists_url":"https://api.github.com/users/kiranfractal/gists{/gist_id}","starred_url":"https://api.github.com/users/kiranfractal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiranfractal/subscriptions","organizations_url":"https://api.github.com/users/kiranfractal/orgs","repos_url":"https://api.github.com/users/kiranfractal/repos","events_url":"https://api.github.com/users/kiranfractal/events{/privacy}","received_events_url":"https://api.github.com/users/kiranfractal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zfsonlinux/zfs/labels/Bug%20-%20Minor","name":"Bug - Minor","color":"e11d21"},{"url":"https://api.github.com/repos/zfsonlinux/zfs/labels/Difficulty%20-%20Medium","name":"Difficulty - Medium","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/zfsonlinux/zfs/milestones/11","html_url":"https://github.com/zfsonlinux/zfs/milestones/0.7.0","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/milestones/11/labels","id":7013,"number":11,"title":"0.7.0","description":"ZFS on Linux v0.7.0 - Memory management\r\n\r\n","creator":{"login":"behlendorf","id":148917,"avatar_url":"https://avatars.githubusercontent.com/u/148917?v=3","gravatar_id":"","url":"https://api.github.com/users/behlendorf","html_url":"https://github.com/behlendorf","followers_url":"https://api.github.com/users/behlendorf/followers","following_url":"https://api.github.com/users/behlendorf/following{/other_user}","gists_url":"https://api.github.com/users/behlendorf/gists{/gist_id}","starred_url":"https://api.github.com/users/behlendorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behlendorf/subscriptions","organizations_url":"https://api.github.com/users/behlendorf/orgs","repos_url":"https://api.github.com/users/behlendorf/repos","events_url":"https://api.github.com/users/behlendorf/events{/privacy}","received_events_url":"https://api.github.com/users/behlendorf/received_events","type":"User","site_admin":false},"open_issues":66,"closed_issues":193,"state":"open","created_at":"2011-05-03T17:38:46Z","updated_at":"2016-04-12T17:11:06Z","due_on":null,"closed_at":null},"comments":24,"created_at":"2014-11-07T12:54:52Z","updated_at":"2016-04-18T07:26:39Z","closed_at":null,"body":"Hi,\r\n\r\nI am trying disk replacement from a single disk zpool and it results to suspended IO and does not allow me to destroy the zpool.\r\n\r\nSteps to reproduce:\r\n-------------------------\r\n1. create a zpool with single disk (zpool create zp1 /dev/sda)\r\n2. remove the disk \r\n3. zpool status shows disk unavailable\r\n4. insert a new disk\r\n5. zpool replace zp1 /dev/sda /dev/sdb\r\n6. it says \"cannot replace /dev/sda with /dev/sdb : pool I/O is currently suspended\"\r\n\r\nThe above steps holds good for zpool destroy as well.\r\n\r\nNow the zpool is unusable and only option for me to destroy zpool is to reboot the system and destroy the old pool and create a new pool.\r\n\r\nIs there any other option can I try so that I can replace the disk without rebooting the system ?\r\n\r\nThanks,\r\nKiran.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/211242166","html_url":"https://github.com/zfsonlinux/zfs/issues/2878#issuecomment-211242166","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/2878","id":211242166,"user":{"login":"GregorKopka","id":1021594,"avatar_url":"https://avatars.githubusercontent.com/u/1021594?v=3","gravatar_id":"","url":"https://api.github.com/users/GregorKopka","html_url":"https://github.com/GregorKopka","followers_url":"https://api.github.com/users/GregorKopka/followers","following_url":"https://api.github.com/users/GregorKopka/following{/other_user}","gists_url":"https://api.github.com/users/GregorKopka/gists{/gist_id}","starred_url":"https://api.github.com/users/GregorKopka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GregorKopka/subscriptions","organizations_url":"https://api.github.com/users/GregorKopka/orgs","repos_url":"https://api.github.com/users/GregorKopka/repos","events_url":"https://api.github.com/users/GregorKopka/events{/privacy}","received_events_url":"https://api.github.com/users/GregorKopka/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T07:26:39Z","updated_at":"2016-04-18T07:26:39Z","body":"> Let me ask an opened ended question. For a pool which is suspended what would you expect the\r\n> following behavior to be for the following commands. Where -f mean force and -F means hardforce.\r\n\r\n> 1.  zpool export|destroy < pool >\r\n\r\nApplication: \r\nNormally working pool\r\n\r\nFunction:\r\nWork as-is\r\nAlways fail with a sane error message (for whatever reason) instead of getting stuck\r\n\r\n> 2.  zpool export|destroy -f < pool >\r\n\r\nApplication:\r\nProblems with upper layers (locks from applications etc)\r\n\r\nFunction:\r\nExecute 1, in case of error invalidate all open file handles to pool datasets and terminate all in-flight I/O on them with I/O errors, detach them from the datasets, sync, then re-execute 1 to now being able to unmount the datasets. The now stale file handles need to be held by zfs until closed so the file handle interface to the upper layer dosn't get into undefined state.\r\nAlways fail with a sane error message (for whatever reason) instead of getting stuck\r\n\r\n> 3.  zpool export|destroy -F < pool >\r\n\r\nApplication:\r\nProblems with lower layer (disk failures//hang/missing, suspended pool)\r\n\r\nFunction:\r\nExecute 2, in case of error invalidate and terminate all outstanding I/O to all pool vdevs, drop all buffers of pool (dirty or not), invalidate and free all data structures associated with the pool (except any dangling stale file handles from 2 which need to be kept till the applications close them), in case of destroy an suspended pool: skip the destroy part (since pool members can't be written to)\r\nAlways return succesfully and complete, never get stuck."}}