Skip to content
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

STORM-2682: Fix issues with null owner on rolling upgrade (1.0.x) #2267

Merged
merged 1 commit into from
Aug 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions storm-core/src/jvm/org/apache/storm/daemon/supervisor/Slot.java
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,17 @@ public void run() {
LOG.info("SLOT {}: Changing current assignment from {} to {}", staticState.port, dynamicState.currentAssignment, nextState.currentAssignment);
saveNewAssignment(nextState.currentAssignment);
}

if (equivalent(nextState.newAssignment, nextState.currentAssignment) &&
nextState.currentAssignment != null && nextState.currentAssignment.get_owner() == null &&
nextState.newAssignment != null && nextState.newAssignment.get_owner() != null) {
//This is an odd case for a rolling upgrade where the user on the old assignment may be null,
// but not on the new one. Although in all other ways they are the same.
// If this happens we want to use the assignment with the owner.
LOG.info("Updating assignment to save owner {}", nextState.newAssignment.get_owner());
saveNewAssignment(nextState.newAssignment);
nextState = nextState.withCurrentAssignment(nextState.container, nextState.newAssignment);
}

// clean up the profiler actions that are not being processed
removed.removeAll(dynamicState.profileActions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ public void run() {
for (String stormId : downloadedStormIds) {
LocalAssignment la = assignedStormIds.get(stormId);
if (la != null) {
String stormRoot = ConfigUtils.supervisorStormDistRoot(conf, stormId);
LOG.debug("Checking Blob updates for storm topology id {} With target_dir: {}", stormId, stormRoot);
updateBlobsForTopology(conf, stormId, supervisor.getLocalizer(), la.get_owner());
if (la.get_owner() == null) {
//We got a case where the local assignment is not up to date, no point in going on...
LOG.warn("The blobs will not be updated for {} until the local assignment is updated...", stormId);
} else {
String stormRoot = ConfigUtils.supervisorStormDistRoot(conf, stormId);
LOG.debug("Checking Blob updates for storm topology id {} With target_dir: {}", stormId, stormRoot);
updateBlobsForTopology(conf, stormId, supervisor.getLocalizer(), la.get_owner());
}
}
}
} catch (Exception e) {
Expand Down