You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Aishwarya Ganesan <as...@gmail.com> on 2017/03/10 01:05:31 UTC

Disabling snapshots in ZooKeeper

Hi all,

Is there a way to disable snapshots when the Zookeeper process restarts?
Setting snapCount to a large value doesn't help as Zookeeper takes
a snapshot on startup.

In order to achieve this, is it safe to just comment zk.takeSnapshot() in
the code?

Thanks,
Aishwarya

Re: Disabling snapshots in ZooKeeper

Posted by Bobby Evans <ev...@yahoo-inc.com.INVALID>.
I just did a patch to reduce the times that ZK takes a snapshot during start up, and if you disable it in all cases you can end up with losing data, or even a corrupted database.  In general you should be fine so long as you don't crash right after start up.
https://github.com/apache/zookeeper/pull/157
As a reference in case you want to see what I did.


- Bobby

On Thursday, March 9, 2017, 11:28:25 PM CST, Rakesh Radhakrishnan <ra...@apache.org> wrote:Hi Aishwarya,

>>>>>Is there a way to disable snapshots
Its interesting, just curious to know the thought process behind disabling
snapshot feature. Thanks!


Rakesh



On Fri, Mar 10, 2017 at 10:52 AM, Michael Han <ha...@cloudera.com> wrote:

> >> Is there a way to disable snapshots when the Zookeeper process restarts?
> Snapshot is a mandatory feature so there is no configuration option to
> disable it afaik.
>
> >>  is it safe to just comment zk.takeSnapshot()
> This should work in theory, if there is no snapshot ZK will rely on
> transaction log file for recovery. But I never tried it though.
>
> On Thu, Mar 9, 2017 at 5:05 PM, Aishwarya Ganesan <as...@gmail.com>
> wrote:
>
> > Hi all,
> >
> > Is there a way to disable snapshots when the Zookeeper process restarts?
> > Setting snapCount to a large value doesn't help as Zookeeper takes
> > a snapshot on startup.
> >
> > In order to achieve this, is it safe to just comment zk.takeSnapshot() in
> > the code?
> >
> > Thanks,
> > Aishwarya
> >
>
>
>
> --
> Cheers
> Michael.
>

Re: Disabling snapshots in ZooKeeper

Posted by Patrick Hunt <ph...@apache.org>.
I don't believe it's a matter of disabling the feature, it never existed.
IIRC, synchronizing followers may include sending them the snapshot, which
is streamed from the disk in the "on disk" form.

Patrick

On Thu, Mar 9, 2017 at 9:28 PM, Rakesh Radhakrishnan <ra...@apache.org>
wrote:

> Hi Aishwarya,
>
> >>>>>Is there a way to disable snapshots
> Its interesting, just curious to know the thought process behind disabling
> snapshot feature. Thanks!
>
>
> Rakesh
>
>
>
> On Fri, Mar 10, 2017 at 10:52 AM, Michael Han <ha...@cloudera.com> wrote:
>
> > >> Is there a way to disable snapshots when the Zookeeper process
> restarts?
> > Snapshot is a mandatory feature so there is no configuration option to
> > disable it afaik.
> >
> > >>  is it safe to just comment zk.takeSnapshot()
> > This should work in theory, if there is no snapshot ZK will rely on
> > transaction log file for recovery. But I never tried it though.
> >
> > On Thu, Mar 9, 2017 at 5:05 PM, Aishwarya Ganesan <as...@gmail.com>
> > wrote:
> >
> > > Hi all,
> > >
> > > Is there a way to disable snapshots when the Zookeeper process
> restarts?
> > > Setting snapCount to a large value doesn't help as Zookeeper takes
> > > a snapshot on startup.
> > >
> > > In order to achieve this, is it safe to just comment zk.takeSnapshot()
> in
> > > the code?
> > >
> > > Thanks,
> > > Aishwarya
> > >
> >
> >
> >
> > --
> > Cheers
> > Michael.
> >
>

Re: Disabling snapshots in ZooKeeper

Posted by Rakesh Radhakrishnan <ra...@apache.org>.
Hi Aishwarya,

>>>>>Is there a way to disable snapshots
Its interesting, just curious to know the thought process behind disabling
snapshot feature. Thanks!


Rakesh



On Fri, Mar 10, 2017 at 10:52 AM, Michael Han <ha...@cloudera.com> wrote:

> >> Is there a way to disable snapshots when the Zookeeper process restarts?
> Snapshot is a mandatory feature so there is no configuration option to
> disable it afaik.
>
> >>  is it safe to just comment zk.takeSnapshot()
> This should work in theory, if there is no snapshot ZK will rely on
> transaction log file for recovery. But I never tried it though.
>
> On Thu, Mar 9, 2017 at 5:05 PM, Aishwarya Ganesan <as...@gmail.com>
> wrote:
>
> > Hi all,
> >
> > Is there a way to disable snapshots when the Zookeeper process restarts?
> > Setting snapCount to a large value doesn't help as Zookeeper takes
> > a snapshot on startup.
> >
> > In order to achieve this, is it safe to just comment zk.takeSnapshot() in
> > the code?
> >
> > Thanks,
> > Aishwarya
> >
>
>
>
> --
> Cheers
> Michael.
>

Re: Disabling snapshots in ZooKeeper

Posted by Michael Han <ha...@cloudera.com>.
>> Is there a way to disable snapshots when the Zookeeper process restarts?
Snapshot is a mandatory feature so there is no configuration option to
disable it afaik.

>>  is it safe to just comment zk.takeSnapshot()
This should work in theory, if there is no snapshot ZK will rely on
transaction log file for recovery. But I never tried it though.

On Thu, Mar 9, 2017 at 5:05 PM, Aishwarya Ganesan <as...@gmail.com>
wrote:

> Hi all,
>
> Is there a way to disable snapshots when the Zookeeper process restarts?
> Setting snapCount to a large value doesn't help as Zookeeper takes
> a snapshot on startup.
>
> In order to achieve this, is it safe to just comment zk.takeSnapshot() in
> the code?
>
> Thanks,
> Aishwarya
>



-- 
Cheers
Michael.