From notifications-return-9573-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Tue Sep 7 13:03:12 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 3664B180670 for ; Tue, 7 Sep 2021 15:03:12 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id ADE5A60A91 for ; Tue, 7 Sep 2021 13:03:11 +0000 (UTC) Received: (qmail 72468 invoked by uid 500); 7 Sep 2021 13:03:10 -0000 Mailing-List: contact notifications-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list notifications@zookeeper.apache.org Received: (qmail 72428 invoked by uid 99); 7 Sep 2021 13:03:10 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2021 13:03:10 +0000 From: =?utf-8?q?GitBox?= To: notifications@zookeeper.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bzookeeper=5D_fantapsody_commented_on_pull_request_?= =?utf-8?q?=231704=3A_Add_command_to_force_a_zookeeper_server_to_take_a_snap?= =?utf-8?q?shot?= Message-ID: <163101979053.16310.12573314527390405204.asfpy@gitbox.apache.org> Date: Tue, 07 Sep 2021 13:03:10 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: fantapsody commented on pull request #1704: URL: https://github.com/apache/zookeeper/pull/1704#issuecomment-914288146 > For this PR: > > * Look at the command naming: `force_snapshot`(semantic ambiguity), it seems like that when using this command, users can force the server to take a snapshot immediately. > * However, this PR just sets a flag:`forceSnapshot` and we cannot control the timing of snapshot(we cannot know when the server will take a snapshot). When there're no write requests during that period, the snapshot cannot never be triggered. > * Another important things is: when the server is taking a snapshot, we should not allow another process to take snapshot which will put too much pressure on the server. This PR also cannot guarantee this? > * I have some thoughts for this topic: `Backup and recovery`. I will sort it out and share it here at this weekend(08-28) Hi @maoling , thanks for the comments! The PR is designed to reuse the logic in `SyncRequestProcessor` so there is a single point in the program that takes the snapshot, it surely is a "best-effort" approach that cannot guarantee a snapshot would be taken immediately if there is no more writes to it, but I think it works in common use cases. We can also improve the implementation https://github.com/apache/zookeeper/blob/1e74a3395a9c3c4d67093f9a073bffb5a176916c/zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java#L190 in follow-up PRs to make sure only a single snapshot is taken at a time as this is an existing issue that could be triggered if it takes too long to take the snapshot and the `snapCount` or `snapSizeInBytes` is small enough. And there might be potentially other usages in operations other than backup & restore. BTW, `backup and recovery` is a very important topic for zookeeper, do you have any updates on it? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org For queries about this service, please contact Infrastructure at: users@infra.apache.org