PackWriter produces duplicate objects in pack during bitmap walk with index misses

Offen
#314 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
22/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
git, java
Bereich
devtools

Rechercherichtung

Start with BitmapIndexImpl.CompressedBitmap.iterator(), which yields ObjectIds from the mutableIndex range and the ofObjectType range, then check how PackWriter.addObject() adds them through ObjectIdOwnerMap.add() without a duplicate check. Reproduce on a repository with low bitmap coverage and midx bitmaps enabled. Done means a test shows each object written once and a clone or fetch of that repository succeeds.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Version

7.7.1

Operating System

Linux/Unix

Bug description

When BitmapIndexImpl.CompressedBitmap.iterator() is used during a
bitmap walk with index misses (i.e. commits without precomputed
bitmaps that require RevWalk fallback), the same ObjectId can be
yielded twice: once from the mutableIndex range (position >=
indexObjectCount) and once from the ofObjectType range (position <
indexObjectCount).

PackWriter.addObject() inserts into objectsLists and objectsMap via
ObjectIdOwnerMap.add(), which does not check for duplicates. The
duplicate entry causes the object to be written to the pack twice.

This is reproducible on any repository where bitmap coverage is low
(e.g. an old repo with few selected commits in the bitmap) and midx
bitmap is enabled.

Actual behavior

The client fails with:

fatal: The same object appears twice in the pack
fatal: fetch-pack: invalid index-pack output

Clone/fetch is completely broken for the affected repository. 100%
reproducible, not a race condition.

Expected behavior

Clone/fetch should succeed. Each object should appear exactly once in
the pack regardless of bitmap coverage ratio.

Relevant log output
fatal: The same object 0021f932ac4d99e56d888832f024feee6318f1ad appears twice in the pack
fatal: fetch-pack: invalid index-pack output
Other information

No response

Vorherrschende Sprache
Java
Sterne
427
Forks
116
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus eclipse-jgit/jgit

Alle Issues in eclipse-jgit/jgit

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.