feat: add availability persistence foundation - #834
Conversation
|
Don't merge this yet, probably will change or revoke this. |
|
Not sure why we should do this |
|
Yes I'll probably keep this in draft for now. What I am trying to do is create a provider availability / segment map. If your primary has a lot of missing articles but your backups have them, streaming can be quite slow. On 4k web-dls I get a lot of buffering because of this. It's running fast, hits a missing articles, has to go and fetch it. This slows the whole pipeline down if it happens frequently. So the goal would be to do a few things:
There are a lot of blockers currently for this though because of how altmount / nntppool handles provider ids, multiple primaries in round robin, etc... This PR was to lay some of the foundation work but I will be amending it in the future with some more narrowly scoped changes. Do you think this is a useful feature? It's something I run into regularly and I am assuming it is the cause of my slow streaming in certain instances. |
What this PR is for
This PR lays the persistence and identity foundation for a later latency improvement: remembering which files and articles are available from the configured provider pool, so future import, health, and streaming paths can avoid repeating futile work.
It is intentionally a foundation-only change. It does not change importer behavior, health scheduling, streaming, first-byte latency, or article reads yet. Later PRs will add writers and consumers only after the provider-identity and failure-taxonomy decisions are confirmed.
What changes
SegmentData.AvailabilityRepositoryoperations for definitive manifest-present summaries and confirmed-missing article facts.What this deliberately does not change
BodyPriority, fallback, or repair behavior.file_health,.meta,KnownHoles,segcache, public config/API, metrics, or scheduler behavior.Verification
Passed:
go test ./internal/availability ./internal/database -count=1go test -race ./internal/availability ./internal/database -count=1go vet ./internal/availability ./internal/databasego build ./...gofmtandgit diff --checkIndependent audits:
t_3ecd55d5)t_183ac982)Known bounded caveats:
Follow-up sequence