# Gateway Snapshot settings & unexpected behaviour (maybe bug?)

**URL:** <https://discuss.elastic.co/t/gateway-snapshot-settings-unexpected-behaviour-maybe-bug/5897>\
**Category:** Elasticsearch\
**Created:** [November 17, 2011, 5:03am UTC](https://discuss.elastic.co/t/gateway-snapshot-settings-unexpected-behaviour-maybe-bug/5897 "2011-11-17T05:03:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_smith/32/1323_2.png) [@Paul\_Smith](https://discuss.elastic.co/u/Paul_Smith)\
**Post date:** [November 17, 2011, 5:03am UTC](https://discuss.elastic.co/t/gateway-snapshot-settings-unexpected-behaviour-maybe-bug/5897/1 "2011-11-17T05:03:25Z")

</div>

Way back I added this feature request  
[https://github.com/elasticsearch/elasticsearch/issues/906](https://github.com/elasticsearch/elasticsearch/issues/906) which got added,  
many thanks.

Except it doesn't seem to be working as we understand it. We have a 2-node  
setup, with the gateway snapshot set to fs:

gateway:  
type: fs  
fs:  
location: /mnt/esgateway/

We then do the following:

- set the disable\_flushing property to true as outlined in Issue #906
- set the snapshot interval to 0 (index.gateway.snapshot\_interval)

However when muting the index under these settings we see via the  
filesystem and via TRACE level debugging that the node responsible for the  
gateway snapshot, while reporting that the settings for disable\_flush and  
snapshot\_interval were set correctly, promptly goes and does a snapshot  
muting the snapshot directory state as soon as we. This means that the  
snapshot directory can't be safely copied if I understand correctly. We  
were expecting once the disable\_flush and disabling the snapshot and  
performing a manual flush really should allow a safe copy with no  
filesystem mutations before we reenable them again.

Here's a gist of the logs: [https://gist.github.com/1372395](https://gist.github.com/1372395)

Feels like we're misinterpreting something or a bug.

As a side note, using the \_setting API, it a GET only reports a small set  
of values initially, and then if we modify the disable\_flush and  
snapshot\_interval via the \_settings api only then to the values start  
appearing. Is there any reason that all settings values shouldn't be  
displayed always?

cheers,

Paul

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 20, 2011, 7:54am UTC](https://discuss.elastic.co/t/gateway-snapshot-settings-unexpected-behaviour-maybe-bug/5897/2 "2011-11-20T07:54:54Z")

</div>

The disable flush flag was introduced so backing up when using the local  
gateway was simpler, its not really needed with shared gateway (like the fs  
shared one you use), and disabling the snapshot interval should be enough  
for it.

What you say is that when you set the snapshot interval to 0, a snapshot  
still happens?

Regarding the settings, the one returned for the get settings API are only  
the ones explicitly set, it does not return settings with "default" values.

On Thu, Nov 17, 2011 at 7:03 AM, Paul Smith [tallpsmith@gmail.com](mailto:tallpsmith@gmail.com) wrote:

> Way back I added this feature request  
> [Simplified Disable Flush operation · Issue #906 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/906) which got  
> added, many thanks.
> 
> Except it doesn't seem to be working as we understand it. We have a  
> 2-node setup, with the gateway snapshot set to fs:
> 
> gateway:  
> type: fs  
> fs:  
> location: /mnt/esgateway/
> 
> We then do the following:
> 
> - set the disable\_flushing property to true as outlined in Issue #906
> - set the snapshot interval to 0 (index.gateway.snapshot\_interval)
> 
> However when muting the index under these settings we see via the  
> filesystem and via TRACE level debugging that the node responsible for the  
> gateway snapshot, while reporting that the settings for disable\_flush and  
> snapshot\_interval were set correctly, promptly goes and does a snapshot  
> muting the snapshot directory state as soon as we. This means that the  
> snapshot directory can't be safely copied if I understand correctly. We  
> were expecting once the disable\_flush and disabling the snapshot and  
> performing a manual flush really should allow a safe copy with no  
> filesystem mutations before we reenable them again.
> 
> Here's a gist of the logs: [Despite disable\_flush and snapshot\_interval set to 0, snapshotting to the filesystem is being done. · GitHub](https://gist.github.com/1372395)
> 
> Feels like we're misinterpreting something or a bug.
> 
> As a side note, using the \_setting API, it a GET only reports a small set  
> of values initially, and then if we modify the disable\_flush and  
> snapshot\_interval via the \_settings api only then to the values start  
> appearing. Is there any reason that all settings values shouldn't be  
> displayed always?
> 
> cheers,
> 
> Paul

---

<div class="post-metadata">

**Author:** ![Paul\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_smith/32/1323_2.png) [@Paul\_Smith](https://discuss.elastic.co/u/Paul_Smith)\
**Post date:** [November 20, 2011, 10:18pm UTC](https://discuss.elastic.co/t/gateway-snapshot-settings-unexpected-behaviour-maybe-bug/5897/3 "2011-11-20T22:18:32Z")

</div>

On 20 November 2011 18:54, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> The disable flush flag was introduced so backing up when using the local  
> gateway was simpler, its not really needed with shared gateway (like the fs  
> shared one you use), and disabling the snapshot interval should be enough  
> for it.

Ok, thanks, that makes sense.

> What you say is that when you set the snapshot interval to 0, a snapshot  
> still happens?

Yes, when set to 0, periodic/timed snapshots stop happening, but as soon as  
we index something the snapshot happens (see the log gist). We tried  
experimenting setting the snapshot internal to a large number, and that  
_does_ work EXCEPT when resetting interval value one has to wait for the  
larger interval value to complete before the new setting takes affect.  
This is presumably because the thread sleeps until that larger interval  
value and isn't woken up when the configuration changes.

Should I write up a bug report for this snapshot\_interva=0 doesn't work?

> Regarding the settings, the one returned for the get settings API are only  
> the ones explicitly set, it does not return settings with "default" values.

Is there any way other than looking at the docs to then interpret what a  
particular setting is configured to then?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 22, 2011, 9:52am UTC](https://discuss.elastic.co/t/gateway-snapshot-settings-unexpected-behaviour-maybe-bug/5897/4 "2011-11-22T09:52:23Z")

</div>

I posted it on the issue you opened, but can you try and set the  
snapshot\_interval setting to -1, 0 will not disable it properly.

Regarding the other problems, changing the snapshot interval should affect  
it immediately, it will cancel the previous periodic task, and schedule a  
new one.

On Mon, Nov 21, 2011 at 12:18 AM, Paul Smith [tallpsmith@gmail.com](mailto:tallpsmith@gmail.com) wrote:

> On 20 November 2011 18:54, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > The disable flush flag was introduced so backing up when using the local  
> > gateway was simpler, its not really needed with shared gateway (like the fs  
> > shared one you use), and disabling the snapshot interval should be enough  
> > for it.
> 
> Ok, thanks, that makes sense.
> 
> > What you say is that when you set the snapshot interval to 0, a  
> > snapshot still happens?
> 
> Yes, when set to 0, periodic/timed snapshots stop happening, but as soon  
> as we index something the snapshot happens (see the log gist). We tried  
> experimenting setting the snapshot internal to a large number, and that  
> _does_ work EXCEPT when resetting interval value one has to wait for the  
> larger interval value to complete before the new setting takes affect.  
> This is presumably because the thread sleeps until that larger interval  
> value and isn't woken up when the configuration changes.
> 
> Should I write up a bug report for this snapshot\_interva=0 doesn't work?
> 
> > Regarding the settings, the one returned for the get settings API are  
> > only the ones explicitly set, it does not return settings with "default"  
> > values.
> 
> Is there any way other than looking at the docs to then interpret what a  
> particular setting is configured to then?

---

<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:** [July 6, 2017, 3:47am UTC](https://discuss.elastic.co/t/gateway-snapshot-settings-unexpected-behaviour-maybe-bug/5897/5 "2017-07-06T03:47:58Z")

</div>


