-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support for bwc tests for plugins #1051
Changes from all commits
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 |
---|---|---|
|
@@ -186,6 +186,11 @@ public void plugin(String pluginProjectPath) { | |
nodes.all(each -> each.plugin(pluginProjectPath)); | ||
} | ||
|
||
@Override | ||
public void upgradePlugin(List<Provider<RegularFile>> plugins) { | ||
nodes.all(each -> each.upgradePlugin(plugins)); | ||
} | ||
|
||
@Override | ||
public void module(Provider<RegularFile> module) { | ||
nodes.all(each -> each.module(module)); | ||
|
@@ -387,20 +392,27 @@ public void goToNextVersion() { | |
writeUnicastHostsFiles(); | ||
} | ||
|
||
public void upgradeAllNodesAndPluginsToNextVersion(List<Provider<RegularFile>> plugins) { | ||
stop(false); | ||
nodes.all(OpenSearchNode::goToNextVersion); | ||
upgradePlugin(plugins); | ||
start(); | ||
writeUnicastHostsFiles(); | ||
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. Curious: Do we need to |
||
} | ||
|
||
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) { | ||
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. This is nice. It works for rolling upgrade/mixed cluster cases where we upgrade node by node.
Minor nit: I wish we didn't duplicate it but I dont see another way too :/ 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 missed that! I will add that method as well since we are adding bwc support. For the duplication, yeah I had to create a new method since the plugins have to be added before starting the node and this would otherwise affect OpenSearch bwc tests :/ 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. Added support for full cluster restarts/restart upgrades. I have also tried to reduce duplication where possible. 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. Awesome, we should be able to leverage restart cluster infra for snapshot upgrades. Essentially its taking snapshot one old version, store it in a repo, restart the cluster to new version and restore the snapshot. 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. Sure, opened an issue for tracking snapshot upgrade tests #1088. |
||
OpenSearchNode node = upgradeNodeToNextVersion(); | ||
node.upgradePlugin(plugins); | ||
node.start(); | ||
} | ||
|
||
|
@@ -435,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() { | ||
|
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.
I assume the only valid case for this function is during restart upgrades.
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.
Yeah I had to override it since it is added in interface
TestClusterConfiguration
.