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

A higher level API for state management #245

Closed
sajith opened this issue Dec 9, 2024 · 2 comments · Fixed by #253
Closed

A higher level API for state management #245

sajith opened this issue Dec 9, 2024 · 2 comments · Fixed by #253
Assignees

Comments

@sajith
Copy link
Member

sajith commented Dec 9, 2024

Spinning this off #244.

There could be a TEManager.get_state() method that returns all the state we care about, and then SDX Controller would not have to care about details (topologies present, VLAN/bandwidth/latency allocations):

# At various SDX Controller checkpoints:
state = temanager.get_state()
db.upsert("temanager-state", state)
# During SDX Controller startup:
state = db.read("temanager-state")
temanager.restore_state(state)

Basically: when there are events that cause state to change (a topology is published, a new connection is made, a link was cut, service degraded... etc?), SDX Controller would have to call TEManager.get_state() and save the results in the DB. And then SDX Controller should call TEManager.restore_state() at startup, so that PCE can resume its work between SDX Controller restarts.

If PCE was a service, we probably could have done this in an even more transparent manner -- in that case PCE would get to maintain its state persistently (in a DB), but since PCE is only a library, SDX Controller will have to do the state management.

Thoughts, @YufengXin, @congwang09, @italovalcy?

@sajith sajith self-assigned this Dec 9, 2024
@YufengXin
Copy link
Collaborator

We discussed making PCE a service earlier, too much hustle for the time.

But what you described can be considered a 'virtual" PCE service, just use sdx-controller + DB as the API front-:). I can see it should work fine.

It would be beneficial to formally define the TE manager state and state transition ontology, as we're trying to do for the connection state.

@YufengXin YufengXin self-assigned this Jan 30, 2025
@YufengXin
Copy link
Collaborator

To ensure consistency and simplicity for sdx_controller, both available_bandwidth and vlan_range in port service are updated in the topology JSON objects that are saved in DB.

After crash recovery, the topology objects with the latest states will be recovered from the DB.

@YufengXin YufengXin linked a pull request Feb 4, 2025 that will close this issue
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 a pull request may close this issue.

2 participants