So, again, as long as the node has at least 150 MB of unused RAM per 1 TB of pieces, there is enough RAM to hold the piece index file and all necessary direntries and inodes of pack files in cache, so no need to seek for any of those.
This differs from the current situation where you need at least 1 GB of unused RAM per 1 TB of pieces (for a typical ext4 setup) to cache all necessary direntries and inodes.
And again, for the case where the node does not have enough RAM to cache the piece index file, it’s still saving one seek compared to the current approach.
Indeed. I focused on fragmentation only because pack files will become fragmented with time, so I have to prove it won’t affect operation, i.e. it will be equivalent to current piece files not fragmented. Just that.
Yeah. Too much work to make it efficient. Besides, file systems do that already in a sufficient manner, which is why this proposal depends on file systems to manage disk space allocations, so my belief is that writing a piece storage on top of effectively block storage will not bring significant benefits over this proposal, while being much more complex.
I have a feeling you believe this proposal moves pieces within HDD. No, it does not. It’s not necessary. When a given piece is stored in a set of disk sectors, it’s never moved from these sectors. The logical address (piece ID, offset) changes due to compaction, but data sectors are not moved.