Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route failover considers disabled routes as new primaries #1706

Closed
2 tasks
derelm opened this issue Jan 31, 2024 · 0 comments · Fixed by #1707
Closed
2 tasks

route failover considers disabled routes as new primaries #1706

derelm opened this issue Jan 31, 2024 · 0 comments · Fixed by #1707
Labels
bug Something isn't working

Comments

@derelm
Copy link
Contributor

derelm commented Jan 31, 2024

Bug description

Headscale doesn't look at the Enabled flag for any route failover candidates which can lead to setting the IsPrimary value to true on an otherwise disabled route, possibly breaking routing.

Environment

  • OS: Mac / Linux

  • Headscale version: v0.23.0-alpha3

  • Tailscale version: 1.58.2

  • Headscale is behind a (reverse) proxy

  • Headscale runs in a container

To Reproduce

  • Bring up two tailscale nodes (A and B) advertising the same route (eg 10.0.0.0/24). Enable A's advertised route in your headscale server. A will be primary. Test routing - it should be working fine at this point. B's route should be disabled and not primary.
  • Reboot / power down the tailscale node A with the Enabled & Primary route.
  • Check output of headscale routes ls - you should see B's disabled route get set to primary
  • Once you bring A back, test routing - it should fail at this point. B's route is still primary but disabled, A's route is enabled but not primary

I would expect that headscale doesn't consider disabled routes for new primary role/failover. Unfortunately i don't know how the official tailscale server handles this case.

@derelm derelm added the bug Something isn't working label Jan 31, 2024
derelm added a commit to derelm/headscale that referenced this issue Jan 31, 2024
derelm added a commit to derelm/headscale that referenced this issue Jan 31, 2024
kradalby pushed a commit that referenced this issue Feb 3, 2024
* fix #1706 - failover should disregard disabled routes during failover

* fixe tests for failover; all current tests assume routes to be enabled

* add testcase for #1706 - failover to disabled route
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant