Project: Apache Zookeeper (Orchestration & Management / Coordination & Service Discovery)
File: releasenotes.md

<!-- Copyright 2002-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. //--> * * * These release notes include new developer and user facing incompatibilities, features, and major improvements. <a name="migration"></a> <div class="section"> You should only have to read this section if you are upgrading from a previous version of ZooKeeper to version 3.0.0, otw skip down to A small number of changes in this release have resulted in non-backward compatible Zookeeper client user code and server instance data. The following instructions provide details on how to migrate code and date from version 2.2.1 to version 3.0.0. Note: ZooKeeper increments the major version number (major.minor.fix) when backward incompatible changes are made to the source base. As part of the migration from SourceForge we changed the package structure (com.yahoo.zookeeper. to org.apache.zookeeper.) and felt it was a good time to incorporate some changes that we had been withholding. As a result the following will be required when migrating from 2.2.1 to 3.0.0 version of ZooKeeper. <a name="migration_code"></a> The underlying client-server protocol has changed in version 3.0.0 of ZooKeeper. As a result clients must be upgraded along with serving clusters to ensure proper operation of the system (old pre-3.0.0 clients are not guaranteed to operate against upgraded 3.0.0 servers and vice-versa). <a name="Watch+Management"></a> In previous releases of ZooKeeper any watches registered by clients were lost if the client lost a connection to a ZooKeeper server. This meant that developers had to track watches they were interested in and reregister them if a session disconnect event was received. In this release the client library tracks watches that a client has registered and reregisters the watches when a connection is made to a new server. Applications that still manually reregister interest should continue working properly as long as they are able to handle unsolicited watches. For example, an old application may register a watch for /foo and /goo, lose the connection, and reregister only /goo. As long as the application is able to receive a notification for /foo, (probably ignoring it) it does not need to be changed. One caveat to the watch management: it is possible to miss an event for the creation and deletion of a znode if watching for creation and both the create and delete happens while the client is disconnected from ZooKeeper. This release also allows clients to specify call specific watch

This gives the developer the ability to modularize logic in different watch functions rather than cramming everything in the watch function attached to the ZooKeeper handle. Call specific watch functions receive all session events for as long as they are active, but will only receive the watch callbacks for which they are registered. <a name="Java+API"></a> The java package structure has changed from com.yahoo.zookeeper to org.apache.zookeeper. This will probably affect all of your java code which makes use of ZooKeeper APIs (typically import statements) A number of constants used in the client ZooKeeper API were re-specified using enums (rather than ints). See , and for full details removed KeeperStateChanged, use KeeperStateDisconnected instead Also see <a name="C+API"></a> A number of constants used in the client ZooKeeper API were renamed in order to reduce namespace collision, see for full details <a name="migration_data"></a> The following issues resulted in changes to the on-disk data format (the snapshot and transaction log files contained within the ZK data directory) and require a migration utility to be run. The following must be run once, and only once, when upgrading the ZooKeeper server instances to version 3.0.0. The <dataLogDir> and <dataDir> directories referenced below are specified by the dataLogDir and dataDir specification in your ZooKeeper config file respectively. dataLogDir defaults to the value of dataDir if not specified explicitly in the ZooKeeper server config file (in which case provide the same directory for both parameters to the upgrade utility). Shutdown the ZooKeeper server cluster. Backup your <dataLogDir> and <dataDir> directories Run upgrade using `bin/zkServer.sh upgrade <dataLogDir> <dataDir>` or `java -classpath pathtolog4j:pathtozookeeper.jar UpgradeMain <dataLogDir> <dataDir>` where <dataLogDir> is the directory where all transaction logs (log.) are stored. <dataDir> is the directory where all the snapshots (snapshot.) are stored. Restart the cluster. If you have any failure during the upgrade procedure keep reading to sanitize your database. This is how upgrade works in ZooKeeper. This will help you troubleshoot in case you have problems while upgrading Upgrade moves files from `<dataLogDir>` and `<dataDir>` to `<dataLogDir>/version-1/` and `<dataDir>/version-1` respectively (version-1 sub-directory is created by the upgrade utility). Upgrade creates a new version sub-directory `<dataDir>/version-2` and `<dataLogDir>/version-2` Upgrade reads the old database from `<dataDir>/version-1` and `<dataLogDir>/version-1` into the memory and creates a new upgraded snapshot. Upgrade writes the new database in `<dataDir>/version-2`. Troubleshooting. In case you start ZooKeeper 3.0 without upgrading from 2.0 on a 2.0 database - the servers will start up with an empty database. This is because the servers assume that `<dataDir>/version-2` and `<dataLogDir>/version-2` will have the database to start with. Since this will be empty in case of no upgrade, the servers will start with an empty database. In such a case, shutdown the ZooKeeper servers, remove the version-2 directory (remember this will lead to loss of updates after you started 3.0.) and then start the upgrade

