Skip to content
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

After shutting down cnosdb, tenant cannot be recovered after restarting #2397

Open
paradox0503 opened this issue Nov 22, 2024 · 0 comments
Open

Comments

@paradox0503
Copy link
Contributor

Describe the bug

I set the tenant to have the drop_after option, then dropped the tenant, after that,i shut down CNOSDB and restarted it, but I cannot recover the tenant and it says tenant not found. However, when I create the tenant, it says tenant already exists.
QQ_1732272988202

To Reproduce

start CNOSDB
./target/debug/cnosdb run -M singleton --config ./config/config_8902.toml
in client:

public ❯ create tenant aaa with drop_after='1d';
Query took 0.016 seconds.
public ❯ drop tenant aaa;
+--------------------------------------------------------------------------------+
| tips                                                                           |
+--------------------------------------------------------------------------------+
| This tenant will drop after 86400s                                             |
| If you want to delete this tenant immediately, you need to do something extra: |
| 1)recover tenant "aaa";                                                        |
| 2)alter tenant "aaa" unset drop_after;                                         |
| 3)drop tenant "aaa";                                                           |
+--------------------------------------------------------------------------------+
Query took 0.015 seconds.

shutdown CNOSDB
restart CNOSDB
in client:

public ❯ SELECT * FROM cluster_schema.tenants;
+-------------+----------------------------------------------------------------------------------------------+
| tenant_name | tenant_options                                                                               |
+-------------+----------------------------------------------------------------------------------------------+
| cnosdb      | {"comment":"system tenant","limiter_config":null,"drop_after":null,"tenant_is_hidden":false} |
+-------------+----------------------------------------------------------------------------------------------+
Query took 0.014 seconds.
public ❯ create tenant aaa with drop_after='1d';
422 Unprocessable Entity, details: {"error_code":"030009","error_message":"The tenant aaa already exists"}
public ❯ recover tenant aaa;
422 Unprocessable Entity, details: {"error_code":"030010","error_message":"The tenant aaa not found"}
public ❯ 

Expected behavior

I need to recover tenant after I restart CNOSDB,otherwise I can‘t drop that tenant immediately

Additional context

No response

@paradox0503 paradox0503 changed the title After shutting down cnosdb, tenant cannot be restored after restarting After shutting down cnosdb, tenant cannot be recovered after restarting Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant