{"action":"opened","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4727","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4727/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4727/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4727/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/4727","id":102010407,"number":4727,"title":"Creating a table in a database that is being deleted leaves an orphaned table","user":{"login":"Tryneus","id":552910,"avatar_url":"https://avatars.githubusercontent.com/u/552910?v=3","gravatar_id":"","url":"https://api.github.com/users/Tryneus","html_url":"https://github.com/Tryneus","followers_url":"https://api.github.com/users/Tryneus/followers","following_url":"https://api.github.com/users/Tryneus/following{/other_user}","gists_url":"https://api.github.com/users/Tryneus/gists{/gist_id}","starred_url":"https://api.github.com/users/Tryneus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tryneus/subscriptions","organizations_url":"https://api.github.com/users/Tryneus/orgs","repos_url":"https://api.github.com/users/Tryneus/repos","events_url":"https://api.github.com/users/Tryneus/events{/privacy}","received_events_url":"https://api.github.com/users/Tryneus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-19T22:10:16Z","updated_at":"2015-08-19T22:10:16Z","closed_at":null,"body":"I wrote a script that created many tables in a database, then deleted the database while other processes were still creating tables in the database.  There is a relatively large window during database deletion for new tables to be successfully created.\r\n\r\nThese tables will show up in the web UI's stats, but will not be visible in the `Tables` tab, and the only way to see them is through the ReQL admin interface (i.e. `rethinkdb.table_config` and `rethinkdb.table_status`).  The tables can still be dropped or moved to a live database by writing to their rows in the `rethinkdb.table_config` table.\r\n\r\nExample rows for such an orphaned table:\r\n`rethinkdb.table_config`:\r\n```json\r\n{\r\n  \"db\":  \"__deleted_database__\",\r\n  \"durability\":  \"hard\",\r\n  \"id\":  \"1c3df91b-9676-4feb-9c61-f2afaa8a3e1e\",\r\n  \"indexes\": [ ],\r\n  \"name\":  \"99\",\r\n  \"primary_key\":  \"id\",\r\n  \"shards\": [ {\r\n    \"nonvoting_replicas\": [ ],\r\n    \"primary_replica\":  \"newton_jcf\",\r\n    \"replicas\": [ \"newton_jcf\" ]\r\n  } ],\r\n  \"write_acks\":  \"majority\"\r\n}\r\n```\r\n\r\n`rethinkdb.table_status`:\r\n```json\r\n{\r\n  \"db\":  \"__deleted_database__\",\r\n  \"id\":  \"1c3df91b-9676-4feb-9c61-f2afaa8a3e1e\",\r\n  \"name\":  \"99\",\r\n  \"shards\": [ {\r\n    \"primary_replicas\": [ \"newton_jcf\" ],\r\n    \"replicas\": [ {\r\n      \"server\":  \"newton_jcf\",\r\n      \"state\":  \"ready\"\r\n    } ]\r\n  } ],\r\n  \"status\": {\r\n    \"all_replicas_ready\": true,\r\n    \"ready_for_outdated_reads\": true,\r\n    \"ready_for_reads\": true,\r\n    \"ready_for_writes\": true\r\n  }\r\n}\r\n```"}}