Skip to content

Use shallow clones for the worker index repository#13864

Open
Turbo87 wants to merge 1 commit into
rust-lang:mainfrom
Turbo87:shallow-index-clone
Open

Use shallow clones for the worker index repository#13864
Turbo87 wants to merge 1 commit into
rust-lang:mainfrom
Turbo87:shallow-index-clone

Conversation

@Turbo87
Copy link
Copy Markdown
Member

@Turbo87 Turbo87 commented Jun 5, 2026

The worker's long-lived index clone only ever reads the current tip and commits/pushes on top of it, so it does not need the full index history.

This adds an opt-in Repository::open_shallow() fn that clones with --depth 1 and keeps reset_head() fetches shallow. It is used from the worker's lock_index() fn. The full-history Repository::open() is unchanged so the upload-index admin tool's incremental mode keeps working.

The worker's long-lived index clone only ever reads the current tip and
commits/pushes on top of it, so it does not need the full index history.

This adds an opt-in `Repository::open_shallow()` fn that clones with `--depth 1`
and keeps `reset_head()` fetches shallow. It is used from the worker's
`lock_index()` fn. The full-history `Repository::open()` is unchanged so the
`upload-index` admin tool's incremental mode keeps working.
@Turbo87 Turbo87 added the C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear label Jun 5, 2026
@Turbo87 Turbo87 requested a review from a team June 5, 2026 11:43
@Turbo87
Copy link
Copy Markdown
Member Author

Turbo87 commented Jun 5, 2026

I've tried this out on the staging server:

Bildschirmfoto 2026-06-05 um 14 29 28

rust-lang/staging.crates.io-index@e1e8cf4

but with 14 commits (now 15) on the staging index, that isn't quite representative in terms of performance. The commit creation and pushing works though, and we could still revert if this turns out to be a performance regression in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants