Title:     BookKeeper Documentation
Notice:    Licensed to the Apache Software Foundation (ASF) under one
           or more contributor license agreements.  See the NOTICE file
           distributed with this work for additional information
           regarding copyright ownership.  The ASF licenses this file
           to you 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.

<h1>Release Notes - Bookkeeper - Version 4.1.0</h1>
    
<h2>        Sub-task
</h2>
<ul>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-95'>BOOKKEEPER-95</a>] -         extends zookeeper JMX to monitor and manage bookie server
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-96'>BOOKKEEPER-96</a>] -         extends zookeeper JMX to monitor and manage hedwig server
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-97'>BOOKKEEPER-97</a>] -         collect pub/sub/consume statistics on hub server
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-98'>BOOKKEEPER-98</a>] -         collect add/read statistics on bookie server
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-187'>BOOKKEEPER-187</a>] -         Create well defined interface for LedgerCache
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-224'>BOOKKEEPER-224</a>] -         Fix findbugs in bookkeeper-server component
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-228'>BOOKKEEPER-228</a>] -         Fix the bugs in BK benchmark
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-265'>BOOKKEEPER-265</a>] -         Review JMX documentation
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-266'>BOOKKEEPER-266</a>] -         Review versioning documentation
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-267'>BOOKKEEPER-267</a>] -         Review documentation for thread pool configuration
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-269'>BOOKKEEPER-269</a>] -         Review documentation for hedwig console client
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-270'>BOOKKEEPER-270</a>] -         Review documentation on bookie cookie
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-271'>BOOKKEEPER-271</a>] -         Review documentation for message bounding
</li>
</ul>
            
<h2>        Bug
</h2>
<ul>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-40'>BOOKKEEPER-40</a>] -         BookieClientTest fails intermittantly
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-56'>BOOKKEEPER-56</a>] -         Race condition of message handler in connection recovery in Hedwig client
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-72'>BOOKKEEPER-72</a>] -         Fix warnings issued by FindBugs
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-74'>BOOKKEEPER-74</a>] -         Bookkeeper Persistence Manager should give up topic on error
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-112'>BOOKKEEPER-112</a>] -         Bookie Recovery on an open ledger will cause LedgerHandle#close on that ledger to fail
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-133'>BOOKKEEPER-133</a>] -         Hub server should update subscription state to zookeeper when losing topic or shutting down
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-135'>BOOKKEEPER-135</a>] -         Fencing does not check the ledger masterPasswd
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-137'>BOOKKEEPER-137</a>] -         Do not create Ledger index files until absolutely necessary.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-140'>BOOKKEEPER-140</a>] -         Hub server doesn&#39;t subscribe remote region correctly when a region is down.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-142'>BOOKKEEPER-142</a>] -         Parsing last log id is wrong, which may make entry log files overwritten
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-146'>BOOKKEEPER-146</a>] -         TestConcurrentTopicAcquisition sometimes hangs
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-148'>BOOKKEEPER-148</a>] -         Jenkins build is failing
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-150'>BOOKKEEPER-150</a>] -         Entry is lost when recovering a ledger with not enough bookies.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-152'>BOOKKEEPER-152</a>] -         Can&#39;t recover a ledger whose current ensemble contain failed bookie.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-153'>BOOKKEEPER-153</a>] -         Ledger can&#39;t be opened or closed due to zero-length metadata
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-156'>BOOKKEEPER-156</a>] -         BookieJournalRollingTest failing 
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-161'>BOOKKEEPER-161</a>] -         PerChannelBookieClient tries to reuse HashedWheelTimer, throws Exception
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-162'>BOOKKEEPER-162</a>] -         LedgerHandle.readLastConfirmed does not work
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-163'>BOOKKEEPER-163</a>] -         Prevent incorrect NoSuchLedgerException for readLastConfirmed.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-166'>BOOKKEEPER-166</a>] -         Bookie will not recover its journal if the length prefix of an entry is truncated
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-167'>BOOKKEEPER-167</a>] -         PerChannelBookieClient doesn&#39;t use ClientConfiguration
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-169'>BOOKKEEPER-169</a>] -         bookie hangs on reading header when encountering partial header index file
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-170'>BOOKKEEPER-170</a>] -         Bookie constructor starts a number of threads
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-171'>BOOKKEEPER-171</a>] -         ServerConfiguration can&#39;t use more than one directory for ledgers
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-173'>BOOKKEEPER-173</a>] -         Uncontrolled number of threads in bookkeeper
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-174'>BOOKKEEPER-174</a>] -         Bookie can&#39;t start when replaying entries whose ledger were deleted and garbage collected.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-176'>BOOKKEEPER-176</a>] -         HierarchicalBookieFailureTest Hung
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-177'>BOOKKEEPER-177</a>] -         Index file is lost or some index pages aren&#39;t flushed.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-180'>BOOKKEEPER-180</a>] -         bookie server doesn&#39;t quit when running out of disk space
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-182'>BOOKKEEPER-182</a>] -         Entry log file is overwritten when fail to read lastLogId.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-184'>BOOKKEEPER-184</a>] -         CompactionTest failing on Jenkins
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-186'>BOOKKEEPER-186</a>] -         Bookkeeper throttling - permits is not released when read has failed from all replicas
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-188'>BOOKKEEPER-188</a>] -         Garbage collection code is in the wrong place
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-189'>BOOKKEEPER-189</a>] -         AbstractZkLedgerManager doesn&#39;t disregard cookies
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-190'>BOOKKEEPER-190</a>] -         Add entries would fail when number of open ledgers reaches more than openFileLimit.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-193'>BOOKKEEPER-193</a>] -         Ledger is garbage collected by mistake.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-194'>BOOKKEEPER-194</a>] -         Get correct latency for addEntry operations for JMX.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-195'>BOOKKEEPER-195</a>] -         HierarchicalLedgerManager doesn&#39;t consider idgen as a &quot;specialNode&quot;
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-197'>BOOKKEEPER-197</a>] -         HedwigConsole uses the same file to load bookkeeper client config and hub server config
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-198'>BOOKKEEPER-198</a>] -         replaying entries of deleted ledgers would exhaust ledger cache.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-207'>BOOKKEEPER-207</a>] -         BenchBookie doesn&#39;t run correctly
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-209'>BOOKKEEPER-209</a>] -         Typo in ServerConfiguration for READAHEAD_ENABLED
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-210'>BOOKKEEPER-210</a>] -         Spurious GC error message
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-211'>BOOKKEEPER-211</a>] -         Bookie fails to to start
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-212'>BOOKKEEPER-212</a>] -         Bookie stops responding when creating and deleting many ledgers
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-213'>BOOKKEEPER-213</a>] -         PerChannelBookieClient calls the wrong errorOut function when encountering an exception
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-215'>BOOKKEEPER-215</a>] -         Deadlock occurs under high load
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-216'>BOOKKEEPER-216</a>] -         Bookie doesn&#39;t exit with right exit code
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-217'>BOOKKEEPER-217</a>] -         NPE in hedwig client when enable DEBUG
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-229'>BOOKKEEPER-229</a>] -         Deleted entry log files would be garbage collected again and again.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-231'>BOOKKEEPER-231</a>] -          ZKUtil.killServer not closing the FileTxnSnapLog from ZK.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-232'>BOOKKEEPER-232</a>] -         AsyncBK tests failing 
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-234'>BOOKKEEPER-234</a>] -         EntryLogger will throw NPE, if any dir does not exist or IO Errors.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-235'>BOOKKEEPER-235</a>] -         Bad syncing in entrylogger degrades performance for many concurrent ledgers
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-242'>BOOKKEEPER-242</a>] -         Bookkeeper not able to connect other zookeeper when shutdown the zookeeper server where the BK has connected.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-245'>BOOKKEEPER-245</a>] -         Intermittent failures in PersistanceManager tests
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-258'>BOOKKEEPER-258</a>] -         CompactionTest failed
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-260'>BOOKKEEPER-260</a>] -         Define constant for -1 (invalid entry id)
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-263'>BOOKKEEPER-263</a>] -         ZK ledgers root path is hard coded
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-273'>BOOKKEEPER-273</a>] -         LedgerHandle.deleteLedger() should be idempotent
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-279'>BOOKKEEPER-279</a>] -         LocalBookKeeper is failing intermittently due to zkclient connection establishment delay
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-281'>BOOKKEEPER-281</a>] -         BKClient is failing when zkclient connection delays
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-285'>BOOKKEEPER-285</a>] -         TestZkSubscriptionManager quits due to NPE, so other tests are not run in hedwig server.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-286'>BOOKKEEPER-286</a>] -         Compilation warning
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-287'>BOOKKEEPER-287</a>] -         NoSuchElementException in LedgerCacheImpl
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-288'>BOOKKEEPER-288</a>] -         NOTICE files don&#39;t have the correct year
</li>
</ul>
            
