AMBARI-14637 - Downgrade failed with error Failed to merge entity during Save cluster state (jonathanhurley)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e86e44e8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e86e44e8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e86e44e8 Branch: refs/heads/branch-dev-patch-upgrade Commit: e86e44e8d0391e0f9cc63fec80c7332dfac4cd1b Parents: ec580b1 Author: Jonathan Hurley <[email protected]> Authored: Tue Jan 12 14:33:31 2016 -0500 Committer: Nate Cole <[email protected]> Committed: Thu Jan 14 11:43:27 2016 -0500 ---------------------------------------------------------------------- .../java/org/apache/ambari/server/state/cluster/ClusterImpl.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/e86e44e8/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java index c43f235..43fdb76 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java @@ -3267,6 +3267,10 @@ public class ClusterImpl implements Cluster { public void removeConfigurations(StackId stackId) { clusterGlobalLock.writeLock().lock(); try { + // make sure the entity isn't stale in the current unit of work. + ClusterEntity clusterEntity = getClusterEntity(); + clusterDAO.refresh(clusterEntity); + removeAllConfigsForStack(stackId); cacheConfigurations(); } finally {
