Skip to content
Closed
2 changes: 1 addition & 1 deletion pkg/arvo/gen/hood/mate.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
::
/? 310
:- %say
|=([^ [who=(unit ship) ~] dry=_& ~] helm-mass-mate/who^dry)
|=([^ [who=(unit ship) ~] ~] helm-mass-mate/who)
64 changes: 48 additions & 16 deletions pkg/arvo/lib/hood/helm.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -193,27 +193,33 @@
%helm-hi !>(mes)
==
::
++ poke-send-ahoy
|= [her=ship test=? force=?] =< abet
++ poke-start-ahoy
|= [her=ship test=? force-test=?] =< abet
=/ =wire
:+ %helm %ahoy
?.(test /(scot %p her) /test/(scot %p her))
=/ =path ?:(test /test/mesa-1 /mesa-1)
:: before migrating, test if we can migrate, regress, and check that there
:: are not flows in a weird state. if we don't crash, send the %ahoy $plea
:: are not flows in a weird state. if we get a [%done ~], send the %ahoy $plea
::
=^ mate-moves sat
?. force `sat
(poke-mass-mate `her test=%.y)
=^ ahoy-moves sat abet:(emit %pass wire %arvo %a %plea her %$ path %ahoy ~)
(emil (weld mate-moves ahoy-moves))
?. force-test
:: skip test, ahoy right away; only for certain cases in ames.hoon
::
(emit %pass wire %arvo %a %plea her %$ path %ahoy ~)
:: wait for the %done of the local %mate
::
=^ mate-moves sat %*($ poke-mass-mate dry test, +< `her)
(emil mate-moves)
::
++ poke-mass-mate
|= [ship=(unit ship) dry=?]
=| dry=?
|= ship=(unit ship)
=/ =wire
:+ %helm %mate
?.(dry ~ /test)
abet:(emit %pass wire %arvo %a %mate ship dry)
?~ ship /test
?: dry /test/(scot %p u.ship)
/(scot %p u.ship)
abet:(emit %pass wire %arvo %a %mate ship dry=%.y)
::
++ poke-mass-rege
|= [ship=(unit ship) dry=?]
Expand All @@ -222,19 +228,41 @@
?.(dry ~ /test)
abet:(emit %pass wire %arvo %a %rege ship dry)
::
++ take-test-mate
|= [way=wire error=(unit error:ames)]
=/ =path
?:(?=([%test her=@ ~] way) /test/mesa-1 /mesa-1)
=/ her=@p
?: ?=([%test her=@ ~] way)
(slav %p i.t.way)
?> ?=([her=@ ~] way)
(slav %p i.way)
?^ error
~& >>> %local-migration-failed
abet
~& > %local-migration-worked
abet:(emit %pass [%helm %ahoy way] %arvo %a %plea her %$ path %ahoy ~)
::
++ take-migrate
|= [way=wire error=(unit error:ames)]
?^ error
~& >>> %local-migration-failed
abet
~& > %local-migration-worked
abet
::
++ take-ahoy
|= [way=wire error=(unit error:ames)]
?: ?=([%test @ *] way)
?~ error
~& > %migration-test-worked
~& >> %test-local-migration
abet:(emit %pass /helm/migrate %arvo %a %mate (slaw %p i.t.way) dry=%.y)
abet
%- (slog %take-ahoy-test-failed u.error)
abet
?> ?=([@ ~] way)
?~ error
~& > %remote-migration-worked
~& >> %try-local-migration
~& >> %do-local-migration
abet:(emit %pass /helm/migrate %arvo %a %mate (slaw %p i.way) dry=%.n)
~& >>> %ahoy-crash
:: XX retry?
Expand All @@ -247,7 +275,7 @@
|= [way=wire error=(unit tang)]
?> ?=([@ ~] way)
?~ error
(poke-send-ahoy (slav %p i.way) | force=&)
(poke-start-ahoy (slav %p i.way) | force=&)
~& >>> %ahoy-wake-crash
:: XX retry?
::
Expand Down Expand Up @@ -683,7 +711,7 @@
%helm-pass =;(f (f !<(_+<.f vase)) poke-pass)
%helm-rekey =;(f (f !<(_+<.f vase)) poke-rekey)
%helm-send-hi =;(f (f !<(_+<.f vase)) poke-send-hi)
%helm-send-ahoy =;(f (f !<(_+<.f vase)) poke-send-ahoy)
%helm-send-ahoy =;(f (f !<(_+<.f vase)) poke-start-ahoy)
%helm-mass-mate =;(f (f !<(_+<.f vase)) poke-mass-mate)
%helm-send-rege =;(f (f !<(_+<.f vase)) poke-send-rege)
%helm-mass-rege =;(f (f !<(_+<.f vase)) poke-mass-rege)
Expand Down Expand Up @@ -719,6 +747,10 @@
?>(?=(%wake +<.sign-arvo) +>.sign-arvo)
[%ahoy *] %+ take-ahoy t.wire
?>(?=(%done +<.sign-arvo) +>.sign-arvo)
[%mate *] %+ take-test-mate t.wire
?>(?=(%done +<.sign-arvo) +>.sign-arvo)
[%migrate *] %+ take-migrate t.wire
?>(?=(%done +<.sign-arvo) +>.sign-arvo)
[%rege *] %+ take-rege t.wire
?>(?=(%done +<.sign-arvo) +>.sign-arvo)
[%ahoy-crash *] %+ take-ahoy-crash t.wire
Expand Down
48 changes: 22 additions & 26 deletions pkg/arvo/sys/vane/ames.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -4199,6 +4199,8 @@
?+ -.task
(on-crud:event-core -.task tang.u.dud)
%hear (on-hear:event-core lane.task blob.task dud)
%mate %- emit:event-core
[duct %give %done [~ %migration-failed tang.u.dud]]
==
::
?+ -.task !! :: XX mesa tasks; no-op?
Expand All @@ -4219,12 +4221,14 @@
%wham (on-cancel-scry:event-core & +.task)
%whey !! :: XX TODO
::
%mate ?. dry.task (on-mate:event-core +.task)
%mate ?. dry.task
(emit:(on-mate:event-core +.task) duct %give %done ~)
?^ +<.task
~| %dry-migration-failed^u.+<.task
?> (on-mate-test:event-core u.+<.task)
~& > %dry-migration-worked^u.+<.task
event-core
%- emit:event-core
:^ duct %give %done
?: (on-mate-test:event-core u.+<.task)
~
[~ %dry-migration-failed ~]
~& >>
"test migration of {<~(wyt by peers.ames-state)>} peers"
=/ [failed=@ test=?]
Expand Down Expand Up @@ -5062,9 +5066,8 @@
:: namespace that they have migrated us?
:: XX requires a namespace for migrated peers?
::
:: %- %^ ev-trace sun.veb ship.deep
:: |.("migrating to |mesa")
~& >> "migrating to |mesa"
%- %^ ev-trace sun.veb ship.deep
|.("migrating to |mesa")
:: before migrating check that we can migrate this peer without
:: crashing. if so, we will nack the %ahoy $plea.
::
Expand Down Expand Up @@ -5419,11 +5422,7 @@
|= [ship=(unit ship) dry=?]
|^ ^+ event-core
=; updated-core=_event-core
?: dry
~& > test-local-migration-worked/ship
event-core
~& > local-migration-worked/ship
updated-core
?:(dry event-core updated-core)
::
?~ ship
(~(rep by peers.ames-state) migrate-peer)
Expand Down Expand Up @@ -6059,7 +6058,6 @@
==
=^ poke-moves fren (make-flows fren)
=^ peek-moves ames-state (make-peeks fren)
~& > %migration-done^her
:: XX needed? peek/poke-moves will have %send moves already
::
:: enqueue a %prod to start sending unsent messages, after
Expand Down Expand Up @@ -6108,8 +6106,7 @@
::
?: =(%2 (mod bone 4))
:: XX this shouldn't exist
~? >>> odd.veb.bug.ames-state
weird-naxp-ack-bone/bone=bone
~& >>> weird-naxp-ack-bone/bone=bone
moves^fren
=/ naxp-bone=? =(%3 (mod bone 4))
=/ original-bone bone
Expand Down Expand Up @@ -6295,7 +6292,7 @@
:: naxplanation of this message to increase current,
::
:: XX this assertion exists to catch any possible flow in a
:: weird state that we have not found a explanation and will
:: weird state that we have not found an explanation and will
:: requiere further inspecting
::
?> ?& (~(has by queued-message-acks.pump) +(current.pump))
Expand Down Expand Up @@ -6330,7 +6327,7 @@
::
:: live packets in packet-pump-state are reconstructed; the
:: receiver will droppped any partially received fragments
:: so the full message will need to be resent.
:: so the full message will need to be resend.
::
=/ live=(list [=message-num message])
=+ queue=((on ,@ud message-blob) lte)
Expand Down Expand Up @@ -7699,9 +7696,8 @@
::
?> (on-mate-test her)
::
:: %- %^ ev-trace sun.veb her
:: |.("migrating {<her>} test succeded")
~& > "testing dry migration {<her>} succeded"
%- %^ ev-trace sun.veb her
|.("migrating {<her>} test succeded")
::
(done ok=%.y)
=. peer-core
Expand Down Expand Up @@ -11464,11 +11460,7 @@
|= [ship=(unit ship) dry=?]
|^ ^+ sy-core
=; updated-core=_sy-core
?: dry
~& > test-local-regression-worked/ship
sy-core
~& > local-regression-worked/ship
updated-core
?:(dry sy-core updated-core)
::
?~ ship
(~(rep by chums.ames-state) regress-chum)
Expand Down Expand Up @@ -13641,6 +13633,10 @@
++ load
|= state=axle
~> %spin.['load/ames']
:: =. peers.state
:: (~(del by peers.state) ~nec)
:: =. chums.state
:: (~(del by chums.state) ~nec)
vane-gate(ames-state state)
:: +scry: dereference namespace
::
Expand Down
Loading