If the upgrade fails while trying to rename files into the version-1 directory, you should try and move all the files under `<dataDir>/version-1` and `<dataLogDir>/version-1` to `<dataDir>` and `<dataLogDir>` respectively. Then try upgrade again. If you do not wish to run with ZooKeeper 3.0 and prefer to run with ZooKeeper 2.0 and have already upgraded - you can run ZooKeeper 2 with the `<dataDir>` and `<dataLogDir>` directories changed to `<dataDir>/version-1` and `<dataLogDir>/version-1`. Remember that you will lose all the updates that you made after the upgrade. <a name="migration_config"></a> There is a significant change to the ZooKeeper server configuration file. The default election algorithm, specified by the electionAlg configuration attribute, has changed from a default of 0 to a default of 3. See section of the administrators guide, specifically the electionAlg and server.X properties. You will either need to explicitly set electionAlg to its previous default value of 0 or change your server.X options to include the leader election port. <a name="changes"></a> Version 2.2.1 code, documentation, binaries, etc... are still accessible on | Issue | Notes | |-|-| ||Server side of auto reset watches.| ||Create Enum to replace CreateFlag in ZooKepper.create method| ||Create Enums for WatcherEvent's KeeperState and EventType| ||keeper state inconsistency| ||headers in log/snap files| ||Stat enchaned to include num of children and size| ||List of problem identifiers in zookeeper.h| ||Use enums rather than ints for types and state| ||Unique DB identifiers for servers and clients| ||CRCs for ZooKeeper data| ||Better ACL management| ||fix datadir typo in releasenotes| ||write detailed release notes for users migrating from 2.x to 3.0| ||Auto reset of watches on reconnect| ||forrest docs for upgrade.| ||validate magic number when reading snapshot and transaction logs| ||the magic number for snapshot and log must be different| ||fix log messages in persistence code| ||create checksums for snapshots| ||apache license header missing from FollowerSyncRequest.java| ||Upgrade Feature in Zookeeper server.| ||Fix terminology in zookeeperAdmin.xml| ||Document change to server configuration| ||update java example doc to compile with latest zookeeper| ||CreateMode api docs missing| ||add new "releasenotes.xml" to forrest documentation| ||Reorg links to docs and navs to docs into related sections| ||forrest build not validated xml of input documents| ||Check that election port is present for all servers| ||Improved version of FLETest| ||tests: An explicit include derective is needed for the usage of memcpy functions| ||Array subscript is above array bounds in od_completion, src/cli.c.| ||zookeeperinit accepts empty host-port string and returns valid pointer to zhandlet.| ||zookeeper_init doc needs clarification| ||Some Source Forge Documents did not get moved over: javaExample, zookeeperTutorial, zookeeperInternals| ||Placeholder sections needed in document for new topics that the umbrella jira discusses| ||Programmer's Guide "Basic Operations" section is missing content| ||FLE test.| ||Cover two corner cases of leader election| ||update programmer guide with acl details from old wiki page| ||reliability graph diagram in overview doc needs context| ||Peer can't find existing leader| ||improve "the zookeeper project" section of overview doc| ||Deadlock in QuorumCnxManager| ||This is version of the documents with most of the

scrubbed out| ||zookeeper build broken| ||sync causes hang in all followers of quorum.| ||findbugs cleanup| ||hudson tests failing intermittently| ||add tostring support for watcher event, and enums for event type/state| ||Improve zk ctor/watcher| ||Provide Javadoc as to the maximum size of the data byte array that may be stored within a znode| ||Create Documentation for Zookeeper| ||threading issues in Leader election| ||client watcher objects can lose events| ||Old leader election can elect a dead leader over and over again| ||update build.xml to support apache release process| ||findbugs flagged switch statement in followerrequestprocessor.run| ||Potential NPE in QuorumCnxManager| ||cleanup ugly event messages in zookeeper client| ||src/java/main ZooKeeper.java has test code embedded into it.| ||Use Watcher objects rather than boolean on read operations.| ||supports optional output directory in code generator.| ||Integrate ZooKeeper with "violations" feature on hudson| ||Catch Zookeeper exceptions and print on the stderr.| ||Change Leader Election to fast tcp.| ||auth_id now handled correctly when no auth ids present| ||Create sequence flag children with prefixes of 0's so that they can be lexicographically sorted.| ||Fix sync operation reordering on a Quorum.| ||Fuse module for Zookeeper.| ||Race condition on ClientCnxn.java| ||Add clover support to build.xml.| ||register the ZooKeeper mailing lists with nabble.com| ||remove sleeps in the tests.| ||build.xml failes to retrieve a release number from SVN and the ant target "dist" fails| ||invoke WhenOwnerListener.whenNotOwner when the ZK connection fails| ||invoke WhenOwnerListener.whenNotOwner when the ZK session expires and the znode is the leader| ||Make the ZooKeeperServer more DI friendly.| ||Build script relies on svnant, which is not compatible with subversion 1.5 working copies| ||Significant cleanup of existing tests.| ||Fix NPE in jute's Utils.toCSVString.| ||Fix the wrong class is specified for the logger.| ||Fix synchronization issues in QuorumPeer and FastLeader election.| ||Remove unwanted class declaration in FastLeaderElection.| ||Address in client/server test cases.| ||cleanup the library directory| ||cleanup of NPE and Resource issue nits found by static analysis| ||Commit 677109 removed the cobertura library, but not the build targets.| ||Race condition in client close| ||Add skeleton forrest doc structure for ZooKeeper| ||Document jacob's leader election on the wiki recipes page| ||Move ZK wiki from SourceForge to Apache| ||Initial creation/setup of ZooKeeper ASF site.| ||Determine what to do re ZooKeeper Changelog| ||parseACLs in ZooKeeper.java fails to parse elements of ACL, should be lastIndexOf rather than IndexOf| ||update build.xml to support apache release process.| ||Fix Old leader election can elect a dead leader over and over again.| ||client watcher objects can lose events| ||threading issues in Leader election| ||test coverage on async client operations needs to be improved| ||Use of non-standard election ports in config breaks services| ||tests failing on solaris.| ||FLE Test| ||Sample startup script| ||Better ACL management| ||SetACL does not work| ||Child watches are not triggered when the node is deleted| ||handle failure better in build.xml:test| ||ArrayList is used instead of List| ||Restructure the SVN repository after initial import | ||Initial ZooKeeper code contribution from Yahoo!|