ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hurley" <>
Subject Review Request 42319: Cannot Finalize Downgrade Due To Detached ClusterEntity
Date Thu, 14 Jan 2016 20:34:28 GMT

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

Review request for Ambari, Alejandro Fernandez, Jayush Luniya, and Nate Cole.

Bugs: AMBARI-14674

Repository: ambari


RU HDP 2.2 to 2.4 downgrade results in:

java.lang.IllegalArgumentException: Can not refresh not managed object: org.apache.ambari.server.orm.entities.ClusterEntity@18126.
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(
	at org.apache.ambari.server.orm.dao.ClusterDAO.refresh(
	at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(
	at org.apache.ambari.server.state.cluster.ClusterImpl.removeConfigurations(
	at org.apache.ambari.server.serveraction.upgrades.FinalizeUpgradeAction.finalizeDowngrade(

It seems like what's happening is that the ClusterEntity is being retrieved outside of a JPA
session. Although the ClusterDAO creates the session, it also ends it, leaving the Entity
detached. We should instead be refreshing this Entity within the bounds of the Transaction.


  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ 22bd8bb 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ 3938e31

  ambari-server/src/main/java/org/apache/ambari/server/upgrade/ 3d00c29



I performed several upgrades and downgrades and only saw the problem once. After my changes,
I haven't seen it since. I can artificially reproduce it by clearing the EM cache. Working
on a test now that tries to capture this scenario since it's the silent-but-deadly type.


Jonathan Hurley

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