git-annex/doc/bugs/git-annex_branch_caching_bug.mdwn
Joey Hess 653b719472
fix --all to include not yet committed files from the journal
Fix bug caused by recent optimisations that could make git-annex not see
recently recorded status information when configured with
annex.alwayscommit=false.

This does mean that --all can end up processing the same key more than once,
but before the optimisations that introduced this bug, it used to also behave
that way. So I didn't try to fix that; it's an edge case and anyway git-annex
behaves well when run on the same key repeatedly.

I am not too happy with the use of a MVar to buffer the list of files in the
journal. I guess it doesn't defeat lazy streaming of the list, if that
list is actually generated lazily, and anyway the size of the journal is
normally capped and small, so if configs are changed to make it huge and
this code path fire, git-annex using enough memory to buffer it all is not a
large problem.
2021-04-21 15:40:32 -04:00

22 lines
835 B
Markdown

If the journal contains a newer version of a log file than the git-annex
branch, and annex.alwayscommit=false so the branch is not getting updated,
the value from the journal can be ignored when reading that log file.
In CmdLine.Seek, there is some code that precaches location logs as an
optimisation (when using eg --copies). That streams info from the
git-annex branch into the cache. But it never checks for a journal file
with newer information.
> fixed this
Also in Cmdline.Seek, there is a LsTreeRecursive over the branch to handle
`--all`, and I think again that would mean it doesn't notice location
logs that are only in the journal.
Before that optimisation, it was using Logs.Location.loggedKeys,
which does look at the journal.
> fixed
(This is also a blocker for [[todo/hiding_a_repository]].)
[[done]] --[[Joey]]