You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "chunhui shen (JIRA)" <ji...@apache.org> on 2012/06/13 11:33:42 UTC

[jira] [Created] (HBASE-6205) Support an option to keep data of dropped table for some time

chunhui shen created HBASE-6205:
-----------------------------------

             Summary: Support an option to keep data of dropped table for some time
                 Key: HBASE-6205
                 URL: https://issues.apache.org/jira/browse/HBASE-6205
             Project: HBase
          Issue Type: Improvement
          Components: master
            Reporter: chunhui shen
            Assignee: chunhui shen


User may drop table accidentally because of error code or other uncertain reasons.

Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.

So, I just give a suggest, do we need to support an option to keep data of dropped table for some time, eg.1 day.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294831#comment-13294831 ] 

chunhui shen commented on HBASE-6205:
-------------------------------------

@Ted
Thanks for the suggestion.

I would improve it as the comments and put patch on review board
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Zhihong Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295808#comment-13295808 ] 

Zhihong Ted Yu commented on HBASE-6205:
---------------------------------------

@Stack:
Did Chunhui answer your question ?
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Attachment: HBASE-6205v2.patch

Updating patch v2
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, eg.1 day.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400756#comment-13400756 ] 

Enis Soztutar commented on HBASE-6205:
--------------------------------------

+1 on using the hdfs trash, it has all the properties we need (configurable, easy to use, and works). We just need a way to reconstruct the table.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294817#comment-13294817 ] 

Ted Yu commented on HBASE-6205:
-------------------------------

Nice feature.

Shall we consider the possibility that there may be more than one attempt to delete the same table ? This could be due to e.g. region server failure, etc.
In that case we would have more than one directory for the table, each with different timestamp prefix.
It would be nice for this feature to group regions for the same table under one parent directory.

Further, trash is able to hold more than one tables. Can we name related classes Trash instead of TrashTable ?

The regions in trash would occupy disk space. It would be nice to show on master UI how much space is currently consumed by trash, what tables are in trash.

It would also be nice to prompt user if he/she is creating a table with the same name as one of the tables in trash.

The above can be done in follow-up JIRAs. However we should prepare for enhancement from the beginning.

Please put patch on review board when you think it has paved the way for future enhancement.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Zhihong Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400738#comment-13400738 ] 

Zhihong Ted Yu commented on HBASE-6205:
---------------------------------------

>From http://www.oracle.com/technetwork/database/features/availability/flashback-overview-082751.html (Jon Hsieh referred to):

Flashback Drop: recover an accidentally dropped table. It restores the dropped table, and all of its indexes, constraints, and triggers, from the Recycle Bin (a logical container of all dropped objects).
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295036#comment-13295036 ] 

Ted Yu commented on HBASE-6205:
-------------------------------

bq. prompt user if he/she is creating a table with the same name as one of the tables in trash
I think the above is needed, especially if the table being created has different schema from the deleted table (which had the same name).
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-6205:
-------------------------

    Fix Version/s:     (was: 0.96.0)

Moving out of 0.96
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295428#comment-13295428 ] 

chunhui shen commented on HBASE-6205:
-------------------------------------

review board
https://review.cloudera.org/r/2153/
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Zhihong Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13396960#comment-13396960 ] 

Zhihong Ted Yu commented on HBASE-6205:
---------------------------------------

@Andrew:
What do you think of the patch ?
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295198#comment-13295198 ] 

stack commented on HBASE-6205:
------------------------------

@Chunhui Why a special hbase trash dir?  Why not just use the trash facility of hdfs?  It already has configurable retention period?
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Attachment: HBASE-6205v5.patch

Updating patch:
Add warning when user creates a table whose name is the same as one that was recently put into trash
And other comments provided by Ted in review board
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402453#comment-13402453 ] 

Andrew Purtell commented on HBASE-6205:
---------------------------------------

bq. .META. scanning is not atomic. How about storing this information in zookeeper ?

We could use ZK for coordination but would also need to store back after to .META., so we can repopulate ZK in cold boot scenarios. So... both?
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401193#comment-13401193 ] 

chunhui shen commented on HBASE-6205:
-------------------------------------

