ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alejandro Fernandez" <>
Subject Re: Review Request 36592: RU - Magician Script to correct data inconsistencies, allow retrying repo installation, force finalize to versions, etc
Date Mon, 10 Aug 2015 20:26:59 GMT

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

(Updated Aug. 10, 2015, 8:26 p.m.)

Review request for Ambari, Jonathan Hurley, Nate Cole, Sid Wagle, and Yusaku Sako.


Removed option 4), which is a coding joke, from the prompt.

Bugs: AMBARI-12455

Repository: ambari


Support has identified the need to come up with a script to fix any mismatches in the database,
or identify problems during Rolling Upgrade.
This can be a simple Python script that,

- On a newly installed cluster, ensures that there is at least one cluster version whose state
is CURRENT. If not, will advise the user to restart services.
- If the user has Registered and Installed repos, check that each one has a unique version
and display name. Further, if any are stuck in an INSTALLING state, will let the user take
three potential actions: leave as is, force to INSTALLED, force to INSTALL_FAILED.
- If the user has Registered and Installed repos, and one cluster_version is already in an
UPGRADING state, perhaps because hdp-select changed the symlinks and a component was restarted,
or the user inadvertently started a manual upgrade, will allow the user to force it back to
- If the user in the in the middle of an upgrade, and they want to force one of the versions
are CURRENT, it will update all DB records accordingly, and set the previously CURRENT version
For now, this will support Ambari 2.0.0 and higher, and MySQL, and Postgres.

Diffs (updated)

  contrib/ru_magician/ PRE-CREATION 
  contrib/ru_magician/lgpl_license.txt PRE-CREATION 
  contrib/ru_magician/mit_license.txt PRE-CREATION 
  contrib/ru_magician/ PRE-CREATION 
  pom.xml 5b5c860 



Tested on Ambari 2.1.0 with Postgres, and Ambari 2.0.1 on MySQL (using local and external
DB), all of the scenarios above.
I still have to do more thorough testing in the cases of Finalize, but this is a good preliminary
patch to start getting some feedback.

I could have used SQLAlchemy as my ORM, but I really wanted a standalone script that could
be a quick v1, so I went for raw SQL that works on both Postgres & MySQL.


Alejandro Fernandez

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