Currently (2022.3), we've been storing active southbound protocol state from Interface, Switch and Links on switches and links collections. However, this isn't actually necessary since the southbound protocol (OpenFlow) always needs to be activated again once controller restarts or switches connect, and we're already paying the price to keep these object structures in memory, which all of them are used in the rest routes, and we won't completely offload these ones in the DB since it'd be a massive refactoring. If we stop storing the active field we can gain/simplify the following:
Fewer DB writes in this case
Simpler to ensure thread safety while managing locks (related to https://github.com/kytos-ng/topology/issues/139#issuecomment-1597116656). It'll make it simpler to protect critical shared resource (interface and links) activation and deactivation since we also don't to hold a lock when doing IO since MongoDB already guarantee atomicity per-document, and it could slow things down considerably, especially on handlers that have a high concurrency in certain cases.
Currently (
2022.3
), we've been storingactive
southbound protocol state fromInterface
,Switch
andLinks
onswitches
andlinks
collections. However, this isn't actually necessary since the southbound protocol (OpenFlow) always needs to be activated again once controller restarts or switches connect, and we're already paying the price to keep these object structures in memory, which all of them are used in the rest routes, and we won't completely offload these ones in the DB since it'd be a massive refactoring. If we stop storing theactive
field we can gain/simplify the following: