Skip to content

Complete protocol v2 object-info support - #88

Open
behinddwalls wants to merge 1 commit into
tobi:mainfrom
behinddwalls:preetam/issue-80-object-info
Open

behinddwalls wants to merge 1 commit into
tobi:mainfrom
behinddwalls:preetam/issue-80-object-info

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Sep 30, 2026 •

Copy link
Copy Markdown

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 #80

Stack

  1. Complete protocol v2 object-info support #88 — Complete protocol v2 object-info support

@0bserver07

Copy link
Copy Markdown
Contributor

Thanks for taking this on. I checked it against git's client for this command (fetch-object-info.c on git master, not in a release yet) and they won't work together as is. The client only asks for size when the server advertises object-info=size, and here it's just object-info, so git would send no attributes and get a 400 back. It also can't parse -1 for a missing object, the spec sends the oid with an empty size.

Two smaller things: nothing caps how many oids one request can send, and this path skips the not_served_here check, so a host that shouldn't serve the repo would start materializing it.

## 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
@behinddwalls
behinddwalls force-pushed the preetam/issue-80-object-info branch from c21254d to c51b778 Compare October 1, 2026 20:18
@behinddwalls

behinddwalls commented Oct 1, 2026 •

Copy link
Copy Markdown
Author

Updated object-info compatibility and safeguards in c51b778. The server now advertises object-info=size, emits an empty size for missing objects, refuses requests above 1,024 OIDs before sync, and applies the existing placement refusal before object work. Parser, local, missing-object, boundary, excluded-placement, remote-served, and clippy checks pass.

[addressed by agent]

@0bserver07

Copy link
Copy Markdown
Contributor

Thanks, this looks a lot better, the advert, the empty size, the cap and the placement check all work now. Two smaller things. All the lookups for one request still go out at the same time, so a big request fires up to 1024 reads at once, it'd be good to cap how many run in parallel. And I think a freshly pushed object can get cached as missing if another sync lands at the same moment, since the cache version is read after the sync. Not caching misses at all would avoid it, they're cheap anyway.

This branch has not been deployed

No deployments
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.

Protocol v2 object-info is not advertised and bypasses remote object access

2 participants