-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Problem with Snapshots using SLM when index name has a "_" #62164
Comments
Can you provide the SLM policy you are using? It's difficult to tell from your sentence where you are using the day expression. |
|
@kuba2915 that is the problem, this line in your configuration:
Snapshots do not support specifying the indices to be snapshotted using the date math format, only the |
SLM documentation says you can use Date math expression
According to this site i use <nginx_tst-{now/d-1d}> as a snapshoted index name, and it should resolve into snapshot of index ngnix_tst-2020.09.08 But it doesn't work and I get the log as above. In version 7.8.0 it worked as it should. |
Additionally, when the index does not exist, the function correctly generates the name of the snapped index just as in log above
|
You are correct, I wasn't aware that we supported that. I did just try this with 7.9.0 however (to reproduce it), and found that it worked correctly. Do you have an index that matches the |
This also applies to version 7.9.1, I have the same problem there. I also tested the behavior when the index matching the pattern exists, and when it is removed from the cluster |
Pinging @elastic/es-core-features (:Core/Features/ILM+SLM) |
This doesn't appear to be specific to the "_" character because I can reproduce the below behavior in both 7.9 and 7.9.1. It looks like it's more related to the date math pattern and Testing using any date math pattern, with
If the index does exist, the error appears to indicate that the date math substitution is not working but the snapshot is still not taken?
|
Now I don't think this is related to the underlining sign. More like issue with date math or something else. Either the snapshot function has an incorrect condition because it also checks the data streams in new release? https://www.elastic.co/guide/en/elasticsearch/reference/7.8/create-snapshot-api.html
https://www.elastic.co/guide/en/elasticsearch/reference/7.9/create-snapshot-api.html
|
Can confirm we've noticed a similar issue after upgrading to 7.9 from 7.8, without any other change the following SLM policy is was then failing: {
"daily-snapshots" : {
"version" : 12,
"modified_date_millis" : 1600902333840,
"policy" : {
"name" : "<events-{now/d{yyyyMMdd}}>",
"schedule" : "0 30 1 * * ?",
"repository" : "gcs",
"config" : {
"include_global_state" : false,
"ignore_unavailable" : false,
"indices" : [
"<events-{now/d{yyyyMMdd}}>"
]
},
"retention" : { }
}
} {"type":"index_not_found_exception","reason":"no such index [<events-{now/d{yyyyMMdd}}>]","resource.type":"index_or_alias","resource.id":"<events-{now/d{yyyyMMdd}}>","index_uuid":"_na_","index":"<events-{now/d{yyyyMMdd}}>","stack_trace":"[<events-{now/d{yyyyMMdd}}>] IndexNotFoundException[no such index [<events-{now/d{yyyyMMdd}}>]]\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.indexNotFoundException(IndexNameExpressionResolver.java:882)\n\tat We had to set |
I can confirm this has been broken by 7.9.x
Result for 7.9.x
Result for 7.8.1:
Judging from the commits done to the slm folder before 7.9.0 and after 7.8.1, this may have been broken by #57629 Thank you @ajoliveira and @asabourin for pointing me towards using |
Elasticsearch version (
bin/elasticsearch --version
): 7.9.0Plugins installed: [] -
JVM version (
java -version
): docker containerOS version (
uname -a
if on a Unix-like system): docker container | RHEL7Description of the problem including expected versus actual behavior: unable to create snapshot of index with "" in index name. When index has a name with "", expressions for date of snapped index doesn't working
Steps to reproduce: Create SLM policy for index with "_"
Please include a minimal but complete recreation of the problem,
including (e.g.) index creation, mappings, settings, query etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.
Provide logs (if relevant):
<nginx%5Ftst-{now/d-1d}> In this case date expressions works properly
{
"type": "index_not_found_exception",
"reason": "no such index [nginx%5Ftst-2020.09.08]",
"resource.type": "index_or_alias",
"resource.id": " nginx%5Ftst-2020.09.08",
"index_uuid": "na",
"index": " nginx%5F tst-2020.09.08",
"stack_trace": "[nginx%5Ftst-2020.09.08] IndexNotFoundException[no such index [nginx%5Ftst-2020.09.08]]\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.indexNotFoundException(IndexNameExpressionResolver.java:882)\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.innerResolve(IndexNameExpressionResolver.java:819)\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.resolve(IndexNameExpressionResolver.java:775)\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.concreteIndices(IndexNameExpressionResolver.java:191)\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.concreteIndexNames(IndexNameExpressionResolver.java:171)\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.concreteIndexNames(IndexNameExpressionResolver.java:76)\n\tat org.elasticsearch.snapshots.SnapshotsService$2.execute(SnapshotsService.java:402)\n\tat org.elasticsearch.repositories.blobstore.BlobStoreRepository$1.execute(BlobStoreRepository.java:381)\n\tat org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:47)\n\tat org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702)\n\tat org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324)\n\tat org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219)\n\tat org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73)\n\tat org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151)\n\tat org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150)\n\tat org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:651)\n\tat org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252)\n\tat org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)\n\tat java.base/java.lang.Thread.run(Thread.java:832)\n"
}
<nginx_tst-{now/d-1d}>
{
“type": "index_not_found_exception",
"reason": "no such index [<nginx_tst-{now/d-1d}>]",
"resource.type": "index_or_alias",
"resource.id": "<nginx_tst-{now/d-1d}>",
"index_uuid": "na",
"index": "<nginx_tst-{now/d-1d}>",
"stack_trace": "[<nginx_tst-{now/d-1d}>] IndexNotFoundException[no such index [<nginx_tst-{now/d-1d}>]]\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.indexNotFoundException(IndexNameExpressionResolver.java:882)\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.innerResolve(IndexNameExpressionResolver.java:819)\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.resolve(IndexNameExpressionResolver.java:775)\n\tat org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.dataStreamNames(IndexNameExpressionResolver.java:122)\n\tat org.elasticsearch.snapshots.SnapshotsService$2.execute(SnapshotsService.java:405)\n\tat org.elasticsearch.repositories.blobstore.BlobStoreRepository$1.execute(BlobStoreRepository.java:381)\n\tat org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:47)\n\tat org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702)\n\tat org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324)\n\tat org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219)\n\tat org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73)\n\tat org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151)\n\tat org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150)\n\tat org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:651)\n\tat org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252)\n\tat org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)\n\tat java.base/java.lang.Thread.run(Thread.java:832)\n"
}
The text was updated successfully, but these errors were encountered: