Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/370#discussion_r23767951
--- Diff:
software/base/src/main/java/brooklyn/entity/brooklynnode/effector/BrooklynNodeUpgradeEffectorBody.java
---
@@ -132,44 +193,34 @@ public Void call(ConfigBag parametersO) {
Predicates.equalTo(ManagementNodeState.HOT_STANDBY),
Duration.FIVE_MINUTES));
// 3 stop new version
- // 4 stop old version
- ConfigBag stopParameters = ConfigBag.newInstance();
- stopParameters.put(StopSoftwareParameters.STOP_MACHINE,
Boolean.FALSE);
- DynamicTasks.queue(Tasks.builder().name("shutdown original and
transient nodes")
- .add(Effectors.invocation(dryRunChild,
BrooklynNode.STOP_NODE_BUT_LEAVE_APPS, stopParameters))
- .add(Effectors.invocation(entity(),
BrooklynNode.STOP_NODE_BUT_LEAVE_APPS, stopParameters))
+ DynamicTasks.queue(Tasks.builder().name("shutdown transient node")
+ .add(Effectors.invocation(dryRunChild,
BrooklynNode.STOP_NODE_BUT_LEAVE_APPS,
ImmutableMap.of(StopSoftwareParameters.STOP_MACHINE, Boolean.FALSE)))
.build());
- // 5 move old files, and move new files
- DynamicTasks.queue(Tasks.builder().name("setup new
version").body(new Runnable() {
- @Override
- public void run() {
- String runDir =
entity().getAttribute(SoftwareProcess.RUN_DIR);
- String bkDir = Urls.mergePaths(runDir, "..",
Urls.getBasename(runDir)+"-backups", dryRunNodeUid);
- String dryRunDir =
Preconditions.checkNotNull(dryRunChild.getAttribute(SoftwareProcess.RUN_DIR));
- log.debug(this+" storing backup of previous version in
"+bkDir);
- DynamicTasks.queue(SshEffectorTasks.ssh(
- "cd "+runDir,
- "mkdir -p "+bkDir,
- "mv * "+bkDir,
- "cd "+dryRunDir,
- "mv * "+runDir
--- End diff --
looks like we lose the two lines above? i think that's fine, but wanted to
check.
it means the `runDir` contents will have to be repopulated from the
(already downloaded) `installDir`, costing perhaps a few extra seconds of
downtime. should be easy enough to add these two statements back in the case
where dryRun has just been done if we wanted to. but it does feel a bit dodgy.
no strong feelings...
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---