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

Check for available disk space #130

Open
9 tasks
poundifdef opened this issue Mar 22, 2024 · 0 comments
Open
9 tasks

Check for available disk space #130

poundifdef opened this issue Mar 22, 2024 · 0 comments

Comments

@poundifdef
Copy link
Contributor

We want to make sure our software has enough disk space to work. If not, we want to stop processing requests.

Step 1: API Endpoint

The API consumes data and buffers on disk before uploading. If the disk is full, then we want to stop accepting new data and mark the server as unhealthy. This setting only applies to the pkg/datasink/filesystem package.

  • Add a new config setting to filesystem.DataSink called FreeSpaceRequiredBytes which reads from the config yaml.
  • If the value is zero or empty, then we want to interpret this as "no minimum space required"
  • If there isn't at least x amount of free space in DataSink.DataDir, then WriteData() should return an error
  • Similarly, if there isn't x amount of free space, then the /healthcheck endpoint should also return an error. This is a new endpoint that will have to be created.
  • Emit a prometheus gauge with the current free space. (It would be fine to add it to /healthcheck.) api_free_space_bytes

Step 2: Worker

The software also runs workers that consume data and insert to the database. This should also respect the Workers.FreeSpaceRequiredBytes setting.

  • As with the API, if the config has a zero value, then ignore it
  • Check to see whether there is enough free space before consuming an item from the queue. If there is not enough free space, then do stop consuming from the queue.
  • If disk space gets freed, then we should resume consuming from the queue
  • Emit a prometheus gauge with the current free space. worker_free_space_bytes
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