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

Aperta
#314 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
git, java
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Java
Stelle
427
Fork
116
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-jgit/jgit

Tutte le issue di eclipse-jgit/jgit

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.