Skip to content

Complete protocol v2 object-info support - #20

Closed
dumontg wants to merge 3 commits into
imports/13-create-conflictfrom
imports/14-object-info
Closed

dumontg wants to merge 3 commits into
imports/13-create-conflictfrom
imports/14-object-info

Conversation

@dumontg

@dumontg dumontg commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #19.

Imports tobi/walgit#88 by @behinddwalls: advertises object-info=size, answers in the protocol's format (size header, <oid> <size>, empty size for a missing object), caps a request at 1,024 object ids before any sync, applies the placement refusal, and reads object headers instead of inflating objects. Clients such as lazy mounts get file sizes without downloading content.

One follow-up commit addresses the review still open on tobi#88:

  • Remote pack header reads run at most 16 at a time, in request order, instead of up to 1,024 at once.
  • Only found sizes are cached; a miss cached under a manifest version read after the sync could hide a freshly pushed object.
  • Local header lookups run on a blocking thread instead of on the async runtime.

A second follow-up raises the per-request cap from 1,024 to 10,000 object ids. git's own client sends up to 10,000 ids per object-info request (cat-file remote-object-info, MAX_ALLOWED_OBJ_LIMIT) and the protocol cannot advertise a lower limit, so with 1,024 ordinary clients failed and fell back to downloading objects.

It adds an end to end test that an object pushed after a lookup missed it is reported with its size. That test does not reproduce the cache race itself, which is not deterministic.

Verified on the top of this stack: cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check, the crate test suites, and the Azure harness (just test-azure: store contract plus git push, clone, pull and cold restart on Azurite) pass. Known unrelated failures: the runtime stall timing tests in e2e (also intermittent on main) and the web UI asset tests that need pnpm run build.

behinddwalls and others added 2 commits October 7, 2026 08:44
## Summary

### Why?

The object-info implementation was not compatible with the Git client: its capability omitted the supported attribute, missing objects used an invalid numeric sentinel, requests were unbounded, and excluded hosts could start object synchronization.

### What?

Advertise `object-info=size`, return protocol-defined empty values for missing objects, cap requests at 1,024 OIDs before sync, and apply the existing placement refusal before any object work. Preserve manifest-versioned positive and negative caching across local and remote-served object access.

The healthy request path remains one conditional manifest GET. Warm cache hits and local header lookups add zero bucket reads; remote misses add only the pack range reads required by `RemotePacks::header`.

## Test Plan

✅ `cargo check -p walgit-server`

✅ `cargo test -p walgit-git read_object_info_args_reads_size_and_oids_after_delimiter`

✅ `cargo test -p walgit-server --test e2e info_refs_v2_advertises_capabilities -- --exact`

✅ `cargo test -p walgit-server --test e2e object_info_v2`

✅ `cargo test -p walgit-server --test maintain host_excluded_from_serving_a_repo_refuses_object_work_with_503 -- --exact`

✅ `cargo test -p walgit-server --test e2e fetch_from_front_that_serves_the_base_remotely -- --exact`

✅ `cargo clippy -p walgit-server --all-targets -- -D warnings`

✅ `cargo fmt --all -- --check`

✅ `git diff --check`

## Issue

Closes tobi#80

(cherry picked from commit c51b778)
…runtime

Follow-ups from the review of the object-info change:

- Remote pack header reads for one request run at most 16 at a time, in request order, instead of up to 1,024 at once.
- Only found sizes are cached. A miss cached under a manifest version read after the sync could hide an object pushed in between; misses are cheap to recompute.
- Local header lookups run on a blocking thread rather than on the async runtime.

Adds an end to end test that an object pushed after a lookup missed it is reported with its size.
git sends up to 10,000 object ids in one object-info request (cat-file remote-object-info, MAX_ALLOWED_OBJ_LIMIT), and the protocol has no way to advertise a lower limit, so a cap of 1,024 made ordinary clients fail and fall back to downloading objects. The cap stays a guard against unbounded requests: remote reads are still at most 16 at a time and local lookups run on a blocking thread.
@dumontg

dumontg commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Landed on main in 8347913 (merge of the stack top 59b206f), so this PR's changes are on main.

@dumontg dumontg closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants