-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add method MetaAPI::rename_table()
#3765
Comments
Why not use |
This is an API to operate the underlying kv store(the meta data store). Here this method just rename a table, and does nothing more else. |
/assignme I take this issue to learn meta api. |
@ariesdevil has an ongoing working branch that may have conflicts with this issue. |
@junnplus Here you go~ |
I might need help. : ( I try to add rename method to meta api:
I'm not sure if I'm missing something I don't know. : ( |
In general, And a failure to rename a table should not emit a AppliedState is meant to express application-data changes in the state machine.
It might be working, but not quite sure if it is a good idea |
@drmingdrmer It seems that using AppliedState as the return cannot rollback the transaction. If the drop table succeeds and the create table fails, the transaction cannot be rolled back. |
|
What if we remove ErrorCode, and make UnknownTable and TableExists sub errors of MetaError. |
ref: #4000 |
It looks good enough to support the expected modification in this issue? :D |
This method will remove old table record and add a new one in a sled-tree-transaction.
The impl would be similar to CreateTable:
https://github.com/datafuselabs/databend/blob/77fe82ff05ebd8c8c689101bb64a9f53cd50133f/common/meta/raft-store/src/state_machine/sm.rs#L482-L495
BTW, There may be consistency concern: databend-query currently just loads table by (database-name, table-name).
Originally posted by @BohuTANG in #3557 (comment)
The text was updated successfully, but these errors were encountered: