-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Wait until security index is ready for role mappings #92173
Wait until security index is ready for role mappings #92173
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @grcevski, I've created a changelog YAML for you. |
…ki/elasticsearch into fix/file_settings_role_mappings_1
@elasticsearchmachine run elasticsearch-ci/part-1 |
@ywangd I think this is now ready to be reviewed. Thanks again! |
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 have a question about the new test.
logger.info("--> restart master"); | ||
internalCluster().restartNode(masterNode); |
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.
If there are multiple nodes in the cluster, I think this test may not exercise the new logic. Because once the master node is restarted, it is likely that it won't be the master anymore. Hence the file setting related code won't run at all?
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.
Good point, I'll change the test to use only a single master node.
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.
LGTM
Thanks for going the extra mile on the tests. I learned a lot from them.
Files.move(tempFilePath, fileSettingsService.operatorSettingsFile(), StandardCopyOption.ATOMIC_MOVE); | ||
} | ||
|
||
public void testFailsOnStartWithError() throws Exception { |
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.
Nit: maybe rename this to testFailsOnStartMasterNodeWithError
since data node starts fine.
@elasticsearchmachine run elasticsearch-ci/bwc |
File based settings are always stored in the cluster state, except in one case - security role mappings. The role mappings are stored in the
.security
system index. While the cluster state is immediately available on bootstrap of the Node, the system indices might take a while to become available.This PR changes the flow of updating the role mappings, such that we properly wait for the role mappings to be saved until the security index becomes available.
The code for the PR is pretty much what @ywangd provided me with :). Thanks Yang!
Outstanding item:
Closes #91939