attic icon indicating copy to clipboard operation
attic copied to clipboard

The `holders_count` field of `nar` and `chunk` can be greater than zero permanently

Open tstat opened this issue 1 year ago • 0 comments

Similar to #64 and #65

Skimming the find_and_lock_chunk code, it looks like the purpose of this field is essentially to mark a nar or chunk row that may soon be referenced by a new object (looking at the upload code) so that it doesn't get garbage collected in the meantime.

However, if the process is halted between incrementing holders_count and decrementing it when the guard is dropped, then the holders_count is permanently greater than zero, and never eligible for garbage collection.

tstat avatar Jun 27 '23 02:06 tstat