[PR #2670] [MERGED] Node store #2794

Closed
opened 2025-12-29 04:19:00 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2670
Author: @kradalby
Created: 7/6/2025
Status: Merged
Merged: 9/9/2025
Merged by: @kradalby

Base: mainHead: kradalby/nodestore-experiment


📝 Commits (10+)

  • 64028e2 fix: improve mapresponses and profiles extraction in hi tool
  • a7c602e integration: validate expected online status in ping
  • 1cb7415 cmd/hi: add ability to collect resource stats
  • c17c8b9 .github/workflows: fail tests if hs or ts is using too much memory
  • 83a3767 .github/workflows: add generate check
  • 8ca8e31 CLAUDE.md: add project file, lets call it a test
  • ee0e43c mcp: add some standard mcp server
  • 6b60ce2 CLAUDE: split into agents
  • eafc0dd mapper: produce map before poll
  • 670ca8c cmd/hi: lint and format

📊 Changes

81 files changed (+10256 additions, -2745 deletions)

View changed files

.claude/agents/headscale-integration-tester.md (+763 -0)
📝 .github/ISSUE_TEMPLATE/feature_request.yaml (+3 -6)
📝 .github/workflows/integration-test-template.yml (+4 -18)
.mcp.json (+48 -0)
📝 CLAUDE.md (+264 -129)
📝 cmd/headscale/cli/nodes.go (+1 -2)
📝 cmd/hi/docker.go (+3 -2)
📝 cmd/hi/run.go (+3 -3)
📝 cmd/hi/stats.go (+36 -33)
cmd/mapresponses/main.go (+61 -0)
📝 gen/go/headscale/v1/apikey.pb.go (+1 -1)
📝 gen/go/headscale/v1/device.pb.go (+1 -1)
📝 gen/go/headscale/v1/headscale.pb.go (+1 -1)
📝 gen/go/headscale/v1/node.pb.go (+1 -1)
📝 gen/go/headscale/v1/policy.pb.go (+1 -1)
📝 gen/go/headscale/v1/preauthkey.pb.go (+1 -1)
📝 gen/go/headscale/v1/user.pb.go (+1 -1)
📝 go.sum (+0 -2)
📝 hscontrol/app.go (+47 -68)
📝 hscontrol/auth.go (+38 -38)

...and 61 more files

📄 Description

See individual commits.

Mainly:

state/nodestore: in memory representation of nodes
90beef7
Initial work on a nodestore which stores all of the nodes
and their relations in memory with relationship for peers
precalculated.

It is a copy-on-write structure, replacing the "snapshot"
when a change to the structure occurs. It is optimised for reads,
and while batches are not fast, they are grouped together
to do less of the expensive peer calculation if there are many
changes rapidly.

Writes will block until commited, while reads are never
blocked.

Signed-off-by: Kristoffer Dalby kristoffer@tailscale.com


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2670 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 7/6/2025 **Status:** ✅ Merged **Merged:** 9/9/2025 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `kradalby/nodestore-experiment` --- ### 📝 Commits (10+) - [`64028e2`](https://github.com/juanfont/headscale/commit/64028e25af549ff8beb3c206564a66dae547443b) fix: improve mapresponses and profiles extraction in hi tool - [`a7c602e`](https://github.com/juanfont/headscale/commit/a7c602ef26cff83287514b5ccaa3af615e80afc6) integration: validate expected online status in ping - [`1cb7415`](https://github.com/juanfont/headscale/commit/1cb7415a61e9bca7fb5b3d7f0d11d5ff37770437) cmd/hi: add ability to collect resource stats - [`c17c8b9`](https://github.com/juanfont/headscale/commit/c17c8b9936a2972abf0418ccc3a11c170ea4c773) .github/workflows: fail tests if hs or ts is using too much memory - [`83a3767`](https://github.com/juanfont/headscale/commit/83a3767281302c36c9b5bf2f7e339bec9bbdd912) .github/workflows: add generate check - [`8ca8e31`](https://github.com/juanfont/headscale/commit/8ca8e31bb4bbff56684b29745580c84412b6ffef) CLAUDE.md: add project file, lets call it a test - [`ee0e43c`](https://github.com/juanfont/headscale/commit/ee0e43ceb43a8a57f5e7f4eca674daa1e34550bb) mcp: add some standard mcp server - [`6b60ce2`](https://github.com/juanfont/headscale/commit/6b60ce24255daaa4af41117c6feee2fddf0f960f) CLAUDE: split into agents - [`eafc0dd`](https://github.com/juanfont/headscale/commit/eafc0dda5d3207570415a649938e00ada7b520a8) mapper: produce map before poll - [`670ca8c`](https://github.com/juanfont/headscale/commit/670ca8cb0505bf9eb043f88caadf76b90730b587) cmd/hi: lint and format ### 📊 Changes **81 files changed** (+10256 additions, -2745 deletions) <details> <summary>View changed files</summary> ➕ `.claude/agents/headscale-integration-tester.md` (+763 -0) 📝 `.github/ISSUE_TEMPLATE/feature_request.yaml` (+3 -6) 📝 `.github/workflows/integration-test-template.yml` (+4 -18) ➕ `.mcp.json` (+48 -0) 📝 `CLAUDE.md` (+264 -129) 📝 `cmd/headscale/cli/nodes.go` (+1 -2) 📝 `cmd/hi/docker.go` (+3 -2) 📝 `cmd/hi/run.go` (+3 -3) 📝 `cmd/hi/stats.go` (+36 -33) ➕ `cmd/mapresponses/main.go` (+61 -0) 📝 `gen/go/headscale/v1/apikey.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/device.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/headscale.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/node.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/policy.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/preauthkey.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/user.pb.go` (+1 -1) 📝 `go.sum` (+0 -2) 📝 `hscontrol/app.go` (+47 -68) 📝 `hscontrol/auth.go` (+38 -38) _...and 61 more files_ </details> ### 📄 Description See individual commits. Mainly: [state/nodestore: in memory representation of nodes](https://github.com/juanfont/headscale/pull/2670/commits/90beef7b6c8d84fdc45362d1b3d6fd2d944e3fd3) [90beef7](https://github.com/juanfont/headscale/pull/2670/commits/90beef7b6c8d84fdc45362d1b3d6fd2d944e3fd3) Initial work on a nodestore which stores all of the nodes and their relations in memory with relationship for peers precalculated. It is a copy-on-write structure, replacing the "snapshot" when a change to the structure occurs. It is optimised for reads, and while batches are not fast, they are grouped together to do less of the expensive peer calculation if there are many changes rapidly. Writes will block until commited, while reads are never blocked. Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 04:19:00 +01:00
adam closed this issue 2025-12-29 04:19:00 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2794