Issue 81: Can't repack a repository while Gerrit is running
Reported by code-rev...@gtempaccount.com, Sep 24, 2009
Reported by Shawn Pearce <sop@google.com> on Wed Feb 18 09:10:30 PST 2009
Source: JIRA GERRIT-81
Affected Version: 2.0.4

It is unsafe to repack a repository while Gerrit is running because JGit
doesn't close the now deleted pack files, and it doesn't recognize the newly
created pack files.  This leads JGit to suddenly lose access to objects that
used to exist in the repository, making the history appear corrupt anytime
Gerrit or JGit tries to access it.

Restarting Gerrit works around the problem, by flushing the JGit caches out of
memory and letting them rebuild.

A correct fix is to make JGit recognize the objects/pack directory has been
modified and reload the list of known packs.  This also must account for a
pack being overwritten with a different layout (e.g. different object offsets
due to different compression being applied), but keeping the same object set,
and thus the same pack file name.
Sep 24, 2009
#1 code-rev...@gtempaccount.com
Comment by Shawn Pearce <sop@google.com> on Mon Apr 13 07:17:18 PDT 2009

Although this talks about repack, it also applies to fetching into a
repository or pushing into a repository owned by Gerrit.

If the fetch or push saves the pack rather than exploding it, Gerrit may later
fail as it can't locate that new pack file.  By default a fetch or a push
saves the pack if it moves 100 or more objects in that transfer.
Sep 24, 2009
#2 code-rev...@gtempaccount.com
Comment by Shawn Pearce <sop@google.com> on Mon Apr 20 19:15:13 PDT 2009

Partial fix posted under http://thread.gmane.org/gmane.comp.version-control.git/117060

The problem for Gerrit is what 07/10 (http://article.gmane.org/
gmane.comp.version-control.git/117070) describes in its commit message.  Any
active replication to another repository via replication.config, or any active
client fetching over the internal SSHD, can see a transient fault.  That needs
to be fixed before we could consider this issue closed.
Sep 24, 2009
#3 code-rev...@gtempaccount.com
Comment by Shawn Pearce <sop@google.com> on Tue May 05 13:12:49 PDT 2009

Finally fixed by an update in JGit https://review.source.android.com/9740
Sep 24, 2009
#4 code-rev...@gtempaccount.com
Update by Shawn Pearce <sop@google.com> on Tue May 05 13:12:49 PDT 2009

Fixed in version 2.0.11.
Status: Fixed
Sep 25, 2009
#5 code-rev...@gtempaccount.com
(No comment was entered for this change.)
Labels: FixedIn-2.0.11
Oct 21, 2012
#6 sop@google.com
(No comment was entered for this change.)
Status: Released