A compiler-tier checkout fetch from a shallow mirror never records its head
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 35/100
Piste de recherche
Read checkout_fetch_args in server/code/app/index/compiler_tier.py and compare its arguments with the reproduction in the issue. Run that reproduction with and without --update-shallow, then check whether refs/loom/scip-head is recorded. The issue describes the expected behavior and lists all five callers; linked pull request #2017 indicates work is already underway.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
TL;DR: When a repository's remote serves truncated history, Loom's bare mirror of it is shallow, and the compiler-tier checkout fetch from that mirror drops refs/loom/scip-head with a warning and exit code 0. With no ref to negotiate from, every later pass fetches the whole pack again and the tier never reports an error. Passing --update-shallow in checkout_fetch_args records the ref.
Company
Independent
Component
Code index
Describe what's wrong
clone_mirror (server/code/app/index/bootstrap.py) clones with git clone --bare --no-local and no depth. If the remote is itself shallow (a fork pushed with --shallow-since, or any server that holds truncated history), git copies its shallow roots, so the mirror is shallow as well:
$ git -C <mirror> rev-parse --is-shallow-repository
true
The compiler tiers then fetch the target into their checkout with checkout_fetch_args (server/code/app/index/compiler_tier.py:623 on main at 9871c8735d73):
git fetch --recurse-submodules=no <mirror> +<target>:refs/loom/scip-head
The checkout is not shallow, so taking the mirror's history means adding shallow roots, which git fetch refuses unless it gets --update-shallow. It transfers the objects, refuses the ref update, prints a warning and exits 0:
warning: rejected refs/loom/scip-head because shallow roots are not allowed to be updated
compiler_tier.git sees exit 0, so the pass goes on. refs/loom/scip-head is never written, so the next fetch has no ref to negotiate from and sends the whole pack again. On a repository served with truncated history (a fork pushed with --shallow-since, 4 shallow roots, a 13.7 GB pack) each pass re-sent the full pack into the checkout.
All five callers share the argument list: scip_delta, scip_go_delta, scip_ts_delta, scip_py_delta and scip_full.move_checkout.
Does it reproduce on the latest release or main?
Yes
How to reproduce
git init -q -b master src
for i in 1 2 3 4 5; do echo $i > src/f$i; git -C src add f$i; git -C src commit -q -m c$i; done
git clone -q --bare --depth 2 "file://$PWD/src" remote.git # a remote that serves truncated history
git clone -q --bare --no-local remote.git mirror.git # as clone_mirror clones it
git -C mirror.git rev-parse --is-shallow-repository # true
git init -q checkout
H=$(git -C mirror.git rev-parse master)
git -C checkout fetch --recurse-submodules=no "$PWD/mirror.git" "+$H:refs/loom/scip-head"; echo "exit $?"
git -C checkout rev-parse --verify -q refs/loom/scip-head || echo "no ref"
The fetch prints the warning above and exit 0, then no ref. With --update-shallow added, the same fetch writes the ref.
Expected behavior
The checkout fetch records refs/loom/scip-head whether or not the mirror is shallow, so the next fetch sends only what is new. That is what the docstring of checkout_fetch_args and the SCIP_HEAD_REF comment promise.
Error message and logs
warning: rejected refs/loom/scip-head because shallow roots are not allowed to be updated
Environment
Reproduced with git 2.43.7. checkout_fetch_args and clone_mirror are unchanged on main at 9871c8735d73.
Related issues and pull requests
https://github.com/ClickHouse/loom/issues/2012 (PR https://github.com/ClickHouse/loom/pull/2013) covers the 600 s limit on the same fetch in the delta workers. That limit killed this fetch before git reached the ref update, so the dropped ref only shows once the fetch can finish.
How this was found
An AI tool helped find it. The reproduction above runs as written on a clean git 2.43.7: the fetch exits 0 with the warning, then prints no ref.
Additional context
A shallow mirror is a legitimate input: Loom clones whatever the configured remote serves. --update-shallow changes nothing when the mirror is not shallow.
Redaction
- I removed tokens, keys, passwords and personal or customer data from everything above.
- Langage dominant
- Python
- Étoiles
- 263
- Forks
- 47
- Merge moyen
- 14 h 21 min
- PR mergées (30 j)
- 873
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Fournit un Dockerfile ou un 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 ClickHouse/loom
-
Difficulté 1/5 1-3 heures Accessibilité débutants 76/100
ClickHouse/loom#2014 ·
Les mainteneurs répondent en général sous 1 jour
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help textPeut-être pris @VanshajPoonia l’a pris aujourd’hui. Ouvertebug good first issue help wanted up-for-grabs
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
ClickHouse/loom#1988 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limitPeut-être pris @KaloyanNaumov l’a pris aujourd’hui. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 35/100
ClickHouse/loom#2012 ·
Les mainteneurs répondent en général sous 1 jour
-
loom participant retire cannot retire an orphaned participant after container replacement or host rebootPeut-être pris @l0K1ngg l’a pris aujourd’hui. Ouvertebug help wanted up-for-grabs
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
ClickHouse/loom#2007 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 40/100
ClickHouse/loom#2001 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de ClickHouse/loom
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
TigreGotico/orthography2ipa#2950 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Unstructured-IO/unstructured#4876 ·
Les mainteneurs répondent en général sous 6 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
openfoodfacts/openfoodfacts-python#579 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
fairagro/m4.2_sql_to_arc#388 ·
Les mainteneurs répondent en général sous 1 jour