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

[BUG] Invalid time pattern placement in dynamic index pattern shuts down pipeline #3386

Open
engechas opened this issue Sep 26, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@engechas
Copy link
Collaborator

Describe the bug
DataPrepper does not allow time patterns to be in dynamic index patterns unless they are the suffix of the pattern: https://github.com/opensearch-project/data-prepper/blob/main/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/index/AbstractIndexManager.java#L127

This causes the pipeline to shutdown at runtime when data is sent to a sink who's index pattern violates this condition.

ERROR org.opensearch.dataprepper.pipeline.common.PipelineThreadPoolExecutor - Pipeline [***] process worker encountered a fatal exception, cannot proceed further
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Time pattern can only be a suffix of an index

To Reproduce
Create a pipeline with this index pattern in an opensearch sink:

prefix-%{yyyy.MM.dd}-suffix

Expected behavior
It's unclear why DataPrepper does not support non-suffix time patterns. If this is not a hard restriction then I would expect this validation to be removed. If it is a hard restriction then I would expect this to be validated during initialization rather than throwing an exception and shutting down the pipeline at runtime.

@dlvenable
Copy link
Member

I believe that this is a suffix because that will work with our index and ISM patterns. I think the simplest solution is to solve the bug by validating on start-up.

We could consider an enhancement to support non-suffix in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants