-
Notifications
You must be signed in to change notification settings - Fork 326
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
Supports drop schema/database statement #825
Comments
Please assign it to me if you are willing to~ |
ping @TheR1sing3un , any updates? |
Is this issue blocked until any issues are resolved? If not, I'd like to work on this issue. |
Appreciate it ❤️ |
Next I'll implement |
I have a question about the design of the #[async_trait]
impl Procedure for CreateTableProcedure {
//..
fn lock_key(&self) -> LockKey {
// We lock the whole table and the schema.
let table_name = self.data.table_ref().to_string();
LockKey::new(vec![table_name, self.request.schema_name.clone()])
}
} Similarly, for #[async_trait]
impl Procedure for DropDatabaseProcedure {
//..
fn lock_key(&self) -> LockKey {
LockKey::new([
self.request.schema_name.clone(),
//..
])
}
} I think it is inefficient to lock the schema. Are there other effective approaches? |
Yes, we don't support hierarchy locking now. We could provide an intuitive implementation first:
This means that a create table command aborts the drop database command. But users could fix this by re-submit a drop database command. In the future, we can improve this by other approaches. There are some alternatives:
|
We might choose another approach, see #1943 (comment) |
@NiwakaDev After #3061, we allow the procedure to acquire a shared lock, which makes acquiring locks in the drop database procedure much more straightforward. I will refactor the locks of procedures recently to ensure we only need to acquire an exclusive lock on the |
@NiwakaDev, are there any updates? Would you like to continue working on this feature, Or may I take over the feature? |
What problem does the new feature solve?
The greptimedb doesn't support
drop [schema | database] [name]
right now:What does the feature do?
Drop schema(database) by sql statement.
Implementation challenges
No response
The text was updated successfully, but these errors were encountered: