added reposize database

The idea is that upon a merge of the git-annex branch, or a commit to
the git-annex branch, the reposize database will be updated. So it
should always accurately reflect the location log sizes, but it will
often be behind the actual current sizes.

Annex.reposizes will start with the value from the database, and get
updated with each transfer, so it will reflect a process's best
understanding of the current sizes.

When there are multiple processes all transferring to the same repo,
Annex.reposize will not reflect transfers made by the other processes
since the current process started. So when using balanced preferred
content, it may make suboptimal choices, including trying to transfer
content to the repo when another process has already filled it up.
But this is the same as if there are multiple processes running on
ifferent machines, so is acceptable. The reposize will eventually
get an accurate value reflecting changes made by other processes or in
other repos.
This commit is contained in:
Joey Hess 2024-08-12 11:19:58 -04:00
parent 71043fe9f7
commit 99a126bebb
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 130 additions and 14 deletions

View file

@ -14,6 +14,7 @@ module Database.Queue (
closeDbQueue,
flushDbQueue,
QueueSize,
LastCommitTime,
queueDb,
) where