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

Add host_sectors table for sectors uploaded to temporary storage #1591

Open
ChrisSchinnerl opened this issue Sep 29, 2024 · 2 comments
Open
Assignees
Milestone

Comments

@ChrisSchinnerl
Copy link
Member

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:

  1. when an object is added to the bus, add a link to host_sectors for every sector.
  2. 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.

@ChrisSchinnerl ChrisSchinnerl converted this from a draft issue Sep 29, 2024
@ChrisSchinnerl ChrisSchinnerl moved this from Triage to Todo in Sia Sep 29, 2024
@ChrisSchinnerl ChrisSchinnerl added this to the v2.0.0 milestone Sep 29, 2024
@peterjan peterjan self-assigned this Oct 2, 2024
@peterjan
Copy link
Member

peterjan commented Oct 2, 2024

@ChrisSchinnerl is the idea to keep host_sector once it's "upgraded" to a contract_sector? The changes you list make me think it's a yes while in my head that wasn't the case.

@peterjan peterjan moved this from Todo to In Progress in Sia Oct 2, 2024
@ChrisSchinnerl
Copy link
Member Author

@peterjan yeah the idea is to keep it. It's a permanent connection between a sector and a host that is only removed when the host reports it can't find the sector. Then we remove it from the host_sector and also contract_sector if we still got a contract that contains it. The latter leads to an incremented lost sectors count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants