I've got a repo on my laptop to which I copied some files in order to store it in the cold storage. All repos of the cold storage are in the same group and wanted/required expressions are set up such that the group wants exactly one copy.
This has been working fine but now after I copied the keys, I'm in the situation where running git annex sync --content --all
in the repo on the laptop doesn't drop the keys that now have a copy in the cold storage group.
numcopies=3 and there are 4 trusted copies (including the laptop), so that should work.
The laptop repo wants groupwanted or not copies=cold:1
.
groupwanted expressions:
groupwanted hot = ((not copies=hot:1) or (not copies=cold:1) or (not copies=cold:1 and unused)) or ((not copies=lukewarm:1) or (approxlackingcopies=1))
groupwanted client = (approxlackingcopies=1)
groupwanted cold = (not copies=cold:1) or (not copies=cold:1 and unused)
groupwanted lukewarm = (not copies=cold:1) or (not copies=lukewarm:1) or (approxlackingcopies=1)
(I need to clean these up, I know.)
There's one copy in client (laptop), hot, cold, and lukewarm and all of them are either reachable or trusted.
I could drop stuff manually of course but the next sync would try to get them again, so that's no good.
How can I figure out why a certain repo wants a certain key? I currently don't even know whether it's numcopies somehow or the wanted expression and then also which expression causes it.
One way I just thought of for the latter part would be to evaluate the individual expressions for some key to see whether they match. I've done that in my head of course and came to the conclusion that it shouldn't be wanted but I'd like the logic inside git-annex to tell me what actually happens. I effectively need a way to debug wanted expressions.
Is there a way to evaluate an arbitrary wanted expression to a boolean given a key?
git-annex version: 10.20240927
--explain
,--want-get
,--want-drop
) but I couldn't figure out how to hold these flags correctly.My issue apparently had to do with numcopies? I first passed
--numcopies 2
because I was curious but it didn't change anything. Then I passed--numcopies 1
and it immediately dropped all the files as I'd have expected it to atnumcopies=3
. Running another sync without--numcopies
didn't attempt to pull in the dropped files either.This smells like a bug? If numcopies was actually violated, it should attempt to correct that again, right? (All files were available from a connected repo.)
Here are the numcopies stats from
git annex info .
:Some more background: I have a bunch of drives that are offline that I have set to be trusted. One repo on my NAS is online at all times and semitrusted.
I have two offline groups:
cold
andlukewarm
. All drives in those groups are trusted.It's weird that it didn't work with 2 but did work with 1. This leads me to believe it could have been due to the one repo being online while the others are offline and trusted; acting more like mincopies. Was behaviour changed in this regard recently?
I'd still like to know how to debug wanted expressions too though.