Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Automatic maintenance of application server side repository(Automatic maintenance of application server side repository)
Automatic maintenance of application server side repository [message #1240030] Wed, 05 February 2014 15:14 Go to next message
Laurent Petit is currently offline Laurent Petit
Messages: 21
Registered: December 2010
Junior Member
Hello,

My web application uses a jgit repository to store content.

It can have a very high uptime (not being restarted for weeks or months).

When the client git is used on the command line, there are some "cleanup" operations that are done from time to time.

Out of the top of my head:

- garbage collection
- packing

What would be the best way to trigger these operations when a repository will be managed programatically by a very long running process ?

- I have found a gc() method, what about packing ?
- During the associated maintenance calls, what can be still performed in parallel on the git repository ( it's a web application, concurrent requests can occur ) ? I already serialize access to the "write" operations, should I consider these maintenance operations as "write operations" as well ? Do they generally last long ? Is there a scheduling policy that would minimize the time spent each time ?

Thanks in advance,

--
Laurent Petit

Re: Automatic maintenance of application server side repository [message #1240080 is a reply to message #1240030] Wed, 05 February 2014 16:55 Go to previous message
Matthias Sohn is currently offline Matthias Sohn
Messages: 580
Registered: July 2009
Senior Member
- gc includes repacking and might take a long time and consume considerable resources (heap and CPU)
depending on the size and complexity of the repository
- you shouldn't run multiple gc commands concurrently on the same repository since this would waste a lot of
resources, if you try that anyway some of the concurrent runs may fail if they fail to acquire locks implemented
by LockFile [1] which is using atomic rename of the lock file to implement locking semantics in jgit. Native git
is using the same locking mechanism.
- there are only a few commands which modify existing objects in these cases jgit (and native git) use this
locking mechanism relying on the atomicity of renaming a file, on filesystems not providing atomic rename git's
locking mechanism won't work
- running other modifying operations like push, update ref etc should be safe to run while gc is running
- which kind of write operations is your application using ?
- why are you serializing write operations ? This severely limits scalability for these operations.

[1] https://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java
Previous Topic:Is there any GIT Console as happens for svn?
Next Topic:Replace with HEAD Revision does not work
Goto Forum:
  


Current Time: Tue Sep 30 20:09:03 GMT 2014

Powered by FUDForum. Page generated in 0.04587 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software