Skip to content

Make computeFSClosure() much faster over SSH - #539

Merged
cole-h merged 3 commits into
mainfrom
query-multiple
Jul 7, 2026
Merged

cole-h merged 3 commits into
mainfrom
query-multiple

Conversation

@edolstra

@edolstra edolstra commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

This adds a new QueryPathInfos operation to the RemoteStore protocol to query multiple store paths at once. It's based on the new queryPathInfos() API from #523.

It cuts the runtime of nix-store --store 'ssh-ng://root@127.0.0.1' -qR /nix/store/65k3ks18q0g1wq8c0hm6g1xsya3c5k1g-foo.drv (a 10432-path NixOS system closure, where the loopback interface has an artificial 10ms latency) from 119.7s to 2.0s.

Context

edolstra added 3 commits July 7, 2026 17:03
This is intended to allow a store to query multiple paths in a single
call.

Taken from #523.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Add a batched QueryPathInfos operation to the worker protocol, gated
behind a new "queryPathInfos" protocol feature, and use it to
implement an efficient RemoteStore::queryPathInfos() override.

Previously, querying path infos from a remote store required a
network round-trip per store path, which is extremely slow over
high-latency links (e.g. in computeFSClosure()). Now the entire set
of paths is sent in a single operation. The response contains the
infos for the valid paths; paths not reported are invalid.

The client answers what it can from the in-memory path info cache
first, updates the cache with the results (including negative
entries), and falls back to the per-path base implementation for
daemons that don't support the new operation.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The head commit changed during the review from 1928bf5 to ac149f5.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch query-multiple

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 7, 2026 15:06 Inactive
@cole-h
cole-h added this pull request to the merge queue Jul 7, 2026
Merged via the queue into main with commit 90f7dca Jul 7, 2026
32 checks passed
@cole-h
cole-h deleted the query-multiple branch July 7, 2026 16:00

This branch was previously deployed

1 inactive deployment
pull request — ac149f57 Deployed Jul 7, 2026 by github-actions[bot]
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