ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hurley" <jhur...@hortonworks.com>
Subject Re: Review Request 42319: Cannot Finalize Downgrade Due To Detached ClusterEntity
Date Fri, 15 Jan 2016 15:30:50 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42319/
-----------------------------------------------------------

(Updated Jan. 15, 2016, 10:30 a.m.)


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


Bugs: AMBARI-14674
    https://issues.apache.org/jira/browse/AMBARI-14674


Repository: ambari


Description
-------

RU HDP 2.2 to 2.4 downgrade results in:

{code}
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(EntityManagerImpl.java:1024)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(EntityManagerImpl.java:929)
	at org.apache.ambari.server.orm.dao.ClusterDAO.refresh(ClusterDAO.java:309)
	at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:68)
	at org.apache.ambari.server.state.cluster.ClusterImpl.removeConfigurations(ClusterImpl.java:3216)
	at org.apache.ambari.server.serveraction.upgrades.FinalizeUpgradeAction.finalizeDowngrade(FinalizeUpgradeAction.java:314)
    ...
{code}

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.


Diffs
-----

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

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

  ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java d2ba396


Diff: https://reviews.apache.org/r/42319/diff/


Testing (updated)
-------

mvn clean test

Tests run: 3747, Failures: 0, Errors: 0, Skipped: 27

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32:00 min
[INFO] Finished at: 2016-01-15T10:21:35-05:00
[INFO] Final Memory: 36M/1390M
[INFO] ------------------------------------------------------------------------


Thanks,

Jonathan Hurley


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