[
https://issues.apache.org/jira/browse/KUDU-3326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17450792#comment-17450792
]
Andrew Wong commented on KUDU-3326:
-----------------------------------
Sorry for the late response here!
{quote}So in your opinion, only one trash table is allowed to exist to meet our
design requirements?
{quote}
I wouldn't be against it, at least with the caveats mentioned.
That said, while we're thinking about design here, I do think wouldn't be too
difficult to come up with a naming convention that does satisfy uniqueness
constraints. For instance, we could add the creation timestamp to the trashed
table's name, or better yet, the table ID. E.g. instead of KUDU_TRASH:A, we
could name it {{KUDU_TRASH:<table id of A>:A}} or {{{}KUDU_TRASH:<creation
timestamp>:A{}}}.
{quote}
This function can be distinguished by adding commands parameters, or it is more
convenient to mark the trash table directly during list?
{quote}
I think adding an argument to the {{ListTables()}} API (or adding a new API
with the argument) that opts into showing trashed tables seems reasonable. I
think the default should be to not show them though; especially as they will
not be visible to Impala.
> Add Soft Delete Table Supports
> ------------------------------
>
> Key: KUDU-3326
> URL: https://issues.apache.org/jira/browse/KUDU-3326
> Project: Kudu
> Issue Type: New Feature
> Components: api, CLI, client, master, test
> Reporter: dengke
> Assignee: dengke
> Priority: Major
>
> h2. Brief description:
> Soft delete means that the kudu system will not delete the table
> immediately after receiving the command to delete the table. Instead, it will
> mark the table and set a validity period. After the validity period, will try
> again to determine whether the table really needs to be deleted.
> This feature can restore data conveniently and timely in the case of
> accidental deletion.
> h2. Relevant modification points:
> 1. After deleting a table, the original table name will be renamed as
> KUDU_TRASHED: < timestamp >: < original table name >, which becomes a trash
> table.
> 2. The contents of the trash table are exactly the same as those of the
> original table. Although it cannot be renamed, added or deleted directly,
> it can be read and written normally. The trash table will be retained for a
> period of time by default (such as 7 days, which can be modified through
> parameters). The compact priority of the trash table will be set to the
> lowest to save the system resources.
> 3. The master needs to add a thread to process expired trash tables and
> perform real deletion.
> 4. It is allowed to create a table with the same name as the original table,
> and the newly created table with the same name can be deleted normally.
> 5. It is allowed to recall deleted tables, but the following two situations
> cannot be recalled: the same original table name exists and the trash table
> has expired.
> 6. The KUDU_TRASHED is a reserved string for the system. Users are not
> allowed to create a table with table names starting with KUDU_TRASHED.
> 7. Kudu tool adaptation soft deletion.
> 8. Java API adaptation soft deletion.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)