Generally management-service
is a adhesive that joins all the other services together. Because of that, despite of managing it's own state it can also alter other service's state. For example, registering new gateway entity comes with some sort of external side effects:
/etc/common/ccd
directory is altered by creation of new file - config that holds ip address of particular gateway
certificate store
is altered when new client's certificate with pk is created
Those two exemplary actions are executed in a chain - whenever chain of procedures fail, procedures that are forth in a chain won't be executed, but the procedures that have already been executed might had polluted some external state.
In a tiny environment it shouldn't be a problem, but generally it's something that shouldn't happen - procedures need to form transactional chain, so external state will be modified only when all procedures have executed successfully, if any of them fail, everything should be rolled back to the state that occured before attempt to execute transactional chain.
Since this issue is far well complicated that one can think, maybe other ways of cleaning global state should be iplemented, for example - periodical job that would clean orphaned pieces of state, i.e. certificate not associated to any entity etc. It would be probably less elegant solution, but also easier to implement.
Stack overflow thread can be found here, by the time this issue is created there are no answers or comments at all, what might imply that problem of transactions is not trivial at all.