Skip to content

Conversation

masseyke
Copy link
Member

@masseyke masseyke commented Oct 1, 2024

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.

@masseyke masseyke added >non-issue :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP v8.16.0 v9.0.0 labels Oct 1, 2024
@masseyke masseyke marked this pull request as ready for review October 2, 2024 12:44
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Oct 2, 2024
@masseyke masseyke requested a review from dakrone October 2, 2024 12:49
@masseyke masseyke removed the request for review from dakrone October 2, 2024 14:36
@masseyke masseyke marked this pull request as draft October 2, 2024 21:53
}
}

public void testResolvePipelinesAndUpdateIndexRequestWithComponentTemplateSubstitutions() throws IOException {
Copy link
Member Author

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.

@masseyke masseyke changed the title Simplifying the way the simulate ingest API uses component template substitutions for mapping validation Simplifying the way the simulate ingest API uses component template substitutions for pipeline lookup and mapping validation Oct 2, 2024
@masseyke masseyke marked this pull request as ready for review October 2, 2024 22:17
@gmarouli gmarouli self-requested a review October 3, 2024 06:30
Copy link
Contributor

@gmarouli gmarouli left a 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.

* 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;
Copy link
Contributor

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.

Copy link
Member Author

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.

Comment on lines 187 to 190
/*
* 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.
*/
Copy link
Contributor

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.

Copy link
Member Author

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.

@masseyke masseyke requested a review from gmarouli October 3, 2024 18:32
- not_exists: docs.0.doc.error

---
"Test ingest simulate with component template substitutions for data streams":
Copy link
Contributor

Choose a reason for hiding this comment

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

<3

Copy link
Contributor

@gmarouli gmarouli left a 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 !

@masseyke masseyke merged commit 8997822 into elastic:main Oct 4, 2024
16 checks passed
@masseyke masseyke deleted the simplify-simulate-ingest-component-template-substitutions branch October 4, 2024 12:40
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

masseyke added a commit to masseyke/elasticsearch that referenced this pull request Oct 4, 2024
…ubstitutions for pipeline lookup and mapping validation (elastic#113908)
elasticsearchmachine pushed a commit that referenced this pull request Oct 4, 2024
…ubstitutions for pipeline lookup and mapping validation (#113908) (#114126)
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 10, 2024
…ubstitutions for pipeline lookup and mapping validation (elastic#113908)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >non-issue Team:Data Management Meta label for data/management team v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants