# Datastream does not rollover properly

**URL:** <https://discuss.elastic.co/t/datastream-does-not-rollover-properly/259295>\
**Category:** Elasticsearch\
**Tags:** datastreams\
**Created:** [December 21, 2020, 6:58pm UTC](https://discuss.elastic.co/t/datastream-does-not-rollover-properly/259295 "2020-12-21T18:58:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Russell\_Fulton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russell_fulton/32/62888_2.png) [@Russell\_Fulton](https://discuss.elastic.co/u/Russell_Fulton)\
**Post date:** [December 21, 2020, 6:58pm UTC](https://discuss.elastic.co/t/datastream-does-not-rollover-properly/259295/1 "2020-12-21T18:58:55Z")

</div>

I have a data stream that I am writing to and which has reached its rollover point -- current actions says rollover but there is no 000002 index. Time given for the rollover is 8 hours ago:

 ![Screen Shot 2020-12-22 at 7.49.00 AM](https://us1.discourse-cdn.com/elastic/original/3X/4/9/49286f268fa57e782d1d552fb6bc81a7c8aa48e8.png)

definition:

```auto
{
  "policy": "dns_logs",
  "phase_definition": {
    "min_age": "0ms",
    "actions": {
      "rollover": {
        "max_size": "5gb",
        "max_age": "1d"
      },
      "set_priority": {
        "priority": 50
      }
    }
  },
  "version": 6,
  "modified_date_in_millis": 1608545491994
}

```

||.ds-dns\_ds-000001|green|open|2|1|71706171|9.2gb|[dns\_ds]

the datastream is still still being written to but the document count on 000001 is not increasing and client is not giving any errors.

Any suggestions as to what is going on.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 21, 2020, 7:08pm UTC](https://discuss.elastic.co/t/datastream-does-not-rollover-properly/259295/2 "2020-12-21T19:08:32Z")

</div>

Rollover is based on primary shard size, which still seems below 5GB given that you have a replica configured.

---

<div class="post-metadata">

**Author:** ![Russell\_Fulton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russell_fulton/32/62888_2.png) [@Russell\_Fulton](https://discuss.elastic.co/u/Russell_Fulton)\
**Post date:** [December 21, 2020, 7:22pm UTC](https://discuss.elastic.co/t/datastream-does-not-rollover-properly/259295/3 "2020-12-21T19:22:03Z")

</div>

Ah! Thanks! I never thought of that...  
I figured it was something simple

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 21, 2020, 7:37pm UTC](https://discuss.elastic.co/t/datastream-does-not-rollover-properly/259295/4 "2020-12-21T19:37:43Z")

</div>

You can change the number of replicas at any time so considering the primary shard size makes it consistent.

---

<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:** [January 18, 2021, 7:38pm UTC](https://discuss.elastic.co/t/datastream-does-not-rollover-properly/259295/5 "2021-01-18T19:38:16Z")

</div>

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