ReftableReader fails to read refs from a valid reftable with a multi-block root index
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
Piste de recherche
Start in the reftable index lookup inside ReftableReader: the point-lookup path begins at the footer's index position, reads one index block, and gives up when the key sorts past it instead of walking sibling blocks at the same level. Compare against the full-scan path in FileReftableDatabase, which already finds the ref, and check the spec notes in the issue about NUL padding and oversized root blocks; the same logic must apply to ref, object and log indexes. Run the attached JGitReftableReadProbe.java against the supplied broken-repository.git and add regression tests covering aligned/unaligned multi-block root indexes and missing keys; done means mismatchCount=0 with exactRef/findRef/resolve matching the full scan.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Version
7.7
Operating System
Linux/Unix
Bug description
Bug description
A valid reftable written by C Git can have a highest index level that
spans multiple sibling index blocks. ReftableReader starts at the index
position recorded in the footer, reads the first index block, and returns
no match when the requested key sorts after that block. It does not
continue to the next index block at the same level.
This makes JGit internally inconsistent: a full ref scan returns a ref,
while point-lookup APIs cannot find that same ref. Native Git resolves the
ref successfully.
I attached jgit-reftable-multi-root-reproducer.zip, which contains the
complete read-only probe source and an example broken repository:
JGitReftableReadProbe.javacompares JGit full enumeration, JGit
exactRef,findRef, andresolve, and native Git point lookup.broken-repository.gitis a synthetic bare repository written by C Git
2.54 usingextensions.refStorage=reftable.- The repository has 10,000 generic refs pointing to one empty synthetic
commit. It contains no production source or ref names.
Archive SHA-256:
d6e91da54a8456d6b787ad49932ecc88a441c1987a84b639aef75fe0c9e475a8
Run the complete probe with a JGit runtime classpath:
java --class-path '/path/to/jgit.jar:/path/to/dependencies/*' \
JGitReftableReadProbe.java \
broken-repository.git \
refs/heads/archive/7fff4ea22b8a03452de95dca17404a632d111489
jgit-reftable-multi-root-reproducer.zip
Actual behavior
Actual behavior
With unmodified JGit 7.7:
refDatabase=org.eclipse.jgit.internal.storage.file.FileReftableDatabase
extensions.refStorage=reftable
jgitFullScan.count=10001
jgitFullScanVsExactRef.mismatchCount=4349
ref=refs/heads/archive/7fff4ea22b8a03452de95dca17404a632d111489 enumerated=1485913eca8d3370fc05352a45977a99720acb1c exactRef=null findRef=null resolve=null nativeExit=0 native=1485913eca8d3370fc05352a45977a99720acb1c
BUG_REPRODUCED=true
The failure is deterministic for every ref routed through the second
root-index block.
Expected behavior
Expected behavior
Every ref returned by the full scan should also be found by exactRef,
findRef, and resolve. JGit point lookup should agree with native Git.
With the proposed fix:
jgitFullScan.count=10001
jgitFullScanVsExactRef.mismatchCount=0
ref=refs/heads/archive/7fff4ea22b8a03452de95dca17404a632d111489 enumerated=1485913eca8d3370fc05352a45977a99720acb1c exactRef=1485913eca8d3370fc05352a45977a99720acb1c findRef=1485913eca8d3370fc05352a45977a99720acb1c resolve=1485913eca8d3370fc05352a45977a99720acb1c nativeExit=0 native=1485913eca8d3370fc05352a45977a99720acb1c
BUG_REPRODUCED=false
Relevant log output
Other information
Other information
The footer's index position is the start of the highest index level; it
is not a guarantee that the level consists of only one block. The current
lookup treats the first block as the entire root level.
The proposed fix walks sibling index blocks at the highest level until it
finds the block whose key range contains the requested key, or reaches
the next reftable section. It handles adjacent unaligned blocks,
block-aligned NUL padding, and an oversized root block. The same logic is
used for ref, object, and log indexes.
The accompanying tests cover aligned and unaligned multi-block ref root
indexes, object and log indexes, missing keys, and an oversized
single-level root index.
- Langage dominant
- Java
- Étoiles
- 427
- Forks
- 116
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de eclipse-jgit/jgit
-
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
eclipse-jgit/jgit#329 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
eclipse-jgit/jgit#327 ·
-
Repository.create(boolean bare) should provide a no-arg overload that uses isBare()Peut-être à nouveau libre @hardikyadav12 l’a pris il y a 77 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
eclipse-jgit/jgit#297 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
eclipse-jgit/jgit#293 · 2 commentaires ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
eclipse-jgit/jgit#288 ·
Toutes les issues de eclipse-jgit/jgit
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
constellation-app/constellation#2613 ·
Les mainteneurs répondent en général sous 2 jours
-
[JUKEBOW] Arrows can be stolenOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
Vakore/ZappierGames#334 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
IETF-Hackathon/pqc-certificates#369 ·
Les mainteneurs répondent en général sous 1 jour
-
? - Needs Triage bot_watch bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
NVIDIA/cudf-spark-jni#5594 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100