aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads/Committer.hs
Commit message (Collapse)AuthorAge
* add exporter thread to assistantGravatar Joey Hess2017-09-20
| | | | | | | | | | | | | | | | | | | | | | | This is similar to the pusher thread, but a separate thread because git pushes can be done in parallel with exports, and updating a big export should not prevent other git pushes going out in the meantime. The exportThread only runs at most every 30 seconds, since updating an export is more expensive than pushing. This may need to be tuned. Added a separate channel for export commits; the committer records a commit in that channel. Also, reconnectRemotes records a dummy commit, to make the exporter thread wake up and make sure all exports are up-to-date. So, connecting a drive with a directory special remote export will immediately update it, and getting online will automatically update S3 and WebDAV exports. The transfer queue is not involved in exports. Instead, failed exports are retried much like failed pushes. This commit was sponsored by Ewen McNeill.
* adeiu, MissingHGravatar Joey Hess2017-05-16
| | | | | | | | | | | | | | | | Removed dependency on MissingH, instead depending on the split library. After laying groundwork for this since 2015, it was mostly straightforward. Added Utility.Tuple and Utility.Split. Eyeballed System.Path.WildMatch while implementing the same thing. Since MissingH's progress meter display was being used, I re-implemented my own. Bonus: Now progress is displayed for transfers of files of unknown size. This commit was sponsored by Shane-o on Patreon.
* AssociatedFile newtypeGravatar Joey Hess2017-03-10
| | | | | | To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511 This commit was sponsored by Francois Marier on Patreon.
* Make import --deduplicate and --skip-duplicates only hash once, not twiceGravatar Joey Hess2017-02-09
| | | | | | | | | | | | | | | | | | | | import: --deduplicate and --skip-duplicates were implemented inneficiently; they unncessarily hashed each file twice. They have been improved to only hash once. The new approach is to lock down (minimally) and hash files, and then reuse that information when importing them. This was rather tricky, especially in detecting changes to files while they are being imported. The output of import changed slightly. While before it silently skipped over files with eg --skip-duplicates, now it shows each file as it starts to act on it. Since every file is hashed first thing, it would otherwise not be clear what file import is chewing on. (Actually, it wasn't clear before when any of the duplicates switches were used.) This commit was sponsored by Alexander Thompson on Patreon.
* get, move, copy, mirror: Added --failed switch which retries failed copies/movesGravatar Joey Hess2016-08-03
| | | | | | | | | Note that get --from foo --failed will get things that a previous get --from bar tried and failed to get, etc. I considered making --failed only retry transfers from the same remote, but it was easier, and seems more useful, to not have the same remote requirement. Noisy due to some refactoring into Types/
* Preserve execute bits of unlocked files in v6 mode.Gravatar Joey Hess2016-04-14
| | | | | | | | | | | | | | When annex.thin is set, adding an object will add the execute bits to the work tree file, and this does mean that the annex object file ends up executable. This doesn't add any complexity that wasn't already present, because git annex add of an executable file has always ingested it so that the annex object ends up executable. But, since an annex object file can be executable or not, when populating an unlocked file from one, the executable bit is always added or removed to match the mode of the pointer file.
* make sync aware of adjusted branchesGravatar Joey Hess2016-02-29
| | | | | | | | | | So, it will pull and push the original branch, not the adjusted one. And, for merging, it will use updateAdjustedBranch (not implemented yet). Note that remaining uses of Git.Branch.current need to be checked too; for things that should act on the original branch, and not the adjusted branch.
* avoid confusing git with a modified ctime in clean filterGravatar Joey Hess2016-01-07
| | | | | | | Linking the file to the tmp dir was not necessary in the clean filter, and it caused the ctime to change, which caused git to think the file was changed. This caused git status to get slow as it kept re-cleaning unchanged files.
* fix OSX buildGravatar Joey Hess2015-12-28
|
* combine PendingAddChanges for the same file into oneGravatar Joey Hess2015-12-22
| | | | | | | | | | | | | In v6 unlocked mode, this fixes a problem that was making eg, echo > file cause the assistant to copy the file to the annex object, instead of hard linking it. That because 2 change events were seen (one for opening the file and one for closing) and processed together the file was then locked down twice. Which meant it had mutiple hard links, and so prevented linkAnnex from hard linking it. There might be scenarios where multiple events come in, but staggered such that a file gets locked down repeatedly, and it would still be copied to the annex object in that case.
* populate unlocked files with newly available content when ingestingGravatar Joey Hess2015-12-22
| | | | | | This can happen when ingesting a new file in either locked or unlocked mode, when some unlocked files in the repo use the same key, and the content was not locally available before.
* finish v6 support for assistantGravatar Joey Hess2015-12-22
| | | | Seems to basically work now!
* refactoringGravatar Joey Hess2015-12-22
| | | | no behavior changes
* wip v6 support for assistantGravatar Joey Hess2015-12-21
| | | | Files are not yet added to v6 repos in unlocked mode.
* move InodeSentinal from direct mode code to its own moduleGravatar Joey Hess2015-12-09
| | | | | Will be used outside of direct mode for v6 unlocked files, and is already used outside of direct mode when adding files to annex.
* add VerifiedCopy data typeGravatar Joey Hess2015-10-08
| | | | | | | | | There should be no behavior changes in this commit, it just adds a more expressive data type and adjusts code that had been passing around a [UUID] or sometimes a Maybe Remote to instead use [VerifiedCopy]. Although, since some functions were taking two different [UUID] lists, there's some potential for me to have gotten it horribly wrong.
* removed all uses of undefined from code baseGravatar Joey Hess2015-04-19
| | | | It's a code smell, can lead to hard to diagnose error messages.
* make segmentXargs preserve orderGravatar Joey Hess2015-04-02
|
* assistant: Committing a whole lot of files at once could overflow ↵Gravatar Joey Hess2015-03-26
| | | | command-line length limits and cause the commit to fail. This only happened when using the assistant in an indirect mode repository.
* add a commentGravatar Joey Hess2015-03-26
|
* sync, assistant: Include repository name in head branch commit message.Gravatar Joey Hess2015-02-11
| | | | | | Note that while the assistant detects changes made to remote names, I left the commit message fixed rather than calculating it after every commit. It doesn't seem worth the CPU to do the latter.
* Repository tuning parameters can now be passed when initializing a ↵Gravatar Joey Hess2015-01-27
| | | | | | | | | | repository for the first time. * init: Repository tuning parameters can now be passed when initializing a repository for the first time. For details, see http://git-annex.branchable.com/tuning/ * merge: Refuse to merge changes from a git-annex branch of a repo that has been tuned in incompatable ways.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* fix some mixed space+tab indentationGravatar Joey Hess2014-10-09
| | | | | | | | | This fixes all instances of " \t" in the code base. Most common case seems to be after a "where" line; probably vim copied the two space layout of that line. Done as a background task while listening to episode 2 of the Type Theory podcast.
* unify exception handling into Utility.ExceptionGravatar Joey Hess2014-08-07
| | | | | | | | | | | | | | | | | | | | Removed old extensible-exceptions, only needed for very old ghc. Made webdav use Utility.Exception, to work after some changes in DAV's exception handling. Removed Annex.Exception. Mostly this was trivial, but note that tryAnnex is replaced with tryNonAsync and catchAnnex replaced with catchNonAsync. In theory that could be a behavior change, since the former caught all exceptions, and the latter don't catch async exceptions. However, in practice, nothing in the Annex monad uses async exceptions. Grepping for throwTo and killThread only find stuff in the assistant, which does not seem related. Command.Add.undo is changed to accept a SomeException, and things that use it for rollback now catch non-async exceptions, rather than only IOExceptions.
* support commit.gpgsignGravatar Joey Hess2014-07-04
| | | | | | | | | | | | | | | | | | | | | Support users who have set commit.gpgsign, by disabling gpg signatures for git-annex branch commits and commits made by the assistant. The thinking here is that a user sets commit.gpgsign intending the commits that they manually initiate to be gpg signed. But not commits made in the background, whether by a deamon or implicitly to the git-annex branch. gpg signing those would be at best a waste of CPU and at worst would fail, or flood the user with gpg passphrase prompts, or put their signature on changes they did not directly do. See Debian bug #753720. Also makes all commits done by git-annex go through a few central control points, to make such changes easier in future. Also disables commit.gpgsign in the test suite. This commit was sponsored by Antoine Boegli.
* assistant: Fix one-way assistant->assistant sync in direct mode.Gravatar Joey Hess2014-06-16
| | | | | | | | | | | | | | When in direct mode, update the master branch after committing to the annex/direct/master branch. Also, update the synced/master branch. This fixes a topology A->B where both A and B are in direct mode and running the assistant, and a change is made to B. Before this fix, A pulled the changes from B, but since they were only on the annex/direct/master branch, it did not merge them. Note that I considered making the assistant merge the remotes/B/annex/direct/master, but decided to keep it simple and only merge the sync branches as before.
* fix for Windows file timestamp timezone madnessGravatar Joey Hess2014-06-12
| | | | | | | | | | | | | | | | | | | | | | On Windows, changing the time zone causes the apparent mtime of files to change. This confuses git-annex, which natually thinks this means the files have actually been modified (since THAT'S WHAT A MTIME IS FOR, BILL <sheesh>). Work around this stupidity, by using the inode sentinal file to detect if the timezone has changed, and calculate a TSDelta, which will be applied when generating InodeCaches. This should add no overhead at all on unix. Indeed, I sped up a few things slightly in the refactoring. Seems to basically work! But it has a big known problem: If the timezone changes while the assistant (or a long-running command) runs, it won't notice, since it only checks the inode cache once, and so will use the old delta for all new inode caches it generates for new files it's added. Which will result in them seeming changed the next time it runs. This commit was sponsored by Vincent Demeester.
* Put non-object tmp files in .git/annex/misctmp, leaving .git/annex/tmp for ↵Gravatar Joey Hess2014-02-26
| | | | | | | | | | | | | | | | | | | | only partially transferred objects. This allows eg, putting .git/annex/tmp on a ram disk, if the disk IO of temp object files is too annoying (and if you don't want to keep partially transferred objects across reboots). .git/annex/misctmp must be on the same filesystem as the git work tree, since files are moved to there in a way that will not work cross-device, as well as symlinked into there. I first wanted to put the tmp objects in .git/annex/objects/tmp, but that would pose transition problems on upgrade when partially transferred objects existed. git annex info does not currently show the size of .git/annex/misctemp, since it should stay small. It would also be ok to make something clean it out, periodically.
* try to drop unused object if it does not need to be transferred anywhereGravatar Joey Hess2014-01-23
|
* flip for clarityGravatar Joey Hess2013-12-16
|
* assistant: Always batch changes found in startup scan.Gravatar Joey Hess2013-12-16
| | | | | | | | | | | | | | | Batch detection is heuristic, so can sometimes fail. I observed one such failure while starting up in a repository with 87000 files. After the first several batches of ~5000 files, it fell out of batch mode, and never re-entered it, and so made many more commits of a few files at a time than necessary. So, let's always use batch mode when in the startup scan. This avoids the heuristic there, at least. There is clearly also room to improve the heuristic. Possibly 10 files is too high a bar to be found during a commit, on a system that can commit quickly.
* avoid trying to use lsof when it's not in path and --forcedGravatar Joey Hess2013-12-04
|
* Avoid using git commit in direct mode, since in some situations it will read ↵Gravatar Joey Hess2013-12-01
| | | | | | | | | | | | the full contents of files in the tree. The assistant's commit code also always avoids git commit, for simplicity. Indirect mode sync still does a git commit -a to catch unstaged changes. Note that this means that direct mode sync no longer runs the pre-commit hook or any other hooks git commit might call. The git annex pre-commit hook action for direct mode is however explicitly run. (The assistant already ran git commit with hooks disabled, so no change there.)
* hlintGravatar Joey Hess2013-10-02
|
* add, import, assistant: Better preserve the mtime of symlinks, when when ↵Gravatar Joey Hess2013-09-25
| | | | | | | adding content that gets deduplicated. Note that this turned out to remove a syscall, not add any expense. Otherwise, I would not have done it.
* better git version checkingGravatar Joey Hess2013-08-02
|
* assistant: Fix bug that caused it to stall when adding a very large number ↵Gravatar Joey Hess2013-07-27
| | | | | | | | | | | | | | | | of files at once (around 5 thousand). This bug was introduced in 74c30fc1a6e88d926d07e12f4e7ffc7d897bf9f6, which improved handling of adding very large numbers of files by ensuring that a minimum number of max size commits (5000 files each) were done. I accidentially made it wait for another change to appear after such a max size commit, even if a lot of queued changes were already accumulated. That resulted in a stall when it got to the end. Now fixed to not wait any longer than necessary to ensure the watcher has had time to wake back up after the max size commit. This commit was sponsored by Michael Linksvayer. Thanks!
* assistant: Fix deadlock that could occur when adding a lot of files at once ↵Gravatar Joey Hess2013-07-26
| | | | | | | | | | in indirect mode. This is a laziness problem. Despite the bang pattern on newfiles, the list was not being fully evaluated before cleanup was called. Moving cleanup out to after the list is actually used fixes this. More evidence that I should be using ResourceT or pipes, if any was needed.
* webapp: Better display of added files.Gravatar Joey Hess2013-07-10
|
* committer tweak to wait for Watcher to resume after a max-size commitGravatar Joey Hess2013-04-25
| | | | | | Without this, a very large batch add has commits of sizes approx 5000, 2500, 1250, etc down to 10, and then starts over at 5000. This fixes it so it's 5000+ every time.
* get rid of need to run pre-commit hook when assistant commits in direct modeGravatar Joey Hess2013-04-24
| | | | | | | | | | | That hook updates associated file bookkeeping info for direct mode. But, everything already called addAssociatedFile when adding/changing a file. It only needed to also call removeAssociatedFile when deleting a file, or a directory. This should make bulk adds faster, by some possibly significant amount. Bulk removals may be a little slower, since it has to use catKeyFile now on each removed file, but will still be faster than adds.
* batch commit every 5 thousand changes, not 10 thousandGravatar Joey Hess2013-04-24
| | | | | | | | | | | There's a tradeoff between making less frequent commits, and needing to use memory to store all the changes that are coming in. At 10 thousand, it needs 150 mb of memory. 5 thousand drops that down to 90 mb or so. This also turns out to have significant imact on total run time. I benchmarked 10k changes taking 27 minutes. But two 5k batches took only 21 minutes.
* convert PendingAddChange back to Change when an add failsGravatar Joey Hess2013-04-24
| | | | | | | If an add failed, we should lose the KeySource, since it, presumably, differs due to a change that was made to the file. (The locked down file is already deleted.)
* show one alert when bulk adding filesGravatar Joey Hess2013-04-24
| | | | | | | | | | | | Turns out that a lot of the time spent in a bulk add was just updating the add alert to rotate through each file that was added. Showing one alert makes for a significant speedup. Also, when the webapp is open, this makes it take quite a lot less cpu during bulk adds. Also, it lets the user know when a bulk add happened, which is sorta nice..
* assistant: when an add fails, requeue it for laterGravatar Joey Hess2013-04-23
| | | | See analysis in bug report for one way this could happen.
* assistant: Work around misfeature in git 1.8.2 that makes `git commit ↵Gravatar Joey Hess2013-04-18
| | | | | | --alow-empty -m ""` run an editor. See http://git-annex.branchable.com/bugs/assistant_hangs_during_commit/
* Bugfix: Direct mode no longer repeatedly checksums duplicated files.Gravatar Joey Hess2013-04-06
| | | | | | | | | | | | | | | | | Fixed by storing a list of cached inodes for a key, instead of just one. Backwards compatability note: An old git-annex version will fail to parse an inode cache file that has been written by a new version, and has multiple items. It will succees if just one. So old git-annexes will have even worse behavior when there are duplicated files, if that is possible. I don't think it will be a problem. (Famous last words.) Also, note that it doesn't expire old and unused inode caches for a key. It would be possible to add this if needed; just look through the associated files for a key and if there are more cached inodes, throw out any not corresponding to associated files. Unless a file is being copied repeatedly and the old copy deleted, this lack of expiry should not be a problem.
* Use lower case hash directories for storing files on crippled filesystems, ↵Gravatar Joey Hess2013-04-04
| | | | | | | | | | | | | | | same as is already done for bare repositories. * since this is a crippled filesystem anyway, git-annex doesn't use symlinks on it * so there's no reason to use the mixed case hash directories that we're stuck using to avoid breaking everyone's symlinks to the content * so we can do what is already done for all bare repos, and make non-bare repos on crippled filesystems use the all-lower case hash directories * which are, happily, all 3 letters long, so they cannot conflict with mixed case hash directories * so I was able to 100% fix this and even resuming `git annex add` in the test case will recover and it will all just work.
* assistant: Fix OSX bug that prevented committing changed files to a ↵Gravatar Joey Hess2013-03-17
| | | | repository when in indirect mode.