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

Removing a port from a VLAN filtering bridge is broken #869

Closed
wkz opened this issue Dec 13, 2024 · 0 comments
Closed

Removing a port from a VLAN filtering bridge is broken #869

wkz opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working triage Pending investigation & classification (CCB)

Comments

@wkz
Copy link
Contributor

wkz commented Dec 13, 2024

Current Behavior

When operating on candidate, we should infer the removal of all VLAN memberships associated with a port being removed from the bridge.

But even if that is manually done, it is not possible to detach the port in a single transaction:

admin@infix-ad-00-00:/> configure
admin@infix-ad-00-00:/config/> no interface e2 bridge-port
admin@infix-ad-00-00:/config/> no interface br0 bridge vlans vlan 1 untagged e2
admin@infix-ad-00-00:/config/> leave
Error: EV ORIGIN: SHM event "done" ID 2 processing timed out.
Error: Can't commit to running-config

Whereas if we split it in two transactions, it works fine:

​admin@infix-ad-00-00:/> configure
admin@infix-ad-00-00:/config/> no interface br0 bridge vlans vlan 1 untagged e2
admin@infix-ad-00-00:/config/> leave
admin@infix-ad-00-00:/> configure
admin@infix-ad-00-00:/config/> no interface e2 bridge-port
admin@infix-ad-00-00:/config/> leave

This has to do with the fact that confd will incorrectly generate the VLAN deletions in the init action of the new config generation, rather than in the exit action of the previous one.

Expected Behavior

admin@infix-ad-00-00:/> configure
admin@infix-ad-00-00:/config/> no interface e2 bridge-port
admin@infix-ad-00-00:/config/> no interface br0 bridge vlans vlan 1 untagged e2
admin@infix-ad-00-00:/config/> leave

Should work

Steps To Reproduce

From the CLI:

  1. Create a VLAN bridge, attach a port to it, add it to a VLAN
  2. Remove the port

Additional information

No response

@wkz wkz added bug Something isn't working triage Pending investigation & classification (CCB) labels Dec 13, 2024
wkz added a commit that referenced this issue Dec 16, 2024
TL;DR:
> New code, all bugs removed ;)

Incremental reconfiguration of bridge related settings had lots of
ordering issues.

This change tries to remedy that by:

- Introducing the concept of "snippets": Instead of having to run C
  code in the correct order (which is doomed to fail since teardowns
  typically need to run in reverse), collect related settings in a
  snippet.  Later on, we can then concatenate snippets into a larger
  file in the proper order.

- Refactoring the bridge setup to take advantage of snippets.  Now we
  can call out to functions that _both_ generate the VLAN config _and_
  sets some bridge global options, for example.  This gets us out of
  having to pass back settings to the main generation function.

- Ensuring that deleted objects are always removed - in the proper
  order - in the exit action of the previous generation.  This was
  previously not true for VLANs, fix #869.

- Generating `mcd`:s config orthogonally from the bridge setup.  Since
  we need to keep track of _all_ bridges, figure out when VLAN uppers
  exist etc., it becomes _very_ messy to generate the configuration
  from the diff of a single interface. There were lots of cases here
  where disabling the querier service on one bridge would disable the
  whole daemon, thereby disabling the service for other bridges that
  still had it enabled.
wkz added a commit that referenced this issue Dec 16, 2024
TL;DR:
> New code, all bugs removed ;)

Incremental reconfiguration of bridge related settings had lots of
ordering issues.

This change tries to remedy that by:

- Introducing the concept of "snippets": Instead of having to run C
  code in the correct order (which is doomed to fail since teardowns
  typically need to run in reverse), collect related settings in a
  snippet.  Later on, we can then concatenate snippets into a larger
  file in the proper order.

- Refactoring the bridge setup to take advantage of snippets.  Now we
  can call out to functions that _both_ generate the VLAN config _and_
  sets some bridge global options, for example.  This gets us out of
  having to pass back settings to the main generation function.

- Ensuring that deleted objects are always removed - in the proper
  order - in the exit action of the previous generation.  This was
  previously not true for VLANs, fix #869.

- Generating `mcd`:s config orthogonally from the bridge setup.  Since
  we need to keep track of _all_ bridges, figure out when VLAN uppers
  exist etc., it becomes _very_ messy to generate the configuration
  from the diff of a single interface. There were lots of cases here
  where disabling the querier service on one bridge would disable the
  whole daemon, thereby disabling the service for other bridges that
  still had it enabled.
wkz added a commit that referenced this issue Dec 16, 2024
TL;DR:
> New code, all bugs removed ;)

Incremental reconfiguration of bridge related settings had lots of
ordering issues.

This change tries to remedy that by:

- Introducing the concept of "snippets": Instead of having to run C
  code in the correct order (which is doomed to fail since teardowns
  typically need to run in reverse), collect related settings in a
  snippet.  Later on, we can then concatenate snippets into a larger
  file in the proper order.

- Refactoring the bridge setup to take advantage of snippets.  Now we
  can call out to functions that _both_ generate the VLAN config _and_
  sets some bridge global options, for example.  This gets us out of
  having to pass back settings to the main generation function.

- Ensuring that deleted objects are always removed - in the proper
  order - in the exit action of the previous generation.  This was
  previously not true for VLANs, fix #869.

- Generating `mcd`:s config orthogonally from the bridge setup.  Since
  we need to keep track of _all_ bridges, figure out when VLAN uppers
  exist etc., it becomes _very_ messy to generate the configuration
  from the diff of a single interface. There were lots of cases here
  where disabling the querier service on one bridge would disable the
  whole daemon, thereby disabling the service for other bridges that
  still had it enabled.
wkz added a commit that referenced this issue Dec 17, 2024
TL;DR:
> New code, all bugs removed ;)

Incremental reconfiguration of bridge related settings had lots of
ordering issues.

This change tries to remedy that by:

- Introducing the concept of "snippets": Instead of having to run C
  code in the correct order (which is doomed to fail since teardowns
  typically need to run in reverse), collect related settings in a
  snippet.  Later on, we can then concatenate snippets into a larger
  file in the proper order.

- Refactoring the bridge setup to take advantage of snippets.  Now we
  can call out to functions that _both_ generate the VLAN config _and_
  sets some bridge global options, for example.  This gets us out of
  having to pass back settings to the main generation function.

- Ensuring that deleted objects are always removed - in the proper
  order - in the exit action of the previous generation.  This was
  previously not true for VLANs, fix #869.

- Generating `mcd`:s config orthogonally from the bridge setup.  Since
  we need to keep track of _all_ bridges, figure out when VLAN uppers
  exist etc., it becomes _very_ messy to generate the configuration
  from the diff of a single interface. There were lots of cases here
  where disabling the querier service on one bridge would disable the
  whole daemon, thereby disabling the service for other bridges that
  still had it enabled.
@wkz wkz closed this as completed in 9591093 Dec 19, 2024
@wkz wkz mentioned this issue Jan 30, 2025
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Pending investigation & classification (CCB)
Projects
Status: Done
Development

No branches or pull requests

1 participant