ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sid Wagle" <>
Subject Re: Review Request 40374: Refactor delete configs on delete service action
Date Tue, 17 Nov 2015 18:10:54 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated Nov. 17, 2015, 6:10 p.m.)

Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Myroslav Papirkovskyy, Sumit
Mohanty, and Sebastian Toader.

Bugs: AMBARI-13894

Repository: ambari


Today, when you delete Service, the code deletes ServiceConfig entries associated with the
Service. This in turn deletes ClusterConfig entities due to a Cascade.REMOVE on the many to
many relationship.
Stack allows a multiple services to be dependent on the same config while today ServiceConfig
and ClusterConfig are not used that way as UI only shows one kind of config on a single page.

If this changes in future then the ManyToMany relationship with CASCADE delete may create
problem. Also, there is no API way to restrict this.

- Remove Casacade.REMOVE from the ServiceConfigEntity -> ClusterConfigEntity
- Move @Transactional remove inside the Write lock boundaries()
- Modified deleteService to remove Config history and not ClusterConfigs

Diffs (updated)

  ambari-server/src/main/java/org/apache/ambari/server/state/ 74f9e02 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ 36e4a01

  ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ edd6267



Added a new unit test for deleteService changes.

Manually verified Add Service -> Change configs -> Delete Service -> Re-add service,
Verify Service Config points to default configs.


Sid Wagle

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message