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

Retention by available disk space #2791

Conversation

NickM-27
Copy link
Collaborator

@NickM-27 NickM-27 commented Feb 10, 2022

WIP PR to add the ability to configure storage_percent to delete recordings and events in case storage is used but is not expired yet. I have not fully worked out some of the implementation details so if anyone has any answers to the questions or has ideas please feel free to make comments / suggestions.

Open Questions

  1. Delete recordings processes one camera at a time, what is the best way to consider storage use?
  2. Is there a good way to delete and check the storage use after a certain # of deletions or just delete a certain number per camera?
  3. The cameras are processed one at a time, so the first camera will have a bias to be deleted before the lower ones.
  4. If it this is allowed to be a per-camera configuration, is there any special handling needed for different values (ex: one camera is set to 95% and another is set to 70%
  5. Since clips and snapshots are currently handled separately, should this also handle separately or delete both at the same time?
  • Add storage_percent to record and event retain config
  • Remove recordings if storage is overutilized
  • Remove events if storage is overutilized
  • Potentially balance per camera to not bias first camera in list

Will retarget 0.11.0 once available.

@NickM-27
Copy link
Collaborator Author

Fix for #994

@NickM-27 NickM-27 changed the title Retain by available disk space Retention by available disk space Feb 10, 2022
@NickM-27 NickM-27 closed this Feb 11, 2022
@PrplHaz4
Copy link

I don't think camera's should be considered - if the disk is running out of space, it is fair to delete oldest first to prevent the disk from filling up.

@NickM-27 NickM-27 deleted the retain-by-available-disk-space branch February 20, 2022 21:23
@DrSpaldo
Copy link

Is this no longer being considered? I think it is a good idea

@NickM-27
Copy link
Collaborator Author

Is this no longer being considered? I think it is a good idea

This was a bad attempt by me to get it going. It is more complicated than it seemed and I didn't know enough about the codebase to do it well. Blake also indicated it would likely be coming as part of 0.12

The feature request is still open and it is definitely coming, but I will likely leave it to Blake as I don't think I could do as good of a job implementing this feature, especially as it could have some very nuanced bugs if not implemented correctly.

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

Successfully merging this pull request may close these issues.

3 participants