filecoin-project / dagstore

a sharded store to hold large IPLD graphs efficiently, packaged as location-transparent attachable CAR files, with mechanical sympathy
Other
42 stars 24 forks source link

Automated Watermark based LRU garbage collection and Transient Quota allocation #125

Closed aarshkshah1992 closed 2 years ago

aarshkshah1992 commented 2 years ago

This PR introduces automated watermark based LRU GC of transients along with a quota reservation mechanism to allow for downloading transients whose size we do not know upfront.

Known Edge Case

There is an unhandled known edge case in the code.

If a group of concurrent transients downloads end up reserving all the available space in the transients directory but not enough to satisfy their individual downloads, then all of them will end up back-off retrying together for more space to become available. However, no space will become available till one of them exhausts the number of backoff-retry attempts -> fails the download -> releases reserved space. Thus, the dagstore will not make any progress with new downloads till one of the download fails and releases it's reservation.

However, this edge case should be mitigated by:

  1. Rate limiting the number of concurrent transients fetches
  2. Giving higher reservations to older downloads vs newer downloads.
aarshkshah1992 commented 2 years ago

Closed in favour of https://github.com/filecoin-project/dagstore/issues/134.