-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Simplifying the way the simulate ingest API uses component template substitutions for pipeline lookup and mapping validation #113908
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
Conversation
…ubstitutions for mapping validation
Pinging @elastic/es-data-management (Team:Data Management) |
…he pipeline-lookup side of simulate ingest
} | ||
} | ||
|
||
public void testResolvePipelinesAndUpdateIndexRequestWithComponentTemplateSubstitutions() throws IOException { |
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.
This test could be deleted because IngestService no longer knows anything about component template substitutions.
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.
What a nice change @masseyke , love it! In general it looks good, I did voice some concern in case this is called with a data stream as a target but apart from that LGTM.
server/src/main/java/org/elasticsearch/action/bulk/TransportAbstractBulkAction.java
Show resolved
Hide resolved
* we don't fall back to the existing index if we don't find any because it is possible the user has intentionally removed the | ||
* pipeline. | ||
*/ | ||
final Pipelines pipelines; |
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.
We need to update this comment and mention that in order of the simulation to work we would need to remove any existing index/data stream. I am thinking that now this can easily be missed.
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.
Oh good point! I had forgotten about this comment.
/* | ||
* If this is a simulated request, and there are template substitutions, then we want to create and use a new metadata that has | ||
* those templates. | ||
*/ |
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 think it will be really helpful to refer here to the methods that require this to work properly.
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 added a bit here. Let me know if there's something else that would be helpful.
- not_exists: docs.0.doc.error | ||
|
||
--- | ||
"Test ingest simulate with component template substitutions for data streams": |
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.
<3
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, great work @masseyke !
💚 Backport successful
|
…ubstitutions for pipeline lookup and mapping validation (elastic#113908)
…ubstitutions for pipeline lookup and mapping validation (elastic#113908)
This simplifies the way that component template substitutions are passed around for mapping validation. Instead of separately passing them throughout the stack, TransportSimulateBulkAction now puts them int its simulatedState (a modified cluster state that is only used for the duration of the request).
A nice side effect of this change is that it makes some upcoming work to allow for index template substitutions much easier.
This relates to #113276, #112957, and #113063.