-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[Ambari-22986] branch 2.6 - Not able to add Livy2 after doing rolling upgrade to M21 #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,9 +18,14 @@ | |
| package org.apache.ambari.server.upgrade; | ||
|
|
||
| import java.sql.SQLException; | ||
| import java.util.Map; | ||
|
|
||
| import org.apache.ambari.server.AmbariException; | ||
| import org.apache.ambari.server.controller.AmbariManagementController; | ||
| import org.apache.ambari.server.orm.DBAccessor; | ||
| import org.apache.ambari.server.state.Cluster; | ||
| import org.apache.ambari.server.state.Clusters; | ||
| import org.apache.ambari.server.state.StackId; | ||
|
|
||
| import com.google.inject.Inject; | ||
| import com.google.inject.Injector; | ||
|
|
@@ -61,6 +66,29 @@ private void addHostRequestStatusColumn() throws SQLException { | |
|
|
||
| @Override | ||
| protected void executePreDMLUpdates() throws AmbariException, SQLException { | ||
| fixDesiredStack(); | ||
| } | ||
|
|
||
| /** | ||
| * if desired stack < current stack, set current stack as desired | ||
| * | ||
| * @throws AmbariException | ||
| */ | ||
| private void fixDesiredStack() throws AmbariException { | ||
| AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class); | ||
| Clusters clusters = ambariManagementController.getClusters(); | ||
| if (clusters != null) { | ||
| Map<String, Cluster> clusterMap = getCheckedClusterMap(clusters); | ||
| if (clusterMap != null && !clusterMap.isEmpty()) { | ||
| for (final Cluster cluster : clusterMap.values()) { | ||
| StackId desiredStack = cluster.getDesiredStackVersion(); | ||
| StackId currentStack = cluster.getCurrentStackVersion(); | ||
| if (desiredStack.compareTo(currentStack) < 0) { | ||
| cluster.setDesiredStackVersion(currentStack); | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If desired stack is > current stack, that's also a problem. Can you change this to a !equals() call instead?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume that user is not expected to perform Ambari upgrade with a paused stack upgrade? Ok, will change the logic
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jonathan-hurley , regarding EU updates cluster desired version during upgrade and downgrade at
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's what I expected. However, I didn't see it in there. Can you identify where exactly it's set?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
and below at the same file for downgrade.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was looking in trunk :) Thanks! |
||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you already have a StackId, no need to make a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, did you happen to test an EU?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested EU, works well