1.Trash facility of hdfs is only used for shell command, if we called fs.delete() through code, it won't work, correct me if wrong

2.Deleting HFiles when in "backup mode" will reserver all the compacted old files, but we won't need so more in general time

3.Should we start "backup mode" actively? If so, how do we ensure reserve dropped table's files if we don't start "backup mode".

4.We shouldn't depend on that developer won't make mistake, HBase Administrator need one solution to recover dropped table's data.

5.This featue is configurable, we could close it if no necessary

The above is why we suggest this feature, 
Pardon me if wrong.
Thanks all for providing suggestion.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Purtell updated HBASE-6205:
----------------------------------

          Component/s:     (was: master)
    Affects Version/s: 0.96.0
                       0.94.0
    
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-6205.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, eg.1 day.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Anoop Sam John (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401228#comment-13401228 ] 

Anoop Sam John commented on HBASE-6205:
---------------------------------------

How about trying Devaraj's idea? If we do this way, need to see will it have some impacts on tools like HBCK.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13397305#comment-13397305 ] 

Hadoop QA commented on HBASE-6205:
----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12532653/HBASE-6205v4.patch
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 hadoop2.0.  The patch compiles against the hadoop 2.0 profile.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    -1 findbugs.  The patch appears to introduce 7 new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed unit tests in .

Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/2198//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2198//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2198//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/2198//console

This message is automatically generated.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402436#comment-13402436 ] 

Enis Soztutar commented on HBASE-6205:
--------------------------------------

Considering this, HBASE-5547, and snapshots, it seems that we can decouple file management, and region-file association. We can build a very lightweight file manager, and remove all file deletion code from RS code. 

As in the bigtable design, we can keep the current hfile's (and WAL's) of the regions in META, and RS flushes, or rolls the log, adds the file reference at META. Then for a snapshot or a backup, we just need a point-in-time snapshot of the META table. A master thread can periodically scan the META, and META snapshots and the hdfs directories, and delete the files with 0 reference based on a policy. And deleting the table will just take a META snapshot for the table, and delete the META entries afterwards. This META snapshot will be kept for a while (similar to the normal snapshot retention). WDYT, how crazy is this? 
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Devaraj Das (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400944#comment-13400944 ] 

Devaraj Das commented on HBASE-6205:
------------------------------------

Would this work:
1. Have the delete command simply disable the table (flag with disable_delete or something and record it in ZK)
2. Have the master periodically check for disable_delete table flags and if a table was disabled for more than 24 hours (say), then the master deletes the table
3. If (1) was done in error, then an 'undelete' command could simply reenable the table within the 24 hour period & delete the ZK entry (of course these operations needs to be done carefully to avoid races).
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Description: 
User may drop table accidentally because of error code or other uncertain reasons.

Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.

So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day

In the patch:
We make a new dir named .trashtables in the rood dir.
In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
Default keep time for dropped tables is 1 day, and check period is 1 hour.

  was:
User may drop table accidentally because of error code or other uncertain reasons.

Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.

So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day

In the patch:
We make a new dir named .trashtables in the rood dir.
In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
Default keep time for dropped tables is 1 day, and check period is 1 hour.

    
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401950#comment-13401950 ] 

Lars Hofhansl commented on HBASE-6205:
--------------------------------------

Agree with Jon that HBASE-5547 should subsume this, especially considering my latest proposal there.

                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Attachment: HBASE-6205.patch

In the patch:

Move regions to trash table dir when dropping tables, and clear these regions after time out.
Default keep time: 1 day
{code}
this.keepTime = conf.getLong("hbase.master.trashtable.keeptime",
+        24 * 3600 * 1000l);
{code}
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: Improvement
>          Components: master
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-6205.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggest, do we need to support an option to keep data of dropped table for some time, eg.1 day.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408620#comment-13408620 ] 

stack commented on HBASE-6205:
------------------------------

bq. Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.

Would a better approach be giving production and test environment's different access permissions.

If not, if tester has access to both, IMO more safeguards will never fully protect against this error happening.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Issue Type: New Feature  (was: Improvement)
    
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>          Components: master
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-6205.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, eg.1 day.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Jimmy Xiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400764#comment-13400764 ] 

Jimmy Xiang edited comment on HBASE-6205 at 6/25/12 6:42 PM:
-------------------------------------------------------------

hbck can be used to get the table back after all the data files are recovered from hdfs trash.
                
      was (Author: jxiang):
    hbck can be used to reconstruct the table.
                  
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Zhihong Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398175#comment-13398175 ] 

Zhihong Ted Yu commented on HBASE-6205:
---------------------------------------

>From https://builds.apache.org/job/PreCommit-HBASE-Build/2206/console:
{code}
svn: This client is too old to work with working copy '.'.  You need
to get a newer Subversion client, or to downgrade this working copy.
See http://subversion.tigris.org/faq.html#working-copy-format-change
for details.
{code}
You need to run test suite yourself.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Jimmy Xiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400764#comment-13400764 ] 

Jimmy Xiang commented on HBASE-6205:
------------------------------------

hbck can be used to reconstruct the table.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Jesse Yates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398544#comment-13398544 ] 

Jesse Yates commented on HBASE-6205:
------------------------------------

I don't know if this feature needs to be so far reaching. We already are getting preservation of the hfiles on delete via HBASE-5547 and as stack says, HDFS supports a /trash directory with configurable deletion period  (http://hadoop.apache.org/common/docs/r1.0.3/hdfs_design.html#Space+Reclamation). 

It would make more sense that when we delete the table that we just store a list of the current files in the table in a single file added to /trash, so we know which files to include and which to exclude when recovering the table. This solves the issues of periodic cleanup, minimizing possible locations of old hfiles and still lets you reasonably recover a table.

On the other hand, I would argue that this feature is a bit excessive. This isn't a feature traditional tables support and is a bit excessive IMO. You should be _very_ careful when dropping tables and not just do things willy-nilly on production (in particular, you can make sure all production runs via (possibly generated) scripts so you can validate and not 'accidentally' drop tables moving from dev to production). The traditional though here is that you can recover if you are fast enough from the local fs (in this case hdfs /trash) or from a backup (everyone takes those periodically, right?). Am I missing something?

+1 on making this configurable.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Description: 
User may drop table accidentally because of error code or other uncertain reasons.

Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.

So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, eg.1 day.



  was:
User may drop table accidentally because of error code or other uncertain reasons.

Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.

So, I just give a suggest, do we need to support an option to keep data of dropped table for some time, eg.1 day.



    
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: Improvement
>          Components: master
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-6205.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, eg.1 day.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Devaraj Das (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401544#comment-13401544 ] 

Devaraj Das commented on HBASE-6205:
------------------------------------

Yeah, agree with Ramkrishna on the points.. I'd expect little impact on the hbck tool but haven't thought about it deeply enough (ideally, the hbck tool shouldn't need to change - it should treat disable_delete tables the same way as it treats disabled tables today).
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Matteo Bertozzi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408330#comment-13408330 ] 

Matteo Bertozzi commented on HBASE-6205:
----------------------------------------

Do we really need almost 3 + 1 identical features?
 * backup mode (HBASE-5547)
 * snapshots (HBASE-6055)
 * keep data for some time before delete (HBASE-6205)
 * HDFS trash (why is shell only?)

Can't we just do everything with the snapshots? maybe marking the snapshot with some tag like User-Snapshot, Backup-Snapshot, Delete-Snapshot?
The table backup can be done by taking a snapshot end exporting it to another cluster.
The delete can create a snapshot and you should be able to restore it.

Maybe we can have some properties to say:
 * hbase.droptable.snapshot (true|false) take an automatic snapshot on drop table
 * hbase.droptable.snapshot.lifetime (sec) keep the drop table snapshot for X seconds.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294833#comment-13294833 ] 

Hadoop QA commented on HBASE-6205:
----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12532035/HBASE-6205v2.patch
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 hadoop2.0.  The patch compiles against the hadoop 2.0 profile.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    -1 findbugs.  The patch appears to introduce 6 new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

     -1 core tests.  The patch failed these unit tests:
                       org.apache.hadoop.hbase.master.TestTrashTableCleaner

Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/2167//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2167//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2167//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/2167//console

This message is automatically generated.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Jesse Yates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402404#comment-13402404 ] 

Jesse Yates commented on HBASE-6205:
------------------------------------

@Lars HBASE-5547 might not fully subsume this - conceptually we could have our own trash directory that just has a bunch of references files the original HFiles (like what I'm doing with snapshots in HBASE-6055). You would need to hack Reference.java a little bit to support full file references (or just use what I wrote: https://github.com/jyates/hbase/blob/timestamp-snapshots-r0/hbase-server/src/main/java/org/apache/hadoop/hbase/io/Reference.java). 

This way you don't end up doing any actual file copying, but still can keep track of the files.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400946#comment-13400946 ] 

Enis Soztutar commented on HBASE-6205:
--------------------------------------

After an offline conversation with Ted, and Jitendra, it seems that hdfs trash works only for shell. One other concern is that trash is not exposed as hadoop filesystem feature, so we have to use the shell-equivalent commands to accomplish this, and it will work only on hdfs, not other file systems. 

The question of whether to implement an hbase-thrash boils down to whether we want this to work with file systems other than hdfs, and have more control on the retention policy.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Zhihong Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402442#comment-13402442 ] 

Zhihong Ted Yu commented on HBASE-6205:
---------------------------------------

Interesting idea.
.META. scanning is not atomic. How about storing this information in zookeeper ?
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Yu updated HBASE-6205:
--------------------------

    Fix Version/s: 0.96.0
           Status: Patch Available  (was: Open)
    
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Description: 
User may drop table accidentally because of error code or other uncertain reasons.

Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.

So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day

In the patch:
We make a new dir named .trashtables in the rood dir.
In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
Default keep time for dropped tables is 1 day, and check period is 1 hour.

  was:
User may drop table accidentally because of error code or other uncertain reasons.

Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.

So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, eg.1 day.



    
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Jesse Yates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400752#comment-13400752 ] 

Jesse Yates commented on HBASE-6205:
------------------------------------

Is it possible to do an hbase-flashback by just rebuilding from the files in hdfs /trash? The main thing I'm concerned with is having the deleted files end up in a bunch of places.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402586#comment-13402586 ] 

Lars Hofhansl commented on HBASE-6205:
--------------------------------------

Sounds like an awful amount of work for this feature.

How about this: When a table is dropped we just delay that action by configurable amount of time (say 5 mins), during that time the drop action can be canceled.
Could just store tables to be dropped in a system table.

                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Attachment: HBASE-6205v4.patch

Updating patch v4 as Ted's comments in review board
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Zhihong Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400958#comment-13400958 ] 

Zhihong Ted Yu commented on HBASE-6205:
---------------------------------------

Over in HBASE-2315, Flavio proposed basing WAL on Bookkeeper.
Before WAL can have separate file system other than that used by HFiles, we should accommodate more file system choices beyond hdfs.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294664#comment-13294664 ] 

Andrew Purtell commented on HBASE-6205:
---------------------------------------

+1
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>         Attachments: HBASE-6205.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, eg.1 day.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "ramkrishna.s.vasudevan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401245#comment-13401245 ] 

ramkrishna.s.vasudevan commented on HBASE-6205:
-----------------------------------------------

bq.if we set table disable_delete, could user see this table?
I think here the user should be able to see until the table is really deleted. 
bq.create the table with the same name, is it will something wrong?
If drop is done completely then we should allow the table creation with same name.  Maybe till then we should not allow.  Just my thoughts on this.  

                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294901#comment-13294901 ] 

Hadoop QA commented on HBASE-6205:
----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12532048/HBASE-6205v3.patch
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 hadoop2.0.  The patch compiles against the hadoop 2.0 profile.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    -1 findbugs.  The patch appears to introduce 6 new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed unit tests in .

Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/2170//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2170//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/2170//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/2170//console

This message is automatically generated.
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401239#comment-13401239 ] 

chunhui shen commented on HBASE-6205:
-------------------------------------

bq.How about trying Devaraj's idea? 

If user dropped the table, and create the table with the same name, is it will something wrong?

Another problem, if we set table disable_delete, could user see this table?
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295423#comment-13295423 ] 

chunhui shen commented on HBASE-6205:
-------------------------------------

@stack
In my memory, trash facility of hdfs is only used for shell commend, if we called fs.delete() through code, could it work also? Sorry, I'm not sure about this.

Anyway, we would delete files after compaction or old logs, and needn't to reserve them. 
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chunhui shen updated HBASE-6205:
--------------------------------

    Attachment: HBASE-6205v3.patch

Updating the patch v3 (change the name)
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Jesse Yates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13410692#comment-13410692 ] 

Jesse Yates commented on HBASE-6205:
------------------------------------

bq. If not, if tester has access to both, IMO more safeguards will never fully protect against this error happening.

True, but we can be really good about it.

By combining a timeout before actually deleting a table (so you can do a quick restore) with a snapshot of the deleted table and a further timeout before the snapshot is cleaned (similar to the log-cleaner stuff now) - giving you a slower restore from saved state - you can minimize impact on the cluster and still keep most of the data safe. Unless you accidentally delete a table and then walk away for a week, you will probably be fine. 
                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch, HBASE-6205v3.patch, HBASE-6205v4.patch, HBASE-6205v5.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294817#comment-13294817 ] 

Ted Yu edited comment on HBASE-6205 at 6/14/12 6:28 AM:
--------------------------------------------------------

Nice feature.

Shall we consider the possibility that there may be more than one attempt to delete the same table ? This could be due to e.g. region server failure, etc.
In that case we would have more than one directory for the table, each with different timestamp prefix.
It would be nice for this feature to group regions for the same table under one parent directory.

Further, trash is able to hold more than one table. Can we name related classes Trash instead of TrashTable ?

The regions in trash would occupy disk space. It would be nice to show on master UI how much space is currently consumed by trash, what tables are in trash.

It would also be nice to prompt user if he/she is creating a table with the same name as one of the tables in trash.

The above can be done in follow-up JIRAs. However we should prepare for enhancement from the beginning.

Please put patch on review board when you think it has paved the way for future enhancement.
                
      was (Author: yuzhihong@gmail.com):
    Nice feature.

Shall we consider the possibility that there may be more than one attempt to delete the same table ? This could be due to e.g. region server failure, etc.
In that case we would have more than one directory for the table, each with different timestamp prefix.
It would be nice for this feature to group regions for the same table under one parent directory.

Further, trash is able to hold more than one tables. Can we name related classes Trash instead of TrashTable ?

The regions in trash would occupy disk space. It would be nice to show on master UI how much space is currently consumed by trash, what tables are in trash.

It would also be nice to prompt user if he/she is creating a table with the same name as one of the tables in trash.

The above can be done in follow-up JIRAs. However we should prepare for enhancement from the beginning.

Please put patch on review board when you think it has paved the way for future enhancement.
                  
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6205) Support an option to keep data of dropped table for some time

Posted by "chunhui shen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294864#comment-13294864 ] 

chunhui shen commented on HBASE-6205:
-------------------------------------

bq.how much space is currently consumed by trash
We should consume size of each file recursively, is it too expensive?

bq.prompt user if he/she is creating a table with the same name as one of the tables in trash
I think this feature is used for HBase administrator. It could be invisible to general users. In fact, we need use tool like add_table.rb to recover dropped table.


                
> Support an option to keep data of dropped table for some time
> -------------------------------------------------------------
>
>                 Key: HBASE-6205
>                 URL: https://issues.apache.org/jira/browse/HBASE-6205
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: chunhui shen
>            Assignee: chunhui shen
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6205.patch, HBASE-6205v2.patch
>
>
> User may drop table accidentally because of error code or other uncertain reasons.
> Unfortunately, it happens in our environment because one user make a mistake between production cluster and testing cluster.
> So, I just give a suggestion, do we need to support an option to keep data of dropped table for some time, e.g. 1 day
> In the patch:
> We make a new dir named .trashtables in the rood dir.
> In the DeleteTableHandler, we move files in dropped table's dir to trash table dir instead of deleting them directly.
> And Create new class TrashTableCleaner which will clean dropped tables if it is time out with a period check.
> Default keep time for dropped tables is 1 day, and check period is 1 hour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira