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

Resolve date math expressions before looking up index metadata #75314

Merged

Conversation

danhermann
Copy link
Contributor

@danhermann danhermann commented Jul 13, 2021

This is somewhat similar to #69727 except that in this case, the final pipeline is set directly on an existing index rather than in a template. The root cause of the issue was looking for the ingest pipelines on index metadata before resolving any date math expressions in the index name.

Fixes #75047

@danhermann danhermann added >bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP v8.0.0 v7.14.1 v7.15.0 labels Jul 13, 2021
@danhermann danhermann requested a review from dakrone July 13, 2021 19:39
@danhermann
Copy link
Contributor Author

@dakrone, would you mind looking at this one as you reviewed the similar fix in #71433?

@danhermann danhermann marked this pull request as ready for review July 13, 2021 19:40
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Jul 13, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)


// index name matches with IDM:
IndexRequest indexRequest = new IndexRequest("<idx-{now/d}>");
boolean result = IngestService.resolvePipelines(indexRequest, indexRequest, metadata);
Copy link
Member

Choose a reason for hiding this comment

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

I believe this will very rarely fail when the first call to System.currentTimeMillis() on line 1382 is called on one day, then this is called on the next day (across the day delineation I mean).

Is it worth adding a parameter that allows overriding the time used when resolving for this test? (I only say since we've had failures related to this with data streams and dates in index names)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, worth it. Added in b934eb4

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Dan!

@danhermann danhermann merged commit 5ed1edf into elastic:master Jul 15, 2021
@danhermann danhermann deleted the 75047_final_pipeline_not_executed branch July 15, 2021 12:16
@danhermann
Copy link
Contributor Author

Thanks, @dakrone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP Team:Data Management Meta label for data/management team v7.14.0 v7.15.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Final pipeline not executed for indexing requests which include date math expressions
5 participants