-
Improvement
-
Resolution: Unresolved
-
Low
-
None
-
None
-
None
The code to dispatch transaction effects is duplicated across hwvtep/ovs code, both sharing the same structure:
- there is a base AbstractTransactionCommand which holds schema and updates (and specialization for the particular southbound)
- there is a set of commands subclassing it and calling TyperUtils to process updates
- there is a top-level aggregator, which calls each of the command to select its effects
Aside from the obvious code duplication, there is processing overhead, as we process the updates multiple times - i.e. for each command. Furthermore some commands have overlap on what data they are processing, for example PhysicalLocator updates are processed in HwvtepUcastMacsLocalUpdateCommand, HwvtepMcastMacsLocalUpdateCommand, HwvtepPhysicalLocatorRemoveCommand, etc. etc.
The library should provide a basic harness in form of:
- a protocol-agnostic base command, which would expose the tables it is interested in
- a protocol-agnostic base aggregator, which would examine all commands and build the required dataset and dispatch the modules (towards a protocol-specific abstract method)
- the required dataset should also be better decomposed - it seems command logic is looking for before- and after-state, but for some things we may want a delta access