From 29aa87863d6a5de3886c324ecd50b4f960d100b2 Mon Sep 17 00:00:00 2001 From: maoling Date: Fri, 25 Aug 2017 09:13:28 +0800 Subject: [PATCH 1/2] ZOOKEEPER-2349:Update documentation for snapCount --- .../src/documentation/content/xdocs/zookeeperAdmin.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml b/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml index 67efc4b241b..b20d012af3a 100644 --- a/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml +++ b/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml @@ -823,10 +823,10 @@ server.3=zoo3:2888:3888 role="bold">zookeeper.snapCount) ZooKeeper logs transactions to a transaction - log. After snapCount transactions are written to a log - file a snapshot is started and a new transaction log - file is created. The default snapCount is - 100,000. + log. After the count of transactions which are written to a log + file exceed a runtime-set limit in [snapCount/2, snapCount),a snapshot + is started and a new transaction log file is created. + The default snapCount is 100,000. From ab01d6b8c374a37b56a970fae519191809f4b227 Mon Sep 17 00:00:00 2001 From: maoling Date: Sun, 27 Aug 2017 08:58:38 +0800 Subject: [PATCH 2/2] update documentation for snapCount for the purpose of snapshot strategy --- .../documentation/content/xdocs/zookeeperAdmin.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml b/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml index b20d012af3a..19aa1828e6b 100644 --- a/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml +++ b/src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml @@ -822,11 +822,15 @@ server.3=zoo3:2888:3888 (Java system property: zookeeper.snapCount) - ZooKeeper logs transactions to a transaction - log. After the count of transactions which are written to a log - file exceed a runtime-set limit in [snapCount/2, snapCount),a snapshot - is started and a new transaction log file is created. - The default snapCount is 100,000. + ZooKeeper records its transactions using snapshots and + a transaction log (think write-ahead log).The number of + transactions recorded in the transaction log before a snapshot + can be taken (and the transaction log rolled) is determined + by snapCount. In order to prevent all of the machines in the quorum + from taking a snapshot at the same time, each ZooKeeper server + will take a snapshot when the number of transactions in the transaction log + reaches a runtime generated random value in the [snapCount/2+1, snapCount] + range.The default snapCount is 100,000.