backfill: add failback to fetch CAR file from PDS (if relay errors) (#855)
The main motivation here is that non-archival relay is returning a 4xx
error for fetching repos, and we want to try fetching those from the
actual PDS when that happens. This code adds a new code branch when a
relay CAR fetch fails to do an identity lookup to find the account's PDS
instance, and fetches the CAR from there.
For the search code specifically, it re-uses an existing identity
directory, to reduce double-resolution.
This also refactors how fetch URLs are constructed to use just
hostnames.
UPDATE: should probably *not* merge this to `main` until Jaz can review
authored by
bnewbold.net
and committed by
GitHub
7fd58873
72b4acb7