-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
ILM shrink action does not retain creation_date #42206
Comments
It seems the issue has already been fixed for 6.8 release by this commit. |
Pinging @elastic/es-core-features |
The 6.7.2 release tag does copy the settings with the resize request: Line 61 in 56c6e48
Can you share more of your policy and example use case so I can understand what you're trying to do? |
@dakrone Thanks for your answer. So there must be some other issue, as I still experience the described behavior. Please find my ILM policy below:
What happens is that after transition to warm phase the Use caseThere are multiple logs indices. Some of them are created with time pattern in their name, e.g. "logs_web.%{+xxxx.ww}", which creates a new index every week. It is important that none of the indices is written again after 8 days since their creation. At that moment, I want to speed up search and save memory, so I shrink all indices to one shard, forcemerge them to one segment and also set their priority to 50. Everything works well, goal is achieved, but the issue with |
ILM doesn't use Line 46 in 45873b1
This is what is used when determining whether to transition to a state: Line 80 in 45873b1
Are you seeing your indices transition later than expected? I can try to reproduce this behavior and see whether there's a bug there. |
Yes, I do. The issue is that |
I ran a test today to try and reproduce this: First, setting up the poll interval for every 5 seconds: PUT /_cluster/settings
{
"transient": {
"logger.org.elasticsearch.xpack.core.indexlifecycle": "TRACE",
"logger.org.elasticsearch.xpack.indexlifecycle": "TRACE",
"indices.lifecycle.poll_interval": "5s"
}
} I created a policy that had only shrink and delete, waiting 1 minute to shrink, and deleting when the index is 2 minutes old PUT _ilm/policy/shrink-only
{
"policy": {
"phases": {
"warm": {
"min_age": "1m",
"actions": {
"shrink": {
"number_of_shards": 1
}
}
},
"delete": {
"min_age": "2m",
"actions": {
"delete": {}
}
}
}
}
} And then create an index using it: PUT /shrink-test
{
"settings": {
"number_of_shards": 2,
"number_of_replicas": 0,
"index.lifecycle.name": "shrink-only"
}
} Here are excerpts from the logs. First, the index is created, ILM is waiting for it to be at least 1 minute old before moving into the "warm" phase:
After being > 1 minute old, it moves to the warm phase and eventually shrinks at 10:41:16 (~70 seconds after it was created), creating the
The original index
Now it waits for the
At 10:42:06 it moves into the delete phase, finally deleting the index at 10:42:11, 2 minutes and 5 seconds after the original index was created:
The behavior you were describing sounds like it would only be deleted after 3 minutes instead of after 2. Are you able to reproduce this behavior in your environment? |
@dakrone Thanks for your effort. My version was 6.7.2, my scenario was a bit different:
|
@GoodMirek I was doing this with the master branch. Maybe it behaves differently if it is pre-existing indices, I'll try it with 6.7.2 and your scenario and see if I can get it to reproduce that way. |
I tested the scenario that you described @GoodMirek, but I was unable to reproduce any scenario where the date didn't work correctly for shrunked indices. |
@dakrone Thanks for your effort. I have no further ideas why and how that happened. |
Elasticsearch version (
bin/elasticsearch --version
):6.7.2 (Elastic Cloud)
Plugins installed: [repository-s3]
JVM version (
java -version
):not sure, as it is hosted by elastic
OS version (
uname -a
if on a Unix-like system):not sure, as it is hosted by elastic
Description of the problem including expected versus actual behavior:
When index is shrunk by ILM, it does not retain original index settings. Most importantly, it does not retain
creation_date
, what causes that further ILM processing does not happen at originally planned time.Similar to elastic/curator#1347
Steps to reproduce:
The text was updated successfully, but these errors were encountered: