clay: allow for lobe-only need

This can occur after upgrade, or when receiving a %delta blob. We do not
know the path or commit timestamp of a file that resolves to the blob,
so we simply fall back to old ames-style blob-by-lobe fetching.
This commit is contained in:
fang 2022-02-17 16:02:57 +01:00
parent 3473033492
commit d6b5633c99
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -234,9 +234,9 @@
+$ update-state +$ update-state
$: =duct $: =duct
=rave =rave
scry=(unit @da) :: timeout timer if scry scry=(unit @da) :: if scry, timeout
have=(map lobe blob) have=(map lobe blob)
need=(list [when=@da =path =lobe]) need=(list $@(lobe [when=@da =path =lobe])) :: opt deets for scry
nako=(qeu (unit nako)) nako=(qeu (unit nako))
busy=_| busy=_|
== ==
@ -3192,13 +3192,7 @@
!(~(has by lat.ran) q.q.blob) !(~(has by lat.ran) q.q.blob)
!(~(has by have.sat) q.q.blob) !(~(has by have.sat) q.q.blob)
== ==
::NOTE we have already fallen back to the ames case, [q.q.blob need.sat]
:: (scry responses always come in as %direct blobs)
:: so we do not need the real path here anymore.
::REVIEW right? or is this considered too fragile?
:: actually yeah, we might retry scry later...
::TODO also wouldn't this want to check if lobe was already in need?
[[*@da / q.q.blob] need.sat]
:: We can't put a blob in lat.ran if its parent isn't already :: We can't put a blob in lat.ran if its parent isn't already
:: there. Unions are in reverse order so we don't overwrite :: there. Unions are in reverse order so we don't overwrite
:: existing blobs. :: existing blobs.
@ -3240,21 +3234,25 @@
:: another desk updating concurrently, or a previous update on this :: another desk updating concurrently, or a previous update on this
:: same desk). :: same desk).
:: ::
?: ?| (~(has by lat.ran) lobe.i.need.sat) =/ =lobe
(~(has by have.sat) lobe.i.need.sat) ?@ i.need.sat i.need.sat
lobe.i.need.sat
?: ?| (~(has by lat.ran) lobe)
(~(has by have.sat) lobe)
== ==
$(need.sat t.need.sat) $(need.sat t.need.sat)
:: Otherwise, fetch the next blob :: Otherwise, fetch the next blob
:: ::
=^ time=(unit @da) ..foreign-update =^ time=(unit @da) ..foreign-update
=< ?>(?=(^ ref) .) =< ?>(?=(^ ref) .)
:: if it is a single request, and :: if we know a revision & path for the blob,
:: :ship's remote scry isn't known to be broken, :: and :ship's remote scry isn't known to be broken,
:: or we learned it was broken more than an hour ago, :: or we learned it was broken more than an hour ago,
:: ::
?: ?| !(~(has by sad) her) ?: ?& ?=(^ i.need.sat)
?| !(~(has by sad) her)
(lth now (add scry-retry-time (~(got by sad) her))) (lth now (add scry-retry-time (~(got by sad) her)))
== == ==
:: make the request over remote scry :: make the request over remote scry
:: ::
=/ =mood =/ =mood
@ -3265,7 +3263,7 @@
:- ~ :- ~
=/ =wire /back-index/(scot %p her)/[syd]/(scot %ud inx) =/ =wire /back-index/(scot %p her)/[syd]/(scot %ud inx)
=/ =path [%backfill syd (scot %ud inx) ~] =/ =path [%backfill syd (scot %ud inx) ~]
=/ =fill [%0 syd lobe.i.need.sat] =/ =fill [%0 syd lobe]
(emit hen %pass wire %a %plea her %c path fill) (emit hen %pass wire %a %plea her %c path fill)
..abet(busy.sat &, scry.sat time) ..abet(busy.sat &, scry.sat time)
:: ::
@ -4853,11 +4851,7 @@
%- ~(run by bom.u.ref.rede-10) %- ~(run by bom.u.ref.rede-10)
|= update-state-10 |= update-state-10
^- update-state ^- update-state
::NOTE putting / paths is fine, the path is only used [duct rave ~ have need nako busy]
:: when dealing with scry responses
::TODO but that isn't actually true, is it? we might fall back to
:: scry in the middle, right?
[duct rave ~ have (turn need (corl (lead *@da) (lead /))) nako busy]
-- --
:: ::
++ scry :: inspect ++ scry :: inspect