mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-25 07:52:59 +03:00
hood: fix update ordering
When we receive the %mere gift from clay, the kernel has not yet been reloaded. This means any attempts to bump desks will fail, as they will be bumped against the old kernel. Rectifies this by continuing the %base desk update flow in +on-load, instead of +take-merge-main. Also adds a wef=(unit weft) to the state in order to discriminate whether or not the kernel has just been reloaded
This commit is contained in:
parent
83be5162ed
commit
39a9ed4faa
@ -2,8 +2,8 @@
|
||||
/+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln
|
||||
|%
|
||||
+$ state
|
||||
$~ [%18 *state:drum *state:helm *state:kiln]
|
||||
$>(%18 any-state)
|
||||
$~ [%19 *state:drum *state:helm *state:kiln]
|
||||
$>(%19 any-state)
|
||||
::
|
||||
+$ any-state
|
||||
$% [ver=?(%1 %2 %3 %4 %5 %6) lac=(map @tas fin-any-state)]
|
||||
@ -19,6 +19,7 @@
|
||||
[%16 drum=state-4:drum helm=state:helm kiln=state-3:kiln]
|
||||
[%17 drum=state-4:drum helm=state:helm kiln=state-4:kiln]
|
||||
[%18 drum=state-4:drum helm=state:helm kiln=state-5:kiln]
|
||||
[%19 drum=state-4:drum helm=state:helm kiln=state-6:kiln]
|
||||
==
|
||||
+$ any-state-tuple
|
||||
$: drum=any-state:drum
|
||||
|
@ -5,7 +5,8 @@
|
||||
=, format
|
||||
=* dude dude:gall
|
||||
|%
|
||||
+$ state state-5
|
||||
+$ state state-6
|
||||
+$ state-6 [%6 pith-6]
|
||||
+$ state-5 [%5 pith-5]
|
||||
+$ state-4 [%4 pith-4]
|
||||
+$ state-3 [%3 pith-3]
|
||||
@ -14,13 +15,32 @@
|
||||
+$ state-0 [%0 pith-0]
|
||||
+$ any-state
|
||||
$~ *state
|
||||
$% state-5
|
||||
$% state-6
|
||||
state-5
|
||||
state-4
|
||||
state-3
|
||||
state-2
|
||||
state-1
|
||||
state-0
|
||||
==
|
||||
::
|
||||
+$ pith-6
|
||||
$: wef=(unit weft)
|
||||
rem=(map desk per-desk) ::
|
||||
syn=(map kiln-sync let=@ud) ::
|
||||
ark=(map desk arak) ::
|
||||
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
||||
:: map desk to the currently ongoing fuse request
|
||||
:: and the latest version numbers for beaks to
|
||||
fus=(map desk per-fuse)
|
||||
:: used for fuses - every time we get a fuse we
|
||||
:: bump this. used when calculating hashes to
|
||||
:: ensure they're unique even when the same
|
||||
:: request is made multiple times.
|
||||
hxs=(map desk @ud)
|
||||
== ::
|
||||
::
|
||||
|
||||
+$ pith-5
|
||||
$: rem=(map desk per-desk) ::
|
||||
syn=(map kiln-sync let=@ud) ::
|
||||
@ -253,13 +273,19 @@
|
||||
|= a=arak-4
|
||||
^- arak
|
||||
[[paused=| ship desk aeon] next rein]:a
|
||||
=? old ?=(%5 -.old)
|
||||
[%6 ~ +.old]
|
||||
::
|
||||
?> ?=(%5 -.old)
|
||||
?> ?=(%6 -.old)
|
||||
=. +<+.$.abet old
|
||||
=< abet
|
||||
?~ old-ota
|
||||
kiln
|
||||
abet:(install:vats %base [her sud]:u.old-ota)
|
||||
=? kiln ?=(^ old-ota)
|
||||
abet:(install:vats %base [her sud]:u.old-ota)
|
||||
=? kiln ?=(^ wef)
|
||||
=/ except=(set desk) (sy %base %kids ~)
|
||||
(bump:vats u.wef (all-desks-but:vats except) %.n)
|
||||
=. wef ~
|
||||
kiln
|
||||
::
|
||||
++ on-peek
|
||||
|= =path
|
||||
@ -479,7 +505,7 @@
|
||||
=/ ded (find-blocked kel except)
|
||||
?: force
|
||||
=. kiln (suspend-many ded)
|
||||
(bump-many kel (all-desks-but except))
|
||||
(bump-many kel (all-desks-but (~(uni in except) ded)))
|
||||
?: =(~ ded)
|
||||
(bump-many kel (all-desks-but except))
|
||||
=- (^emit (pyre:pass leaf/- ~))
|
||||
@ -496,6 +522,7 @@
|
||||
|= dead=(set desk)
|
||||
^+ kiln
|
||||
=/ ded ~(tap in dead)
|
||||
|
||||
|- ^+ kiln
|
||||
?~ ded kiln
|
||||
$(ded t.ded, kiln abet:(suspend i.ded))
|
||||
@ -598,9 +625,19 @@
|
||||
(emil sync-ud:pass (diff:give diff) ~)
|
||||
?: (lth num.new-weft num.old-weft)
|
||||
~> %slog.0^leaf/"kiln: future version {<new-weft>}, enqueueing"
|
||||
:: retry upgrade if not blocked anymore
|
||||
=/ base=arak (~(got by ark) %base)
|
||||
=. next.rak (snoc next.rak [(dec aeon.rail.rak) new-weft])
|
||||
=. ark (~(put by ark) loc rak)
|
||||
=/ =diff [%block loc rak new-weft blockers=(sy %base ~)]
|
||||
(emil sync-ud:pass (diff:give diff) ~)
|
||||
=. vats (emil sync-ud:pass (diff:give diff) ~)
|
||||
?. &(?=(^ next.base) =(~ (get-blockers weft.i.next.base)))
|
||||
vats
|
||||
~> %slog.0^leaf/"kiln: unblocked system update, updating"
|
||||
=. kiln
|
||||
(bump-one weft.i.next.base %base)
|
||||
vats
|
||||
::
|
||||
~> %slog.0^leaf/"kiln: merging into {here}"
|
||||
=. next.rak +:(crank-next %& (dec aeon.rail.rak))
|
||||
(emil ~[merge-main sync-ud]:pass)
|
||||
@ -617,6 +654,9 @@
|
||||
(emil sync-ud:pass (diff:give diff) ~)
|
||||
~> %slog.0^leaf/"kiln: applying OTA to {here}, kelvin: {<new-weft>}"
|
||||
=. next.rak +:(crank-next %& (dec aeon.rail.rak))
|
||||
=. wef
|
||||
?: =(old-weft new-weft) ~
|
||||
`new-weft
|
||||
(emil ~[merge-main sync-ud]:pass)
|
||||
::
|
||||
++ take-merge-main
|
||||
@ -639,8 +679,7 @@
|
||||
(update-running-apps (get-apps-diff our loc now rein.rak))
|
||||
?. =(%base loc)
|
||||
vats
|
||||
=/ except=(set desk) (sy %base %kids ~)
|
||||
=. kiln (bump-many zuse/zuse (all-desks-but except))
|
||||
~> %slog.0^leaf/"kiln: bumping {<zuse>}"
|
||||
(emit merge-kids:pass)
|
||||
::
|
||||
++ take-merge-kids
|
||||
@ -774,7 +813,10 @@
|
||||
::
|
||||
++ poke-bump
|
||||
|= [except=(set desk) force=?]
|
||||
=/ kel=weft zuse/+(zuse)
|
||||
=/ =arak
|
||||
(~(got by ark) %base)
|
||||
=/ kel=weft
|
||||
?~(next.arak zuse+zuse weft.i.next.arak)
|
||||
abet:(bump:vats kel except force)
|
||||
::
|
||||
++ poke-cancel
|
||||
|
@ -202,11 +202,11 @@
|
||||
kelvin+(numb num.w)
|
||||
==
|
||||
::
|
||||
++ woof
|
||||
|= =rung
|
||||
++ rung
|
||||
|= r=^rung
|
||||
%- pairs
|
||||
:~ aeon+(numb aeon.rung)
|
||||
weft+(weft weft.rung)
|
||||
:~ aeon+(numb aeon.r)
|
||||
weft+(weft weft.r)
|
||||
==
|
||||
::
|
||||
++ rein
|
||||
@ -222,7 +222,7 @@
|
||||
:~ ship+s+(scot %p ship.rail.a)
|
||||
desk+s+desk.rail.a
|
||||
aeon+(numb aeon.rail.a)
|
||||
next+a+(turn next.a woof)
|
||||
next+a+(turn next.a rung)
|
||||
rein+(rein rein.a)
|
||||
==
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user