gitmote

gitmote / docs / notes / object-hydration.md  ·  history  ·  branches

2771 bytes · raw

Object hydration for reads

Getting the right git objects onto local disk for a given operation.

Context. The local bare repo is a cache; refs come from s3lite, objects from S3 (see architecture → components). The open point is how the objects arrive.

The problem. upload-pack (serving fetch/clone) and receive-pack's fast-forward / connectivity checks walk a local object store. They do not call back to fetch missing objects mid-operation — so "pull on demand" is not a thing at the git layer. The needed closure must be present before git runs.

Options

  1. Full closure up front. Before running git, hydrate the objects reachable from the refs involved (all refs for a clone; the target branch's history for a push). Simple, correct; cold-start cost ∝ repo size. Fine at the target scale (a handful of small repos).
  2. Warm cache. Keep the materialized repo on disk while the container lives; after the first hydrate, only newly-referenced objects are fetched. Cuts repeat cold-start.
  3. Partial clone / promisor. Make the local repo a promisor with S3 as the promisor remote plus a fetch helper, so git lazily pulls missing objects. Most scalable, most complex — the escape hatch when repo size becomes the wall.

Leaning

(1) + (2): full reachable closure on cold start, kept warm for the container's life. Revisit (3) only if large repos become real. This is the "scaling wall for large repos" the architecture refers to.

Progress

Open sub-points