# Rollover max\_size precision

**URL:** <https://discuss.elastic.co/t/rollover-max-size-precision/194326>\
**Category:** Elasticsearch\
**Created:** [August 7, 2019, 8:56pm UTC](https://discuss.elastic.co/t/rollover-max-size-precision/194326 "2019-08-07T20:56:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimyoo](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jimyoo](https://discuss.elastic.co/u/jimyoo)\
**Post date:** [August 7, 2019, 8:56pm UTC](https://discuss.elastic.co/t/rollover-max-size-precision/194326/1 "2019-08-07T20:56:34Z")

</div>

I am seeing an interesting behavior on Rollover Index.  
When "max\_size" is given with little bit smaller than the current index size, sometimes (or some indices) the rollover succeeds sometime it fails.  
For example, the current index size 2682mb and rollover "max\_size" condition is given as 2500mb.

Is this an expected behavior? Any explanation?

I use this API to get the index current size:

> GET /\_cat/indices/myIndex\*?h=index,pri.store.size&bytes=m

Curl command example:

> POST /myIndex/\_rollover  
> {  
> "conditions": {  
> "max\_size": "2500mb"  
> },  
> "settings" :  
> {  
> "index.number\_of\_shards" : 5  
> }  
> }

Elasticsearch version: 6.8  
I don't use any other condition.  
I am adding more documents on indices so they are growing; I check the current size first before sending the Rollover API.

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![jimyoo](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jimyoo](https://discuss.elastic.co/u/jimyoo)\
**Post date:** [August 9, 2019, 9:37pm UTC](https://discuss.elastic.co/t/rollover-max-size-precision/194326/2 "2019-08-09T21:37:26Z")

</div>

Did little study on the ES source code and I see \_cat and rollover API (condition check) use different stats - one is from lucene store directory and one is from lucene segment.  
That might explain this issue b/c two stats may be different.  
It would be good if someone know why they use different stats, if my observation is correct. And/or any suggested ES API to get stats from lucene segment (the stats that rollover uses).

---

<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:** [September 6, 2019, 9:37pm UTC](https://discuss.elastic.co/t/rollover-max-size-precision/194326/3 "2019-09-06T21:37:26Z")

</div>

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