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

Support complex datemath expressions in index and index alias names #100646

Merged
merged 5 commits into from
Oct 12, 2023

Conversation

volodk85
Copy link
Contributor

Currently this call trips over if Search/Count/Reindex API is queried with complex date-math index name which contains semicolon : inside

curl -X GET "localhost:9200/%3Cdatemath-%7B2001-01-01-13%7C%7C%2B1h%2Fh%7Byyyy-MM-dd-HH%7C-07%3A00%7D%7D%3E/_count?error_trace"

(human readable index name is: <datemath-{2001-01-01-13||+1h/h{yyyy-MM-dd-HH|-07:00}}>
and it evaluates to datemath-2001-01-01-14)

{"error":{"root_cause":[{"type":"no_such_remote_cluster_exception","reason":"no such remote cluster: [<datemath-{2001-01-01-13||+1h/h{yyyy-MM-dd-HH|-07]","stack_trace":"org.elasticsearch.transport.NoSuchRemoteClusterException: no such remote cluster: [<datemath-{2001-01-01-13||+1h/h{yyyy-MM-dd-HH|-07]\n\tat org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.cluster.metadata.ClusterNameExpressionResolver.resolveClusterNames(ClusterNameExpressionResolver.java:41)\n\tat org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.transport.RemoteClusterAware.groupClusterIndices(RemoteClusterAware.java:85)\n\tat org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.transport.RemoteClusterService.groupIndices(RemoteClusterService.java:181)

More info is here #96968 (comment)

@volodk85 volodk85 added >bug :Search/Search Search-related issues that do not fall into other categories labels Oct 10, 2023
@volodk85 volodk85 requested a review from javanna October 10, 2023 22:51
@elasticsearchmachine
Copy link
Collaborator

Hi @volodk85, I've created a changelog YAML for you.

@volodk85
Copy link
Contributor Author

Jenkins run elasticsearch-ci/bwc

@volodk85 volodk85 marked this pull request as ready for review October 11, 2023 02:34
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Oct 11, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@javanna
Copy link
Member

javanna commented Oct 11, 2023

@quux00 could you have a look at this please?

@@ -160,6 +160,11 @@ private static SearchRequest skipRemoteIndexNames(SearchRequest source) {
}

private static boolean isRemoteExpression(String expression) {
return expression.contains(":");
// remote index name contains ':' symbol inside their names (remote cluster name separator), e.g. cluster0:index-name
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is worded slightly incorrectly. I think the better way to say it would be:

An index expression that references a remote cluster uses ":" to separate the cluster-alias from the index portion of the expression, e.g., cluster0:index-name ...

Copy link
Contributor

@quux00 quux00 left a comment

Choose a reason for hiding this comment

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

Other than one minor nit about javadoc comment wording, LGTM

@volodk85
Copy link
Contributor Author

Jenkins run elasticsearch-ci/part-3

@volodk85
Copy link
Contributor Author

@elasticmachine update branch

@volodk85 volodk85 merged commit 6029e55 into elastic:main Oct 12, 2023
@volodk85 volodk85 deleted the complex_datemath_index_name branch October 12, 2023 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants