From user-return-11216-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Thu Jan 18 00:48:07 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 60F0F18062C for ; Thu, 18 Jan 2018 00:48:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 50E52160C35; Wed, 17 Jan 2018 23:48:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9833C160C25 for ; Thu, 18 Jan 2018 00:48:06 +0100 (CET) Received: (qmail 2091 invoked by uid 500); 17 Jan 2018 23:48:05 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 1945 invoked by uid 99); 17 Jan 2018 23:48:05 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jan 2018 23:48:05 +0000 Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id C806B1A00E9 for ; Wed, 17 Jan 2018 23:48:04 +0000 (UTC) Received: by mail-wr0-f175.google.com with SMTP id f11so10257931wre.4 for ; Wed, 17 Jan 2018 15:48:04 -0800 (PST) X-Gm-Message-State: AKwxytfBGBgHrYWgRzMc+naPAEjNEZKZQhqXvbfrlA8492jTToYnolcL R8p7r9/nkX/Xfw4ygkwJs1u5CGu5Kzw07Fq27WQ= X-Google-Smtp-Source: ACJfBou3LtBMZWsgIEnPLswRw4SLjMWH4pwywGxmmlZGMykGw4u2q9j2+ZHhJByqBpvPQgtqpBaLmgrvCMuIvMKl/V4= X-Received: by 10.223.171.77 with SMTP id r13mr4167181wrc.77.1516232883088; Wed, 17 Jan 2018 15:48:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.186.213 with HTTP; Wed, 17 Jan 2018 15:47:22 -0800 (PST) In-Reply-To: References: From: Patrick Hunt Date: Wed, 17 Jan 2018 15:47:22 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Why are ephemeral nodes written to disk? To: UserZooKeeper Content-Type: multipart/alternative; boundary="94eb2c1b56b464b0a80563017a91" --94eb2c1b56b464b0a80563017a91 Content-Type: text/plain; charset="UTF-8" NP, sorry for the slow response but I've been out on vacation the past few weeks. ;-) Regards, Patrick On Wed, Jan 17, 2018 at 3:39 PM, Jeff Widman wrote: > Thank you. I did not realize sessions could continue even if the ensemble > was shutdown. > > On Jan 17, 2018 3:28 PM, "Patrick Hunt" wrote: > > > On Tue, Jan 9, 2018 at 12:38 PM, Jeff Widman > wrote: > > > > > Ephemeral nodes only exist for the life of the client session. > > > > > > As far as I understand, by definition, a client session ends when the > > > entire zookeeper ensemble goes down. > > > > > > So I would expect that ephemeral nodes are only written to memory, not > > > disk. The ephemeral nodes would be sync'd across machines as a client > > > session can span multiple connections if a single zk server fails, but > > once > > > the ensemble is down there is no need to recover the ephemeral nodes > from > > > disk. > > > > > > However, when I looked at a zookeeper ensemble that is 99% ephemeral > > nodes, > > > I see a bunch of disk I/O from the zookeeper processes. So it appears > > that > > > ephemeral nodes are still written to disk... > > > > > > Why is this? > > > > > > > Ephemeral znodes are treated just like persistent znodes in the sense > that > > a quorum of nodes need to agree to any change. As such the znode is > written > > to the transaction log. > > > > "a client session ends when the entire zookeeper ensemble goes down" > > > > is not correct. A client session ends either when a client closes it's > > session explicitly or the ZK quorum leader decides that the session has > > expired (which is based on the negotiated session timeout). Only while a > > leader is active can a session be expired (or closed for that matter). > When > > you shutdown an ensemble the sessions are maintained. If you were to, for > > example, shut down an ensemble for an hour and then restart it the > sessions > > would still be active. The clock would "reset" when the new leader was > > elected. If the client session is still active the session would > continue, > > any ephemeral znodes would still exist. > > > > Patrick > > > > > > > > > > -- > > > > > > *Jeff Widman* > > > jeffwidman.com | 740-WIDMAN-J (943-6265) > > > <>< > > > > > > --94eb2c1b56b464b0a80563017a91--