checkPresent of compute remote checks inputs are available

If an input file has been lost from all repositories, it is no longer
possible to compute the output. This will avoid dropping content that
was computed in such a situation, as well as making git-annex fsck --from
the compute remote do its usual thing when content has gone missing.

This implementation avoids recursing forever if there is a cycle,
which should not be possible anyway.

Note the use of RemoteStateHandle as a constructor here suggests that
this may not handle sameas remotes right, since usually a
RemoteStateHandle is constructed using the sameas uuid for a sameas
remote. That assumes a compute remote can even have or be a sameas remote.
Which doesn't seem to make sense, so I have not thought through what might
happen here in detail.
This commit is contained in:
Joey Hess 2025-03-18 13:55:33 -04:00
parent 2466677b7b
commit 70cb93a66b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 68 additions and 38 deletions

View file

@ -42,15 +42,3 @@ compute special remote. --[[Joey]]
Or it could build a DAG and traverse it, but building a DAG of a large
directory tree has its own problems.
* Should checkPresent check that each input file is also present in some
(non-dead) repo?
Currently it only checks if compute state is recorded. The problem
this additional checking would solve is if an input file gets lost,
then a computation cannot be run again.
Should it be an active check against existing remotes, or a
passive check? An active check certainly makes sense if the input
file is itself present in a compute repo, either the same one or a
different one. Otherwise, a passive check seems enough.