<h2>        Improvement
</h2>
<ul>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-23'>BOOKKEEPER-23</a>] -         Timeout requests
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-73'>BOOKKEEPER-73</a>] -         Add monitoring support 
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-141'>BOOKKEEPER-141</a>] -         Run extracting ledger id from entry log files in GC thread to speed up bookie restart
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-145'>BOOKKEEPER-145</a>] -         Put notice and license file for distributed binaries in SVN
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-157'>BOOKKEEPER-157</a>] -         For small packets, increasing number of bookies actually degrades performance.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-158'>BOOKKEEPER-158</a>] -         Move latest benchmarking code into trunk
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-160'>BOOKKEEPER-160</a>] -         bookie server needs to do compaction over entry log files to reclaim disk space
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-172'>BOOKKEEPER-172</a>] -         Upgrade framework for filesystem layouts
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-175'>BOOKKEEPER-175</a>] -         Bookie code is very coupled
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-178'>BOOKKEEPER-178</a>] -         Delay ledger directory creation until the ledger index file was created
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-185'>BOOKKEEPER-185</a>] -         Remove bookkeeper-server dependency on hadoop-common
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-196'>BOOKKEEPER-196</a>] -         Define interface between bookie and ledger storage
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-200'>BOOKKEEPER-200</a>] -         Fix format and comments
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-218'>BOOKKEEPER-218</a>] -         Provide journal manager to manage journal related operations
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-236'>BOOKKEEPER-236</a>] -         Benchmarking improvements from latest round of benchmarking
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-238'>BOOKKEEPER-238</a>] -         Add log4j.properties in conf/ for bin packages
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-251'>BOOKKEEPER-251</a>] -         Noise error message printed when scanning entry log files those have been garbage collected.
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-254'>BOOKKEEPER-254</a>] -         Bump zookeeper version in poms
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-264'>BOOKKEEPER-264</a>] -         Documentation for 4.1.0
</li>
</ul>
    
<h2>        New Feature
</h2>
<ul>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-77'>BOOKKEEPER-77</a>] -         Add a console client for hedwig
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-165'>BOOKKEEPER-165</a>] -         Add versioning support for journal files
</li>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-168'>BOOKKEEPER-168</a>] -         Message bounding on subscriptions
</li>
</ul>
                            
<h2>        Task
</h2>
<ul>
<li>[<a href='https://issues.apache.org/jira/browse/BOOKKEEPER-241'>BOOKKEEPER-241</a>] -         Add documentation for bookie entry log compaction
</li>
</ul>
                
