UST-MICO / mico

A Management System for Microservice Compositions
Apache License 2.0
8 stars 3 forks source link

Adjust DEPTH Parameter for Repository Save's Individually #646

Open vetterjn opened 5 years ago

vetterjn commented 5 years ago

By default, calling save(entity) from Brokers on Repositories saves the whole object (to infinity). A problem occurs, when the Java object does not have the same depth as the DB object. A save(entity) will delete information (and especially edges of the graph).

Therefore, we need to update the save(entity) calls and use the method save(entity, depth). Then, we can adjust the depth parameter for each call individually.

For more information, see Neo4j OGM Manual | Save depth.

Will be covered by #690.

buehlefs commented 5 years ago

As far as I know only KubernetesDeploymentInfo nodes are directly connected to this problem. The should have an edge pointing to the mico service but never have an edge to any other node in the db currently. They get updated and saved in the get application status endpoint. @davidkopp can you complete the neccessary information?

JakobBenz commented 5 years ago

Actually a KubernetesDeploymentInfo node is attached to a MicoServiceDeploymentInfo node via a :HAS relationship (same for labels, environment variables and interface connections).

davidkopp commented 5 years ago

The issue with the lost edge to KubernetesDeploymentInfo and the issue with the deleted edge between MicoServiceDeploymentInfo and the corresponding MicoService after an update of the MicoServiceDeploymentInfo are both fixed. Nevertheless we should check all save methods if it make sense to set the depth parameter (minimal as possible) to prevent such kinds of issue in the future.