From 48978bd940ae92c9ee43ede5e6dd176402284cf6 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Wed, 14 Dec 2022 12:46:36 -0600 Subject: [PATCH 1/7] group-store: allow rebuilding --- pkg/landscape/app/group-store.hoon | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/landscape/app/group-store.hoon b/pkg/landscape/app/group-store.hoon index 7e26a80ff..b373024d6 100644 --- a/pkg/landscape/app/group-store.hoon +++ b/pkg/landscape/app/group-store.hoon @@ -140,6 +140,7 @@ ?+ q.vase !! %migrate poke-migrate:gc %export poke-export:gc + %rebuild poke-rebuild:gc == :: ?(%group-update-0 %group-action) @@ -235,6 +236,18 @@ :: |_ bol=bowl:gall +* io ~(. agentio bol) +++ poke-rebuild + ^- (quip card _state) + =/ wex ~(tap by wex.bol) + |- + ?~ wex + `state + =/ [[=wire =ship =term] [acked=? =(pole knot)]] + i.wex + ?. ?=([%gladio ship=@ ~] pole) + $(wex t.wex) + $(wex t.wex, wait (~(put in wait) (slav %p ship.pole))) +:: ++ poke-export ^- (quip card _state) :_ state @@ -256,6 +269,8 @@ ^- card [%pass /gladio/(scot %p ship) %agent [ship %groups] %watch /init] :: + +:: ++ backoff-migrate |= =ship ^- card From 4df4a16881085b8896db1400536731e9f2de5e65 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Wed, 14 Dec 2022 13:29:17 -0600 Subject: [PATCH 2/7] group-store: add %rebuild poke --- pkg/landscape/app/group-store.hoon | 41 ++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/pkg/landscape/app/group-store.hoon b/pkg/landscape/app/group-store.hoon index b373024d6..c7c429a55 100644 --- a/pkg/landscape/app/group-store.hoon +++ b/pkg/landscape/app/group-store.hoon @@ -238,15 +238,36 @@ +* io ~(. agentio bol) ++ poke-rebuild ^- (quip card _state) - =/ wex ~(tap by wex.bol) - |- - ?~ wex - `state - =/ [[=wire =ship =term] [acked=? =(pole knot)]] - i.wex - ?. ?=([%gladio ship=@ ~] pole) - $(wex t.wex) - $(wex t.wex, wait (~(put in wait) (slav %p ship.pole))) + |^ + =. wait + put-missing + =^ cards state + watch-missing + [cards state] + :: + ++ watch-missing + =/ wait ~(tap in wait) + =| cards=(list card) + |- + ?~ wait + [cards state] + ?: (~(has by wex.bol) [/gladio/(scot %p i.wait) i.wait dap.bol]) + $(wait t.wait) + =. cards + :_(cards (watch-init-migrate i.wait)) + $(wait t.wait) + :: + ++ put-missing + =/ wex ~(tap by wex.bol) + |- + ?~ wex + wait + =/ [[=wire =ship =term] [acked=? =(pole knot)]] + i.wex + ?. ?=([%gladio ship=@ ~] pole) + $(wex t.wex) + $(wex t.wex, wait (~(put in wait) (slav %p ship.pole))) + -- :: ++ poke-export ^- (quip card _state) @@ -269,8 +290,6 @@ ^- card [%pass /gladio/(scot %p ship) %agent [ship %groups] %watch /init] :: - -:: ++ backoff-migrate |= =ship ^- card From 4e3698f327c6749e5be750d28f2a91ddec598487 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Tue, 3 Jan 2023 17:47:26 -0600 Subject: [PATCH 3/7] group-store: instead of only watching missing, restart any migration subscriptions that might be bad --- pkg/landscape/app/group-store.hoon | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/landscape/app/group-store.hoon b/pkg/landscape/app/group-store.hoon index 16e66fe35..2eb5f3d9c 100644 --- a/pkg/landscape/app/group-store.hoon +++ b/pkg/landscape/app/group-store.hoon @@ -242,19 +242,22 @@ =. wait put-missing =^ cards state - watch-missing + rewatch [cards state] :: - ++ watch-missing + ++ rewatch =/ wait ~(tap in wait) =| cards=(list card) |- ?~ wait [cards state] - ?: (~(has by wex.bol) [/gladio/(scot %p i.wait) i.wait dap.bol]) - $(wait t.wait) + =/ wir /gladio/(scot %p i.wait) =. cards :_(cards (watch-init-migrate i.wait)) + :: if we have a subscription already, leave first to restart + =? cards + (~(has by wex.bol) [wir i.wait dap.bol]) + :_(cards [%pass wir %agent [our.bol dap.bol] %leave ~]) $(wait t.wait) :: ++ put-missing From 264678a908fa4e913aad28259ee5eff47e6f39a4 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Tue, 3 Jan 2023 18:17:02 -0600 Subject: [PATCH 4/7] group-store: correct target --- pkg/landscape/app/group-store.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/landscape/app/group-store.hoon b/pkg/landscape/app/group-store.hoon index 2eb5f3d9c..b41645948 100644 --- a/pkg/landscape/app/group-store.hoon +++ b/pkg/landscape/app/group-store.hoon @@ -257,7 +257,7 @@ :: if we have a subscription already, leave first to restart =? cards (~(has by wex.bol) [wir i.wait dap.bol]) - :_(cards [%pass wir %agent [our.bol dap.bol] %leave ~]) + :_(cards [%pass wir %agent [i.wait %groups] %leave ~]) $(wait t.wait) :: ++ put-missing From 936835cd0c2cba5f513c888456d4244b5eb6dc47 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Tue, 3 Jan 2023 18:50:05 -0600 Subject: [PATCH 5/7] groups-store: fixing wire check for leaves --- pkg/landscape/app/group-store.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/landscape/app/group-store.hoon b/pkg/landscape/app/group-store.hoon index b41645948..5efa484c6 100644 --- a/pkg/landscape/app/group-store.hoon +++ b/pkg/landscape/app/group-store.hoon @@ -256,8 +256,8 @@ :_(cards (watch-init-migrate i.wait)) :: if we have a subscription already, leave first to restart =? cards - (~(has by wex.bol) [wir i.wait dap.bol]) - :_(cards [%pass wir %agent [i.wait %groups] %leave ~]) + (~(has by wex.bol) [wir i.wait %groups]) + :_(cards [%pass wir %agent [i.wait %groups] %leave ~]) $(wait t.wait) :: ++ put-missing From 563aed6b7f0c8eba06174885b275d0054158b551 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Wed, 4 Jan 2023 11:17:44 -0600 Subject: [PATCH 6/7] group-store: automatically run rebuild on load --- pkg/landscape/app/group-store.hoon | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/landscape/app/group-store.hoon b/pkg/landscape/app/group-store.hoon index 5efa484c6..6b3bfc9f6 100644 --- a/pkg/landscape/app/group-store.hoon +++ b/pkg/landscape/app/group-store.hoon @@ -84,7 +84,10 @@ =| cards=(list card) |^ ?- -.old - %3 [(flop cards) this(state old)] + %3 + :_ this(state old) + :_ cards + [%pass /pyre/rebuild %agent [our dap]:bowl %poke noun+!>(%rebuild)] :: %2 %_ $ From 9316aebec75558203d065f2c3576dbfafe1776d2 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Wed, 4 Jan 2023 12:40:18 -0600 Subject: [PATCH 7/7] group-store: only run rebuild once --- pkg/landscape/app/group-store.hoon | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pkg/landscape/app/group-store.hoon b/pkg/landscape/app/group-store.hoon index 6b3bfc9f6..bd4dcf982 100644 --- a/pkg/landscape/app/group-store.hoon +++ b/pkg/landscape/app/group-store.hoon @@ -41,6 +41,7 @@ state-one state-two state-three + state-four == :: +$ state-zero @@ -61,9 +62,15 @@ =groups wait=(set ship) == +:: ++$ state-four + $: %4 + =groups + wait=(set ship) + == -- :: -=| state-three +=| state-four =* state - :: %- agent:dbug @@ -84,10 +91,15 @@ =| cards=(list card) |^ ?- -.old - %3 - :_ this(state old) - :_ cards - [%pass /pyre/rebuild %agent [our dap]:bowl %poke noun+!>(%rebuild)] + %4 [(flop cards) this(state old)] + :: + %3 + %_ $ + old [%4 +.old] + cards + :_ cards + [%pass /pyre/rebuild %agent [our dap]:bowl %poke noun+!>(%rebuild)] + == :: %2 %_ $ @@ -391,8 +403,8 @@ |= arc=* ^- (quip card _state) |^ - =/ sty=state-three - [%3 (remake-groups ;;((tree [resource tree-group]) +.arc)) ~] + =/ sty=state-four + [%4 (remake-groups ;;((tree [resource tree-group]) +.arc)) ~] :_ sty %+ roll ~(tap by groups.sty) |= [[rid=resource grp=group] out=(list card)]