{"action":"opened","issue":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/4682","labels_url":"https://api.github.com/repos/influxdb/influxdb/issues/4682/labels{/name}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/4682/comments","events_url":"https://api.github.com/repos/influxdb/influxdb/issues/4682/events","html_url":"https://github.com/influxdb/influxdb/issues/4682","id":115373330,"number":4682,"title":"[feature request] ADD / DROP SHARD","user":{"login":"dgnorton","id":209347,"avatar_url":"https://avatars.githubusercontent.com/u/209347?v=3","gravatar_id":"","url":"https://api.github.com/users/dgnorton","html_url":"https://github.com/dgnorton","followers_url":"https://api.github.com/users/dgnorton/followers","following_url":"https://api.github.com/users/dgnorton/following{/other_user}","gists_url":"https://api.github.com/users/dgnorton/gists{/gist_id}","starred_url":"https://api.github.com/users/dgnorton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgnorton/subscriptions","organizations_url":"https://api.github.com/users/dgnorton/orgs","repos_url":"https://api.github.com/users/dgnorton/repos","events_url":"https://api.github.com/users/dgnorton/events{/privacy}","received_events_url":"https://api.github.com/users/dgnorton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-05T21:01:00Z","updated_at":"2015-11-05T21:01:00Z","closed_at":null,"body":"Occasionally, the need arises to perform low-level shard operations such as adding / dropping a shard and listing dropped (orphaned) shards.\r\n\r\n* New DROP SHARD query that would remove a shard from the RP but not delete the file from disk.  This would turn it into an orphaned shard.  The data is still intact on disk but no longer accessible by a SELECT query.\r\n\r\n* New ADD SHARD query for adding an existing shard.  It would have to verify that the time range of the data in the shard file matched the RP it was being added to.  Not exactly sure what that syntax would look like.  Maybe...\r\n```\r\nADD SHARD mydb.someRP.234\r\n```\r\nwould add ~/.influxdb/data/mydb/someRP/234 back to someRP.  Or,\r\n```\r\nADD SHARD mydb.someRP.234 TO mydb.otherRP\r\n```\r\nwhich would move the file to the otherRP directory and add it to that RP.\r\n\r\n* Modify SHOW SHARDS to list orphaned shards and possibly allow filtering by owners and date / time ranges.  Currently, it just looks through RPs and their shard groups to find all the shards.  This change would require it to also look on disk for shards the metastore doesn't know about and it would have to examine the data in those shards to find the period of time covered.\r\n"}}