Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Apply a push's index delta as the push lands, and check the ref by reading it

dced06da1bfc4a8e542e5d86d67888362077ed39 · Keenan Nemetz · 9d ago · parent 26c9be33

Apply a push's index delta as the push lands, and check the ref by reading it

A push's metadata delta used to be applied by the next reader, so the
first page after a big push paid for the whole push. And search checked
every visible repository before querying: a `symbolic-ref` to open it and
a `rev-parse` to see whether the metadata branch moved, so N repositories
cost 2N git processes per search.

- Post-receive now opens the index (the SSH server hands it `VOLE_INDEX_DB`
  and the repository id) and runs Ensure after the refs have moved, which
  is also after a followed request's head has moved. A failure is reported
  and ignored: the refs have landed, and the next read still repairs it.
- `git.Repo.RefCommit` resolves a branch ref by reading the loose ref file
  git writes for every branch update, and falls back to `rev-parse` for a
  packed ref, a symbolic ref, or a missing one. The index's Ensure and the
  web's metadata-head read use it.
- `repo.Store.Meta` builds a repository handle without a HEAD lookup, and
  search uses it: the refresh needs the directory and the ACL, not the
  default branch. The per-repository check is now two file reads instead
  of two processes.

Load harness, `search-find` at concurrency 4 over three repositories:
510.2 req/s and p50 7 ms before, 814.8 req/s and p50 4 ms after. A push
that changes the `vole` branch leaves the rows current before the push
returns; a test queries them with no Ensure in between.

server/ssh/server.go +3

@@ -78,6 +78,8 @@ type Config struct {
78 78 SpoolDir string
79 79 // RunsDB is handed to pre-receive so required checks are enforced there.
80 80 RunsDB string
81 // IndexDB is handed to post-receive so a push refreshes the read model.
82 IndexDB string
81 83 // Runs is the CI queue, served to runners over the vole-runner verb.
82 84 Runs *runs.Store
83 85 // LFS is the object store behind git-lfs-transfer.
@@ -525,6 +527,7 @@ func (s *Server) exec(ch xssh.Channel, req *xssh.Request, command, user, fp, rem
525 527 "VOLE_USERS_DB="+s.cfg.Identity.Path(),
526 528 "VOLE_SPOOL="+s.cfg.SpoolDir,
527 529 "VOLE_RUNS_DB="+s.cfg.RunsDB,
530 "VOLE_INDEX_DB="+s.cfg.IndexDB,
528 531 )
529 532 cmd.Stdin = struct{ io.Reader }{ch}
530 533 cmd.Stdout = struct{ io.Writer }{ch}