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

Delete tenant should delete data #1233

Open
PhilippHandle opened this issue May 1, 2024 · 6 comments
Open

Delete tenant should delete data #1233

PhilippHandle opened this issue May 1, 2024 · 6 comments
Assignees
Labels
feature request New feature or request

Comments

@PhilippHandle
Copy link

Is your feature request related to a problem? Please describe.
I wanted to reset the tenant. if i delete the tenant the relations etc stayed behind

Describe the solution you'd like
on tenant deletion, the rest of the data, linked to the tenant, should be deleted

Describe alternatives you've considered
deleting related data "manualy"

@PhilippHandle PhilippHandle added the feature request New feature or request label May 1, 2024
@inabhi9
Copy link

inabhi9 commented May 2, 2024

I think it's taken care by garbage collection task.

@PhilippHandle
Copy link
Author

Yeah but it's slow. I wanted to use permify for my game.
If i restart the game, i would have to wait for the gc to run and this is very unconvinient.

@inabhi9
Copy link

inabhi9 commented May 2, 2024

Ah, I see your use case! But it would be tricky to do it for them as they didn't use foreign key to optimize performance. Your best bet is to add some random prefix/suffix to tenant name.

@PhilippHandle
Copy link
Author

Yeah I think its the easiest way. delete the old tenant and create a new one and let the gc cleanup afterwords.

@PhilippHandle
Copy link
Author

Ok i tried and it doesn't work. gc runs every 5min to test.
I only habe one tenant and the tables schema_definitions, relation_tuplets, bundles get never cleaned up.

image

@inabhi9
Copy link

inabhi9 commented May 7, 2024

I just checked the code and it seems GC doesn't clean-up for deleted tenant but rather cleans-up based on last transaction id (like deleting records having expired tx id less than the last tx id).

So I guess not an easy workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants