Bug 405429 - IllegalStateException in PackWriter: "Bitmap is missing Commit" - Garbage Collector blocked from completing
Summary: IllegalStateException in PackWriter: "Bitmap is missing Commit" - Garbage Col...
Status: CLOSED INVALID
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows Server 2008
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2013-04-11 03:36 EDT by Alexander Riss CLA
Modified: 2014-05-09 11:21 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Riss CLA 2013-04-11 03:36:03 EDT
Steps:
-GC was happening before pull/push

Exception:
java.lang.IllegalStateException: Bitmap at d7a9cd9f247243abaf8885a5a7a8e22a6081c0f6 is missing 6730b1e49c3213fd1988828f202d42fd6a06aada.
at org.eclipse.jgit.internal.storage.pack.PackWriter.prepareBitmapIndex(PackWriter.java:2009)
at org.eclipse.jgit.internal.storage.file.GC.writePack(GC.java:716)
at org.eclipse.jgit.internal.storage.file.GC.repack(GC.java:522)
at org.eclipse.jgit.internal.storage.file.GC.gc(GC.java:163)
at org.eclipse.jgit.api.GarbageCollectCommand.call(GarbageCollectCommand.java:123)
Comment 1 Alexander Riss CLA 2013-04-25 05:24:24 EDT
also worth mentioning: this happens all the time on repos with at least 40.000 objects in them. 
This effectively blocks the whole garbage collection and repacking from happening, since the packwriter will refuse to do anything when the bitmaps can not be properly generated.
Comment 2 Robin Rosenberg CLA 2013-05-15 14:35:08 EDT
GC does not just "happen" in egit. It must be invoked by the user. I changed the importance since the bug does not (I believe) corrupt the repo or prevent other operations.
Comment 3 Alexander Riss CLA 2013-06-11 07:45:45 EDT
this happened in JGIT standalone. The scenario was like this:

2 local repositories:

local-repo1 is cleaned using jgit-gc
local-repo1 is cloned to local-repo2

<- repeat multiple times ->
lots of commits on local-repo2
local-repo2 is cleaned using jgit-gc
local-repo2 pulls from local-repo1
local-repo2's changes are pushed to local-repo1
<- end repeat ->

after about 400 to 500 commits with about 20.000 objects created the GC will finally fail with the said stack trace.
Comment 4 Alexander Riss CLA 2013-06-11 07:49:23 EDT
For me it also looks like this bug is related to bug #403193. This leads to a repository corruption. I would vote for raising the priority for fixing this.
Comment 5 Robin Rosenberg CLA 2013-06-11 11:39:15 EDT
Shawn, Colby: Any idea what's going on here?
Comment 6 Colby Ranger CLA 2013-06-11 12:16:15 EDT
PackWriterBitmapPreparer selects a list of commits at which to place a bitmap. Then the commits are bitmaped in order by PackWriter. There is an optimization where we re-use the ObjectWalker if the current commit should contain the previous commit. The IllegalStateException throws when the sanity check fails. It is difficult to say what is exactly broken without getting the actual packs that are causing this error.
Comment 7 Alexander Riss CLA 2014-05-09 11:21:05 EDT
this was caused by a repository which had commits pointing to no longer existing blob objects