# How do index rollover and tier transition work when they overlap

**URL:** <https://discuss.elastic.co/t/how-do-index-rollover-and-tier-transition-work-when-they-overlap/329240>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management, datastreams\
**Created:** [April 3, 2023, 5:08pm UTC](https://discuss.elastic.co/t/how-do-index-rollover-and-tier-transition-work-when-they-overlap/329240 "2023-04-03T17:08:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EyadArafat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyadarafat/32/119381_2.png) [@EyadArafat](https://discuss.elastic.co/u/EyadArafat)\
**Post date:** [April 3, 2023, 5:08pm UTC](https://discuss.elastic.co/t/how-do-index-rollover-and-tier-transition-work-when-they-overlap/329240/1 "2023-04-03T17:08:51Z")

</div>

Hi,  
I'm a little confused on how transitioning a data stream's write index to the warm phase would work if it's still not supposed to be rolled-over yet.

Here's an example. Let's say I have an ILM to rollover the data stream indices when they reach an absurd 500 GBs, but also the policy is set to transition the index to the warm tier when the index is just 1 day old.

Now what happens when the index is just 10 GBs in size, but 2 days old? Is it rolled-over? Is it moved to the warm phase even though it's the data stream's write index?

In generic terms, what happens when the data stream's write index hasn't met the rollover criteria but it did meet the phase transitioning criteria?

Is this mentioned in the docs anywhere? I couldn't find it.

Thanks!

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 3, 2023, 5:57pm UTC](https://discuss.elastic.co/t/how-do-index-rollover-and-tier-transition-work-when-they-overlap/329240/2 "2023-04-03T17:57:50Z")

</div>

> [@EyadArafat](#):
>
> In generic terms, what happens when the data stream's write index hasn't met the rollover criteria but it did meet the phase transitioning criteria?

Hi @EyadArafat Welcome to the community!

Good Question!

Rollover is the first Phase.

Transition to the warm / next phase is calculated from Rollover...

See [Here](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index-lifecycle-management.html#ilm-gs-create-policy)

> A lifecycle policy specifies the phases in the index lifecycle and the actions to perform in each phase. A lifecycle can have up to five phases: `hot`, `warm`, `cold`, `frozen`, and `delete`.
> 
> For example, you might define a `timeseries_policy` that has two phases:
> 
> - A `hot` phase that defines a rollover action to specify that an index rolls over when it reaches either a `max_primary_shard_size` of 50 gigabytes or a `max_age` of 30 days.
> - A `delete` phase that sets `min_age` to remove the index 90 days after rollover.
> 
> **The `min_age` value is relative to the rollover time, not the index creation time.**

So say your rollover takes 30 days BUT you have Warm at 7 Days... Then Warm would happen at 37 Days 🙂

There are some detailed setting to change that behavior but if you are just getting started I would understand this first and work from there.

---

<div class="post-metadata">

**Author:** ![EyadArafat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyadarafat/32/119381_2.png) [@EyadArafat](https://discuss.elastic.co/u/EyadArafat)\
**Post date:** [April 3, 2023, 8:14pm UTC](https://discuss.elastic.co/t/how-do-index-rollover-and-tier-transition-work-when-they-overlap/329240/3 "2023-04-03T20:14:59Z")

</div>

Ah I see. That makes sense. Thanks!

So that means I can set the transition to warm to be done on '0 days' to have the index move straight to the warm tier once it gets rolled-over, right?

That way I can only keep the write-able indices in the hot tier and all the read-only indices in the warm tier.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 3, 2023, 10:42pm UTC](https://discuss.elastic.co/t/how-do-index-rollover-and-tier-transition-work-when-they-overlap/329240/4 "2023-04-03T22:42:52Z")

</div>

Correct... Just FYI, It Will not happen instantly. It will happen soon after. Just letting you know some people expect it to happen within milliseconds. ILM is a background task that runs on about a 10 minute interval or so.

---

<div class="post-metadata">

**Author:** ![EyadArafat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyadarafat/32/119381_2.png) [@EyadArafat](https://discuss.elastic.co/u/EyadArafat)\
**Post date:** [April 4, 2023, 9:51pm UTC](https://discuss.elastic.co/t/how-do-index-rollover-and-tier-transition-work-when-they-overlap/329240/5 "2023-04-04T21:51:07Z")

</div>

Got it. That clears everything up, thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 2, 2023, 9:51pm UTC](https://discuss.elastic.co/t/how-do-index-rollover-and-tier-transition-work-when-they-overlap/329240/6 "2023-05-02T21:51:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
