Skip to content

Commit

Permalink
Adding support for restart upgrades for plugins bwc
Browse files Browse the repository at this point in the history
Signed-off-by: Vacha <vachshah@amazon.com>
  • Loading branch information
VachaShah committed Aug 10, 2021
1 parent e616879 commit 7216b78
Showing 1 changed file with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,32 +392,26 @@ public void goToNextVersion() {
writeUnicastHostsFiles();
}

public void upgradeAllNodesAndPluginsToNextVersion(List<Provider<RegularFile>> plugins) {
stop(false);
nodes.all(OpenSearchNode::goToNextVersion);
upgradePlugin(plugins);
start();
writeUnicastHostsFiles();
}

public void fullRestart() {
stop(false);
start();
}

public void nextNodeToNextVersion() {
if (nodeIndex + 1 > nodes.size()) {
throw new TestClustersException("Ran out of nodes to take to the next version");
}
OpenSearchNode node = nodes.getByName(clusterName + "-" + nodeIndex);
node.stop(false);
node.goToNextVersion();
commonNodeConfig(node, null, null);
nodeIndex += 1;
OpenSearchNode node = upgradeNodeToNextVersion();
node.start();
}

public void upgradeNodeAndPluginToNextVersion(List<Provider<RegularFile>> plugins) {
if (nodeIndex + 1 > nodes.size()) {
throw new TestClustersException("Ran out of nodes to take to the next version");
}
OpenSearchNode node = nodes.getByName(clusterName + "-" + nodeIndex);
node.stop(false);
node.goToNextVersion();
commonNodeConfig(node, null, null);
nodeIndex += 1;
OpenSearchNode node = upgradeNodeToNextVersion();
node.upgradePlugin(plugins);
node.start();
}
Expand Down Expand Up @@ -453,6 +447,18 @@ private void writeUnicastHostsFiles() {
});
}

private OpenSearchNode upgradeNodeToNextVersion() {
if (nodeIndex + 1 > nodes.size()) {
throw new TestClustersException("Ran out of nodes to take to the next version");
}
OpenSearchNode node = nodes.getByName(clusterName + "-" + nodeIndex);
node.stop(false);
node.goToNextVersion();
commonNodeConfig(node, null, null);
nodeIndex += 1;
return node;
}

@Override
@Internal
public String getHttpSocketURI() {
Expand Down

0 comments on commit 7216b78

Please sign in to comment.