]> dgit.raspbian.org Git - git-annex.git/commit
remove dead nodes when loading the cluster log
authorJoey Hess <joeyh@joeyh.name>
Sun, 16 Jun 2024 18:35:07 +0000 (14:35 -0400)
committerJoey Hess <joeyh@joeyh.name>
Sun, 16 Jun 2024 18:39:44 +0000 (14:39 -0400)
commit780367200b14d532f745079dfa09ffaa214d0a84
treeaf0408574f6008184b8398a083ddd6c2a707604a
parent36c6d8da6972280618545a11c30013a52147b6ab
remove dead nodes when loading the cluster log

This is to avoid inserting a cluster uuid into the location log when
only dead nodes in the cluster contain the content of a key.

One reason why this is necessary is Remote.keyLocations, which excludes
dead repositories from the list. But there are probably many more.

Implementing this was challenging, because Logs.Location importing
Logs.Cluster which imports Logs.Trust which imports Remote.List resulted
in an import cycle through several other modules.

Resorted to making Logs.Location not import Logs.Cluster, and instead
it assumes that Annex.clusters gets populated when necessary before it's
called.

That's done in Annex.Startup, which is run by the git-annex command
(but not other commands) at early startup in initialized repos. Or,
is run after initialization.

Note that is Remote.Git, it is unable to import Annex.Startup, because
Remote.Git importing Logs.Cluster leads the the same import cycle.
So ensureInitialized is not passed annexStartup in there.

Other commands, like git-annex-shell currently don't run annexStartup
either.

So there are cases where Logs.Location will not see clusters. So it won't add
any cluster UUIDs when loading the log. That's ok, the only reason to do
that is to make display of where objects are located include clusters,
and to make commands like git-annex get --from treat keys as being located
in a cluster. git-annex-shell certainly does not do anything like that,
and I'm pretty sure Remote.Git (and callers to Remote.Git.onLocalRepo)
don't either.
18 files changed:
Annex/Action.hs
Annex/Init.hs
Annex/Startup.hs [new file with mode: 0644]
Assistant/MakeRepo.hs
CmdLine.hs
CmdLine/GitRemoteAnnex.hs
Command.hs
Command/Assistant.hs
Command/ConfigList.hs
Command/Init.hs
Command/Reinit.hs
Command/Upgrade.hs
Logs/Cluster.hs
Logs/Location.hs
Remote/Git.hs
Types/Cluster.hs
doc/todo/git-annex_proxies.mdwn
git-annex.cabal