# Configurable retention lease period when it comes to CCR

**URL:** https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276
**Category:** Elasticsearch
**Tags:** ccr-cross-cluster-replication
**Created:** [January 16, 2020, 9:20am UTC](https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276 "2020-01-16T09:20:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)
#### Post date: [January 16, 2020, 9:20am UTC](https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276/1 "2020-01-16T09:20:23Z")

</div>

Hello everyone!

I have a question regarding the retention lease period when it comes to CCR.

So, usually the proper way to set this lease period is to do it on index creation time.

Recently we noticed, that this property is also configurable during runtime. On the other hand, the soft\_deletes are not configurable at runtime at all.

So my question is, is it actually possible to configure the retention lease period at runtime or is this some kind wrong behavior?

Thanks in advance!

Edit: Oh, we are running ES 6.8.1

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [January 16, 2020, 10:39am UTC](https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276/2 "2020-01-16T10:39:03Z")

</div>

Yes, it's possible to adjust the retention lease period at runtime, and this was a deliberate decision. If your CCR follower fails and you know in advance that it will take ≥12h to bring it back online then you can increase the lease period to retain history for longer so that the followers can catch up when eventually they recover. (edit, removed a sentence here about reducing the retention lease period, see my next post...)

---

<div class="post-metadata">

### Author: ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)
#### Post date: [January 16, 2020, 10:42am UTC](https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276/3 "2020-01-16T10:42:26Z")

</div>

Thank you for clarifying David 🙂

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [January 16, 2020, 10:48am UTC](https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276/4 "2020-01-16T10:48:54Z")

</div>

Important correction: the history retained by retention leases is also used for fast replica recoveries in more recent versions (≥7.4.0) so setting the retention period to zero is a bad idea. Sorry for the confusion.

---

<div class="post-metadata">

### Author: ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)
#### Post date: [January 16, 2020, 10:56am UTC](https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276/5 "2020-01-16T10:56:08Z")

</div>

Hmm, what exactly is "fast replica recovery"? Can't find anything related to that...

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [January 16, 2020, 11:15am UTC](https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276/6 "2020-01-16T11:15:07Z")

</div>

Um, I just mean recovering replicas quickly. It's not the name of a feature or anything like that 😁

Since 6.0 Elasticsearch has been able to recover replicas quickly by replaying history thanks to [sequence numbers](https://www.elastic.co/blog/elasticsearch-sequence-ids-6-0). From 7.4.0 onwards we use retention leases to make sure we keep that history around, much like we do for CCR.

---

<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: [February 13, 2020, 11:15am UTC](https://discuss.elastic.co/t/configurable-retention-lease-period-when-it-comes-to-ccr/215276/7 "2020-02-13T11:15:10Z")

</div>

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