renterd
renterd copied to clipboard
Add `host_sectors` table for sectors uploaded to temporary storage
Before we get started with RHP4 in our upload code, we will need a new host_sectors
table which maps all sectors to the host that they should be uploaded to. That way, we can track sectors which are uploaded but not part of a contract yet.
This will require at least the following changes:
- when an object is added to the bus, add a link to
host_sectors
for every sector. - when an object is fetched from the bus, sectors which are uploaded but not linked to a contract should appear in the response with an empty slice of contract ids
Later, when we add upload pinning, we will be able to join sectors over both the contract_sectors
as well as host_sectors
to figure out which sectors still require pinning.