fix sizebalanced empty size bug
Fix bug that prevented anything being stored in an empty repository whose preferred content expression uses sizebalanced.
This commit is contained in:
parent
1aacf7ece4
commit
5a4bee24b8
3 changed files with 13 additions and 2 deletions
|
@ -9,6 +9,8 @@ git-annex (10.20240832) UNRELEASED; urgency=medium
|
||||||
* sim: New command, can be used to simulate networks of repositories
|
* sim: New command, can be used to simulate networks of repositories
|
||||||
and see how preferred content and other configuration makes file
|
and see how preferred content and other configuration makes file
|
||||||
content flow through it.
|
content flow through it.
|
||||||
|
* Fix bug that prevented anything being stored in an empty
|
||||||
|
repository whose preferred content expression uses sizebalanced.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Tue, 03 Sep 2024 12:38:42 -0400
|
-- Joey Hess <id@joeyh.name> Tue, 03 Sep 2024 12:38:42 -0400
|
||||||
|
|
||||||
|
|
4
Limit.hs
4
Limit.hs
|
@ -736,8 +736,8 @@ filterCandidatesFullySizeBalanced
|
||||||
filterCandidatesFullySizeBalanced maxsizes sizemap n key candidates = do
|
filterCandidatesFullySizeBalanced maxsizes sizemap n key candidates = do
|
||||||
currentlocs <- S.fromList <$> loggedLocations key
|
currentlocs <- S.fromList <$> loggedLocations key
|
||||||
let keysize = fromMaybe 0 (fromKey keySize key)
|
let keysize = fromMaybe 0 (fromKey keySize key)
|
||||||
let go u = case (M.lookup u maxsizes, M.lookup u sizemap, u `S.member` currentlocs) of
|
let go u = case (M.lookup u maxsizes, fromMaybe (RepoSize 0) (M.lookup u sizemap), u `S.member` currentlocs) of
|
||||||
(Just maxsize, Just reposize, inrepo)
|
(Just maxsize, reposize, inrepo)
|
||||||
| repoHasSpace keysize inrepo reposize maxsize ->
|
| repoHasSpace keysize inrepo reposize maxsize ->
|
||||||
proportionfree keysize inrepo u reposize maxsize
|
proportionfree keysize inrepo u reposize maxsize
|
||||||
| otherwise -> Nothing
|
| otherwise -> Nothing
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
When using sizebalanced preferred content, a `git-annex copy --auto` to a
|
||||||
|
repository that is currently empty will not fill it.
|
||||||
|
|
||||||
|
It seems that getLiveRepoSizes returns a map that does not contain the
|
||||||
|
repo's UUID, and filterCandidatesFullySizeBalanced filters out repos that
|
||||||
|
are not in the map.
|
||||||
|
--[[Joey]]
|
||||||
|
|
||||||
|
> [[fixed|done]] --[[Joey]]
|
Loading…
Reference in a new issue