releasenotes.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta content="Apache Forrest" name="Generator">
  6. <meta name="Forrest-version" content="0.8">
  7. <meta name="Forrest-skin-name" content="pelt">
  8. <title>ZooKeeper 3.0.0 Release Notes</title>
  9. <link type="text/css" href="skin/basic.css" rel="stylesheet">
  10. <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
  11. <link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
  12. <link type="text/css" href="skin/profile.css" rel="stylesheet">
  13. <script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
  14. <link rel="shortcut icon" href="images/favicon.ico">
  15. </head>
  16. <body onload="init()">
  17. <script type="text/javascript">ndeSetTextSize();</script>
  18. <div id="top">
  19. <!--+
  20. |breadtrail
  21. +-->
  22. <div class="breadtrail">
  23. <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://hadoop.apache.org/">Hadoop</a> &gt; <a href="http://hadoop.apache.org/zookeeper/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  24. </div>
  25. <!--+
  26. |header
  27. +-->
  28. <div class="header">
  29. <!--+
  30. |start group logo
  31. +-->
  32. <div class="grouplogo">
  33. <a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
  34. </div>
  35. <!--+
  36. |end group logo
  37. +-->
  38. <!--+
  39. |start Project Logo
  40. +-->
  41. <div class="projectlogo">
  42. <a href="http://hadoop.apache.org/zookeeper/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="The Hadoop database"></a>
  43. </div>
  44. <!--+
  45. |end Project Logo
  46. +-->
  47. <!--+
  48. |start Search
  49. +-->
  50. <div class="searchbox">
  51. <form action="http://www.google.com/search" method="get" class="roundtopsmall">
  52. <input value="hadoop.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp;
  53. <input name="Search" value="Search" type="submit">
  54. </form>
  55. </div>
  56. <!--+
  57. |end search
  58. +-->
  59. <!--+
  60. |start Tabs
  61. +-->
  62. <ul id="tabs">
  63. <li>
  64. <a class="unselected" href="http://hadoop.apache.org/zookeeper/">Project</a>
  65. </li>
  66. <li>
  67. <a class="unselected" href="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
  68. </li>
  69. <li class="current">
  70. <a class="selected" href="index.html">ZooKeeper Documentation</a>
  71. </li>
  72. </ul>
  73. <!--+
  74. |end Tabs
  75. +-->
  76. </div>
  77. </div>
  78. <div id="main">
  79. <div id="publishedStrip">
  80. <!--+
  81. |start Subtabs
  82. +-->
  83. <div id="level2tabs"></div>
  84. <!--+
  85. |end Endtabs
  86. +-->
  87. <script type="text/javascript"><!--
  88. document.write("Last Published: " + document.lastModified);
  89. // --></script>
  90. </div>
  91. <!--+
  92. |breadtrail
  93. +-->
  94. <div class="breadtrail">
  95. &nbsp;
  96. </div>
  97. <!--+
  98. |start Menu, mainarea
  99. +-->
  100. <!--+
  101. |start Menu
  102. +-->
  103. <div id="menu">
  104. <div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Overview</div>
  105. <div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
  106. <div class="menuitem">
  107. <a href="index.html">Welcome</a>
  108. </div>
  109. <div class="menuitem">
  110. <a href="zookeeperOver.html">Overview</a>
  111. </div>
  112. <div class="menuitem">
  113. <a href="zookeeperStarted.html">Getting Started</a>
  114. </div>
  115. <div class="menupage">
  116. <div class="menupagetitle">Release Notes</div>
  117. </div>
  118. </div>
  119. <div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
  120. <div id="menu_1.2" class="menuitemgroup">
  121. <div class="menuitem">
  122. <a href="api/index.html">API Docs</a>
  123. </div>
  124. <div class="menuitem">
  125. <a href="zookeeperProgrammers.html">Programmer's Guide</a>
  126. </div>
  127. <div class="menuitem">
  128. <a href="javaExample.html">Java Example</a>
  129. </div>
  130. <div class="menuitem">
  131. <a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
  132. </div>
  133. <div class="menuitem">
  134. <a href="recipes.html">Recipes</a>
  135. </div>
  136. </div>
  137. <div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
  138. <div id="menu_1.3" class="menuitemgroup">
  139. <div class="menuitem">
  140. <a href="zookeeperAdmin.html">Administrator's Guide</a>
  141. </div>
  142. </div>
  143. <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
  144. <div id="menu_1.4" class="menuitemgroup">
  145. <div class="menuitem">
  146. <a href="zookeeperInternals.html">ZooKeeper Internals</a>
  147. </div>
  148. </div>
  149. <div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Informal Documentation</div>
  150. <div id="menu_1.5" class="menuitemgroup">
  151. <div class="menuitem">
  152. <a href="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
  153. </div>
  154. <div class="menuitem">
  155. <a href="http://wiki.apache.org/hadoop/ZooKeeper/FAQ">FAQ</a>
  156. </div>
  157. <div class="menuitem">
  158. <a href="http://hadoop.apache.org/zookeeper/mailing_lists.html">Mailing Lists</a>
  159. </div>
  160. <div class="menuitem">
  161. <a href="zookeeperOtherInfo.html">Other Info</a>
  162. </div>
  163. </div>
  164. <div id="credit"></div>
  165. <div id="roundbottom">
  166. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  167. <!--+
  168. |alternative credits
  169. +-->
  170. <div id="credit2"></div>
  171. </div>
  172. <!--+
  173. |end Menu
  174. +-->
  175. <!--+
  176. |start content
  177. +-->
  178. <div id="content">
  179. <div title="Portable Document Format" class="pdflink">
  180. <a class="dida" href="releasenotes.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  181. PDF</a>
  182. </div>
  183. <h1>ZooKeeper 3.0.0 Release Notes</h1>
  184. <div id="minitoc-area">
  185. <ul class="minitoc">
  186. <li>
  187. <a href="#migration">Migration Instructions when Upgrading to 3.0.0</a>
  188. <ul class="minitoc">
  189. <li>
  190. <a href="#migration_code">Migrating Client Code</a>
  191. <ul class="minitoc">
  192. <li>
  193. <a href="#Watch+Management">Watch Management</a>
  194. </li>
  195. <li>
  196. <a href="#Java+API">Java API</a>
  197. </li>
  198. <li>
  199. <a href="#C+API">C API</a>
  200. </li>
  201. </ul>
  202. </li>
  203. <li>
  204. <a href="#migration_data">Migrating Server Data</a>
  205. </li>
  206. <li>
  207. <a href="#migration_config">Migrating Server Configuration</a>
  208. </li>
  209. </ul>
  210. </li>
  211. <li>
  212. <a href="#changes">Changes Since ZooKeeper 2.2.1</a>
  213. </li>
  214. </ul>
  215. </div>
  216. <p>
  217. These release notes include new developer and user facing incompatibilities, features, and major improvements.
  218. </p>
  219. <ul>
  220. <li>
  221. <p>
  222. <a href="#migration">Migration Instructions</a>
  223. </p>
  224. </li>
  225. <li>
  226. <p>
  227. <a href="#changes">Changes</a>
  228. </p>
  229. </li>
  230. </ul>
  231. <a name="N1001B"></a><a name="migration"></a>
  232. <h2 class="h3">Migration Instructions when Upgrading to 3.0.0</h2>
  233. <div class="section">
  234. <p>
  235. <em>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 href="#changes">changes</a></em>
  236. </p>
  237. <p>
  238. 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.
  239. </p>
  240. <p>
  241. 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.
  242. </p>
  243. <ul>
  244. <li>
  245. <p>
  246. <a href="#migration_code">Migrating Client Code</a>
  247. </p>
  248. </li>
  249. <li>
  250. <p>
  251. <a href="#migration_data">Migrating Server Data</a>
  252. </p>
  253. </li>
  254. <li>
  255. <p>
  256. <a href="#migration_config">Migrating Server Configuration</a>
  257. </p>
  258. </li>
  259. </ul>
  260. <a name="N10045"></a><a name="migration_code"></a>
  261. <h3 class="h4">Migrating Client Code</h3>
  262. <p>
  263. The underlying client-server protocol has changed in version 3.0.0
  264. of ZooKeeper. As a result clients must be upgraded along with
  265. serving clusters to ensure proper operation of the system (old
  266. pre-3.0.0 clients are not guaranteed to operate against upgraded
  267. 3.0.0 servers and vice-versa).
  268. </p>
  269. <a name="N1004E"></a><a name="Watch+Management"></a>
  270. <h4>Watch Management</h4>
  271. <p>
  272. In previous releases of ZooKeeper any watches registered by clients were lost if the client lost a connection to a ZooKeeper server.
  273. This meant that developers had to track watches they were interested in and reregister them if a session disconnect event was recieved.
  274. 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.
  275. Applications that still manually reregister interest should continue working properly as long as they are able to handle unsolicited watches.
  276. For example, an old application may register a watch for /foo and /goo, lose the connection, and reregister only /goo.
  277. As long as the application is able to recieve a notification for /foo, (probably ignoring it) the applications does not to be changes.
  278. 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.
  279. </p>
  280. <p>
  281. This release also allows clients to specify call specific watch functions.
  282. 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.
  283. 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.
  284. </p>
  285. <a name="N1005B"></a><a name="Java+API"></a>
  286. <h4>Java API</h4>
  287. <ol>
  288. <li>
  289. <p>The java package structure has changed from <strong>com.yahoo.zookeeper*</strong> to <strong>org.apache.zookeeper*</strong>. This will probably effect all of your java code which makes use of ZooKeeper APIs (typically import statements)</p>
  290. </li>
  291. <li>
  292. <p>A number of constants used in the client ZooKeeper API were re-specified using enums (rather than ints). See <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-7">ZOOKEEPER-7</a>, <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-132">ZOOKEEPER-132</a> and <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-139">ZOOKEEPER-139</a> for full details</p>
  293. </li>
  294. <li>
  295. <p>
  296. <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-18">ZOOKEEPER-18</a> removed KeeperStateChanged, use KeeperStateDisconnected instead</p>
  297. </li>
  298. </ol>
  299. <p>
  300. Also see <a href="http://hadoop.apache.org/zookeeper/docs/current/api/index.html">the current java API</a>
  301. </p>
  302. <a name="N1008D"></a><a name="C+API"></a>
  303. <h4>C API</h4>
  304. <ol>
  305. <li>
  306. <p>A number of constants used in the client ZooKeeper API were renamed in order to reduce namespace collision, see <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-6">ZOOKEEPER-6</a> for full details</p>
  307. </li>
  308. </ol>
  309. <a name="N100A0"></a><a name="migration_data"></a>
  310. <h3 class="h4">Migrating Server Data</h3>
  311. <p>
  312. 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.
  313. </p>
  314. <ul>
  315. <li>
  316. <p>
  317. <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-27">ZOOKEEPER-27 Unique DB identifiers for servers and clients</a>
  318. </p>
  319. </li>
  320. <li>
  321. <p>
  322. <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-32">ZOOKEEPER-32 CRCs for ZooKeeper data</a>
  323. </p>
  324. </li>
  325. <li>
  326. <p>
  327. <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-33">ZOOKEEPER-33 Better ACL management</a>
  328. </p>
  329. </li>
  330. <li>
  331. <p>
  332. <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-38">ZOOKEEPER-38 headers (version+) in log/snap files</a>
  333. </p>
  334. </li>
  335. </ul>
  336. <p>
  337. <strong>The following must be run once, and only once, when upgrading the ZooKeeper server instances to version 3.0.0.</strong>
  338. </p>
  339. <div class="note">
  340. <div class="label">Note</div>
  341. <div class="content">
  342. <p>
  343. The &lt;dataLogDir&gt; and &lt;dataDir&gt; directories referenced
  344. below are specified by the <em>dataLogDir</em>
  345. and <em>dataDir</em> specification in your
  346. ZooKeeper config file
  347. respectively. <em>dataLogDir</em> defaults to the
  348. value of <em>dataDir</em> if not specified explicitly
  349. in the ZooKeeper server config file (in which case provide the
  350. same directory for both parameters to the upgrade utility).
  351. </p>
  352. </div>
  353. </div>
  354. <ol>
  355. <li>
  356. <p>Shutdown the ZooKeeper server cluster.</p>
  357. </li>
  358. <li>
  359. <p>Backup your &lt;dataLogDir&gt; and &lt;dataDir&gt; directories</p>
  360. </li>
  361. <li>
  362. <p>Run upgrade using</p>
  363. <ul>
  364. <li>
  365. <p>
  366. <span class="codefrag computeroutput">bin/zkServer.sh upgrade &lt;dataLogDir&gt; &lt;dataDir&gt;</span>
  367. </p>
  368. </li>
  369. </ul>
  370. <p>or</p>
  371. <ul>
  372. <li>
  373. <p>
  374. <span class="codefrag computeroutput">java -classpath pathtolog4j:pathtozookeeper.jar UpgradeMain &lt;dataLogDir&gt; &lt;dataDir&gt;</span>
  375. </p>
  376. </li>
  377. </ul>
  378. <p>where &lt;dataLogDir&gt; is the directory where all transaction logs (log.*) are stored. &lt;dataDir&gt; is the directory where all the snapshots (snapshot.*) are stored.</p>
  379. </li>
  380. <li>
  381. <p>Restart the cluster. </p>
  382. </li>
  383. </ol>
  384. <p>
  385. If you have any failure during the upgrade procedure keep reading to sanitize your database.
  386. </p>
  387. <p>This is how upgrade works in ZooKeeper. This will help you troubleshoot in case you have problems while upgrading</p>
  388. <ol>
  389. <li>
  390. <p>Upgrade moves files from &lt;dataLogDir&gt; and &lt;dataDir&gt; to &lt;dataLogDir&gt;/version-1/ and &lt;dataDir&gt;/version-1 respectively (version-1 sub-directory is created by the upgrade utility). </p>
  391. </li>
  392. <li>
  393. <p>Upgrade creates a new version sub-directory &lt;dataDir&gt;/version-2 and &lt;dataLogDir&gt;/version-2</p>
  394. </li>
  395. <li>
  396. <p>Upgrade reads the old database from &lt;dataDir&gt;/version-1 and &lt;dataLogDir&gt;/version-1 into the memory and creates a new upgraded snapshot. </p>
  397. </li>
  398. <li>
  399. <p>Upgrade writes the new database in &lt;dataDir&gt;/version-2. </p>
  400. </li>
  401. </ol>
  402. <p>Troubleshooting.</p>
  403. <ol>
  404. <li>
  405. <p>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.
  406. This is because the servers assume that &lt;dataDir&gt;/version-2 and &lt;dataLogDir&gt;/version-2 will have the database to start with. Since this will be empty
  407. 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
  408. this will lead to loss of updates after you started 3.0.)
  409. and then start the upgrade procedure.</p>
  410. </li>
  411. <li>
  412. <p>If the upgrade fails while trying to rename files into the version-1 directory, you should try and move all the files under &lt;dataDir&gt;/version-1
  413. and &lt;dataLogDir&gt;/version-1 to &lt;dataDir&gt; and &lt;dataLogDir&gt; respectively. Then try upgrade again.
  414. </p>
  415. </li>
  416. <li>
  417. <p> 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
  418. the &lt;dataDir&gt; and &lt;dataLogDir&gt; directories changed to &lt;dataDir&gt;/version-1 and &lt;dataLogDir&gt;/version-1. Remember that you will lose all the updates that you made after the upgrade.
  419. </p>
  420. </li>
  421. </ol>
  422. <a name="N10135"></a><a name="migration_config"></a>
  423. <h3 class="h4">Migrating Server Configuration</h3>
  424. <p>
  425. There is a significant change to the ZooKeeper server configuration file.
  426. </p>
  427. <p>The default election algorithm, specified by
  428. the <em>electionAlg</em> configuration attribute, has
  429. changed from a default of <em>0</em> to a default
  430. of <em>3</em>. See
  431. <a href="zookeeperAdmin.html#sc_clusterOptions">Cluster
  432. Options</a> section of the administrators guide, specifically
  433. the <em>electionAlg</em>
  434. and <em>server.X</em> properties.
  435. </p>
  436. <p>
  437. You will either need to explicitly
  438. set <em>electionAlg</em> to it's previous default value
  439. of <em>0</em> or change
  440. your <em>server.X</em> options to include the leader
  441. election port.
  442. </p>
  443. </div>
  444. <a name="N10162"></a><a name="changes"></a>
  445. <h2 class="h3">Changes Since ZooKeeper 2.2.1</h2>
  446. <div class="section">
  447. <p>
  448. Version 2.2.1 code, documentation, binaries, etc... are still accessible on <a href="http://sourceforge.net/projects/zookeeper">SourceForge</a>
  449. </p>
  450. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  451. <caption>Changes Since ZooKeeper 2.2.1</caption>
  452. <title>Changes Since ZooKeeper 2.2.1</title>
  453. <tr>
  454. <th>Issue</th>
  455. <th>Notes</th>
  456. </tr>
  457. <tr>
  458. <td>
  459. <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-1">
  460. ZOOKEEPER-1</a>
  461. </td>
  462. <td>
  463. notes, placeholder - TBD during release process
  464. </td>
  465. </tr>
  466. </table>
  467. </div>
  468. <p align="right">
  469. <font size="-2"></font>
  470. </p>
  471. </div>
  472. <!--+
  473. |end content
  474. +-->
  475. <div class="clearboth">&nbsp;</div>
  476. </div>
  477. <div id="footer">
  478. <!--+
  479. |start bottomstrip
  480. +-->
  481. <div class="lastmodified">
  482. <script type="text/javascript"><!--
  483. document.write("Last Published: " + document.lastModified);
  484. // --></script>
  485. </div>
  486. <div class="copyright">
  487. Copyright &copy;
  488. 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  489. </div>
  490. <!--+
  491. |end bottomstrip
  492. +-->
  493. </div>
  494. </body>
  495. </html>