-
Notifications
You must be signed in to change notification settings - Fork 24.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
Use origin for the client when running _features/_reset #88622
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @grcevski, I've created a changelog YAML for you. |
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.
Left a few small comments but this looks like a good approach. Do we know what in particular requires the per-descriptor origin?
StringBuilder exceptions = new StringBuilder("["); | ||
exceptions.append(errors.stream().map(e -> e.getException().getMessage()).collect(Collectors.joining(", "))); | ||
exceptions.append(']'); | ||
listener.onResponse(ResetFeatureStateStatus.failure(name, new Exception(exceptions.toString()))); |
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.
Could you also add logging that captures the full stack traces? It's nitpicky but it's no fun when we hit a weird error and realize there's no way to get the actual stack trace.
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.
Sure sounds good.
} | ||
|
||
@Nullable | ||
static SystemIndexDescriptor findMatchingDescriptor(SystemIndexDescriptor[] indexDescriptors, String name) { |
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'm not objecting necessarily, but why break this out? I assumed it was for testing in my first pass given it's pkg-private, but there's no tests that use this version looks like.
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.
You are right, no need for that to be separate.
...ty/src/internalClusterTest/java/org/elasticsearch/integration/SecurityFeatureResetTests.java
Show resolved
Hide resolved
…csearch/integration/SecurityFeatureResetTests.java Co-authored-by: Gordon Brown <[email protected]>
I'm not sure if there's a plugin where there's not 1-1 mapping of feature to origin. I simply erred on the side of caution since the origin is on the descriptor, I decided to split everything. |
@@ -73,15 +74,15 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett | |||
.put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, "0-1") | |||
.build() | |||
) | |||
.setOrigin("net-new") |
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.
Fake origins don't work anymore, since we actually switch the security. I picked tasks since it's not in a module.
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 iterating!
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
💔 Backport failed
You can use sqren/backport to manually backport by running |
The current implementation of
POST /_features/_reset
doesn't pass the index descriptor origin when callingDELETE
on the system indices, therefore, we fail to reset the respective indices.Closes #88617