Skip to content

Conversation

@kradalby
Copy link
Collaborator

@kradalby kradalby commented Dec 13, 2025

This commit rebuilds the system for how we propagate
changes in headscale to make sure we send the appropriate
map response based on the changes that has occured instead
of sending a full map response when we do not know what to
do or to be lazy.

This closes gaps where we did not updates peers correctly
when a node was assigned or taken away from a node, or it
was changed in the Policy, and required the nodes to be
informed about changes to the network map.

Additional information in commits

Fixes #2389

claude was used in this PR.

@kradalby kradalby force-pushed the kradalby/2389-tags-propagation branch from a9241e1 to e5e19f4 Compare December 13, 2025 09:06
@kradalby kradalby force-pushed the kradalby/2389-tags-propagation branch 5 times, most recently from a38fb33 to eae5976 Compare December 15, 2025 11:00
@kradalby kradalby force-pushed the kradalby/2389-tags-propagation branch from eae5976 to 56a5062 Compare December 15, 2025 12:31
@kradalby kradalby changed the title wip 2389 tags: ensure tag changes propagate Dec 15, 2025
This commit changes so that node changes to the policy is
calculated if any of the nodes has changed in a way that might
affect the policy.

Previously we just checked if the number of nodes had changed,
which meant that if a node was added and removed, we would be
in a bad state.

Signed-off-by: Kristoffer Dalby <[email protected]>
This commit adds tests to validate that there are
issues with how we propagate tag changes in the system.

This replicates juanfont#2389

Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby kradalby force-pushed the kradalby/2389-tags-propagation branch from 56a5062 to a7f6c5c Compare December 15, 2025 14:40
@kradalby kradalby marked this pull request as ready for review December 15, 2025 14:41
@kradalby kradalby force-pushed the kradalby/2389-tags-propagation branch from a7f6c5c to 9f32dc5 Compare December 15, 2025 14:46
This commit replaces the ChangeSet with a simpler bool based
change model that can be directly used in the map builder to
build the appropriate map response based on the change that
has occured. Previously, we fell back to sending full maps
for a lot of changes as that was consider "the safe" thing to
do to ensure no updates were missed.

This was slightly problematic as a node that already has a list
of peers will only do full replacement of the peers if the list
is non-empty, meaning that it was not possible to remove all
nodes (if for example policy changed).

Now we will keep track of last seen nodes, so we can send remove
ids, but also we are much smarter on how we send smaller, partial
maps when needed.

Fixes juanfont#2389

Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby kradalby force-pushed the kradalby/2389-tags-propagation branch from 9f32dc5 to c84d04a Compare December 15, 2025 14:50
@kradalby kradalby enabled auto-merge (rebase) December 15, 2025 16:29
@kradalby kradalby merged commit 21ba197 into juanfont:main Dec 16, 2025
128 of 130 checks passed
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.

[Bug] Tags applied to nodes are not applied in ACL until headscale service is restarted after adding the tag

2 participants