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

[Subtask] Setting buffer time for deletion operations to prevent accidental deletion, etc. #319

Closed
Tracked by #294
yuqi1129 opened this issue Sep 4, 2023 · 5 comments
Assignees

Comments

@yuqi1129
Copy link
Contributor

yuqi1129 commented Sep 4, 2023

Describe the subtask

After #305 & #306, we started supporting true nested deletion in graviton. This is unsafe, so we must establish a method to recover data before physically deleting it in case of accidental deletion.

A good choice is to set a buffer time before actual deletion. Users have the option to undo the deletion operation within a certain time frame.

Parent issue

#294

@yuqi1129
Copy link
Contributor Author

yuqi1129 commented Sep 5, 2023

We may need to do the following things.

  • Mark the entity and its related sub-entities as deleted and can't be accessed.
  • Set a buffer time, for example, two days for them.
  • Start a daemon thread to periodically delete entities marked as deleted.
  • Offer ways to make entities marked as deleted visible again.

@yuqi1129
Copy link
Contributor Author

yuqi1129 commented Sep 5, 2023

Possible solutions for these problems.

Mark the entity and its related sub-entities as deleted and can't be accessed.

  1. Add a new key-value pair that indicates the entities and their sub-entities have been deleted. The key can share the same prefix as the key that represents deleted entities.
  2. Add a property that holds deletion information for an entity. For example, introducing a field named 'valid' in CatalogEntity, if it's false, then that means the entity has been marked as deleted. This option is straightforward to implement.
  3. Set multiple free bytes before the serialized byte array of entity to hold deletion information. It's similar to the second one.

I prefer the first option, while the second one can also be considered. What's your opinion? @jerryshao

@jerryshao
Copy link
Contributor

Is it already done? @yuqi1129

@yuqi1129
Copy link
Contributor Author

Yes, it was completed by #782.

@yuqi1129
Copy link
Contributor Author

Close

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

2 participants