Skip to main content

Module push_space

Module push_space 

Source
Expand description

The receive path’s half of space admission (gunnar_ssh::space): the reader a pushed (or mirrored) pack is read through, which asks the data set’s ledger before every chunk it hands on, and the sweep of spool files a crash left behind.

§Where the three copies are told to the ledger

The hold promises gunnar_ssh::PUSH_COPIES bytes of /data per wire byte BEFORE the byte is read, and each copy is given back the moment it is on the disk, where statvfs counts it:

  • the spool — at [Gated]’s consume, once the ingest has written what it consumed ([crate::storage::spooled_on_disk] is the rule, kept beside the code it describes);
  • the transaction log’s frame — after PackFrame::append returns (transport::PushIngest);
  • the store — when the ingest returns, by dropping the hold; the spool is deleted by then too.

§What the client is told

A chunk the ledger will not grant cuts the stream with [NoRoom]; the ingest fails on it, its spool drops, and PushIngest hands the wire gunnar_wire::Error::Refused with the ledger’s line, verbatim — which git push prints as remote unpack failed: the data set is full right now: …. Never the repository is unavailable; try again.

Functions§

sweep_lfs_spool
Delete the *.part files an LFS upload’s spool left in spool_dir (<txlog>/spool/, txlog_lfs): removed by Drop when the upload lands or fails, left behind only by a process that died mid-upload. Run at start.
sweep_spool_leftovers
Delete every spool file a crash left under repos_root: in each *.git directory, and in its gunnar-git.znippy/ beside the archive (the two places the two engines spool). Run once at start, before any door is open, so no live push owns one. Returns (files, bytes) removed.