Skip to content

[Proposal]Before drop db, table, partition should check whether there exits related committed txns ready to publish #3988

@caiconghui

Description

@caiconghui

Is your feature request related to a problem? Please describe.
Now, we drop db, table, partition without checking related committed txns, in order to get better performance, we don't always get db lock until txn finish, which would cause some intermediate state for tables, because committed txns haven't finished after table or partition dropped. And we just simply aborted the commited txns, if the table recover from the CatalogRecycleBin, tablet state may be unnormal, and we have no idea to deal with this case.
For now, user execute drop stmt in the following two scenarios:

  1. User really want to drop db, table or partition.
  2. User execute a drop statement was executed by mistake.

For scenario one, the current implementaion is ok, because we don't need db, table or partition any more, so unnormal tablet or partition doesn't matter, but it seems that user forget to stop the load job before he execute the drop stmt.
For scenario two, that would be an accident because of mistake drop operation. We recover the table, but we may cannot make tablet normal anymore, we can only drop unnormal tablets if we still want to use this table.

Describe the solution you'd like
1.before drop db, table, partition, we check whether there exits related committed txns ready to publish, if exists, throw exception
to tell user to stop the load job first and wait committed txn to be finished.

2.For some extrem unnormal case, for example, many replica's commited info in be have lost for some
rarely seen reasons, and would not publish succeed anymore, we should provide a solution to forcely drop unnormal table
or partition, to escape some unhandled blocked conditions. maybe grammer like ''dropp table xxx"

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalCategorizes an issue is a proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions