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

Test that built-in roles get synced after rolling upgrade #119841

Conversation

slobodanadamovic
Copy link
Contributor

Adds a BWC test to verify that built-in roles get synced to the .security index after rolling upgrade completes.

Adds a rolling upgrade tests to verify that built-in roles get synced
to the `.security` index after rolling upgrade completes.
@slobodanadamovic slobodanadamovic added >test Issues or PRs that are addressing/adding tests :Security/Security Security issues without another label Team:Security Meta label for security team test-full-bwc Trigger full BWC version matrix tests v8.18.0 labels Jan 9, 2025
@slobodanadamovic slobodanadamovic self-assigned this Jan 9, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;

public class QueryableBuiltInRolesUpgradeIT extends AbstractUpgradeTestCase {
Copy link
Contributor Author

@slobodanadamovic slobodanadamovic Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is only relevant when upgrading from versions before 8.18.0, hence I think it makes no sense to add it to the main branch (9.0.0) as we will only ever update from 8.18.0 to 9.0.0 and both branches support queryable roles feature.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it might still be worth it to include as a sanity-check that the roles sync does not somehow interfere with the upgrade. It's just a matter of also having the test suite in main right? Or is it more complex than that?

Copy link
Contributor Author

@slobodanadamovic slobodanadamovic Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing which would be worthy is having es.queryable_built_in_roles_enabled set to true for all BWC tests. This is something I plan to change in the near future. But I'm okay to forward-port this PR to the main in the mean time.

@slobodanadamovic slobodanadamovic added auto-backport Automatically create backport pull requests when merged v9.0.0 labels Jan 10, 2025
Copy link
Contributor

@n1v0lg n1v0lg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- one non-blocking question.

final int numberOfNodes = 3; // defined in build.gradle
waitForNodes(numberOfNodes);

final Set<TestNodeInfo> nodes = collectNodeInfos(adminClient());
Copy link
Contributor

@n1v0lg n1v0lg Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we use clusterHasFeature instead? Not blocking since the current approach works but clusterHasFeature seems like a better fit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clusterHasFeature is not quite fitting my use case right out of the box. I need to know which nodes (based on the version) in the cluster support which features. Knowing that the whole cluster (or just some of the nodes) support the queryable feature, is not very helpful. I need a distinction between old and new nodes and their supported features.

I could make it work similarly to ParameterizedFullClusterRestartTestCase and keep a copy of old cluster's feature service and then combine decision making with a new feature services (mixed and upgraded), but that also felt too hacky as I simply need to know supported nodes_features and their versions.

@slobodanadamovic slobodanadamovic merged commit fdc3208 into elastic:8.x Jan 10, 2025
20 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
main

slobodanadamovic added a commit to slobodanadamovic/elasticsearch that referenced this pull request Jan 10, 2025
…9841)

Adds a BWC test to verify that built-in roles get synced to the 
`.security` index after rolling upgrade completes.
elasticsearchmachine pushed a commit that referenced this pull request Jan 11, 2025
…120003)

Adds a BWC test to verify that built-in roles get synced to the 
`.security` index after rolling upgrade completes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Security/Security Security issues without another label Team:Security Meta label for security team >test Issues or PRs that are addressing/adding tests test-full-bwc Trigger full BWC version matrix tests v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants