blob: 296c89330a7aa68959207a143b232c7d84c93f4f [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Apache Pulsar 2.6.1 · Apache Pulsar</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta name="generator" content="Docusaurus"/><meta name="description" content="We are excited to see that the Apache Pulsar community has successfully released 2.6.1 version after a lot of hard work. It is a great milestone for this fast-growing project and the Pulsar community. 2.6.1 is the result of a big effort from the community, with over 100 commits and a long list of improvements and bug fixes."/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Apache Pulsar 2.6.1 · Apache Pulsar"/><meta property="og:type" content="website"/><meta property="og:url" content="https://pulsar.apache.org/blog/2020/08/21/Apache-Pulsar-2-6-1"/><meta property="og:description" content="We are excited to see that the Apache Pulsar community has successfully released 2.6.1 version after a lot of hard work. It is a great milestone for this fast-growing project and the Pulsar community. 2.6.1 is the result of a big effort from the community, with over 100 commits and a long list of improvements and bug fixes."/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://pulsar.apache.org/img/pulsar.svg"/><link rel="shortcut icon" href="/img/pulsar.ico"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://pulsar.apache.org/blog/atom.xml" title="Apache Pulsar Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://pulsar.apache.org/blog/feed.xml" title="Apache Pulsar Blog RSS Feed"/><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/custom.js"></script><script src="/js/scrollSpy.js"></script><link rel="stylesheet" href="/css/main.css"/><script src="/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/pulsar.svg" alt="Apache Pulsar"/></a><a href="/en/versions"><h3>2.10.0</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class=""><a href="/docs/en/getting-started-standalone" target="_self">Docs</a></li><li class=""><a href="/en/download" target="_self">Download</a></li><li class=""><a href="/docs/en/client-libraries" target="_self">Clients</a></li><li class=""><a href="#restapis" target="_self">REST APIs</a></li><li class=""><a href="#cli" target="_self">Cli</a></li><li class="siteNavGroupActive"><a href="/blog/" target="_self">Blog</a></li><li class=""><a href="#community" target="_self">Community</a></li><li class=""><a href="#apache" target="_self">Apache</a></li><li class=""><a href="https://pulsar-next.staged.apache.org/" target="_self">New Website (Beta)</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg" alt="Languages icon"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/ja">日本語</a></li><li><a href="/fr">Français</a></li><li><a href="/ko">한국어</a></li><li><a href="/zh-CN">中文</a></li><li><a href="/zh-TW">繁體中文</a></li><li><a href="https://crowdin.com/project/apache-pulsar" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
const languagesMenuItem = document.getElementById("languages-menu");
const languagesDropDown = document.getElementById("languages-dropdown");
languagesMenuItem.addEventListener("click", function(event) {
event.preventDefault();
if (languagesDropDown.className == "hide") {
languagesDropDown.className = "visible";
} else {
languagesDropDown.className = "hide";
}
});
</script></span></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i></i><span>Recent Posts</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Recent Posts</h3><ul class=""><li class="navListItem"><a class="navItem" href="/blog/2022/05/11/whats-new-in-pulsar-210">What’s New in Apache Pulsar 2.10</a></li><li class="navListItem"><a class="navItem" href="/blog/2022/05/11/apache-pulsar-community-welcomes-500th-contributor">The Apache Pulsar Community Welcomes 500th Contributor!</a></li><li class="navListItem"><a class="navItem" href="/blog/2022/04/08/Apache-Pulsar-2-9-2">What’s New in Apache Pulsar 2.9.2</a></li><li class="navListItem"><a class="navItem" href="/blog/2021/12/14/Apache-Pulsar-2-7-4">What’s New in Apache Pulsar 2.7.4</a></li><li class="navListItem"><a class="navItem" href="/blog/2021/12/11/Log4j-CVE">Log4j2 Zero Day vulnerability (CVE-2021-44228)</a></li></ul></div></div></section></div><script>
var coll = document.getElementsByClassName('collapsible');
var checkActiveCategory = true;
for (var i = 0; i < coll.length; i++) {
var links = coll[i].nextElementSibling.getElementsByTagName('*');
if (checkActiveCategory){
for (var j = 0; j < links.length; j++) {
if (links[j].classList.contains('navListItemActive')){
coll[i].nextElementSibling.classList.toggle('hide');
coll[i].childNodes[1].classList.toggle('rotate');
checkActiveCategory = false;
break;
}
}
}
coll[i].addEventListener('click', function() {
var arrow = this.childNodes[1];
arrow.classList.toggle('rotate');
var content = this.nextElementSibling;
content.classList.toggle('hide');
});
}
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
var headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
var el = event.target;
while(el !== headings){
if (el.tagName === 'A') {
document.body.classList.remove('tocActive');
break;
} else{
el = el.parentNode;
}
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer postContainer blogContainer"><div class="wrapper"><div class="lonePost"><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/blog/2020/08/21/Apache-Pulsar-2-6-1">Apache Pulsar 2.6.1</a></h1><p class="post-meta">August 21, 2020</p><div class="authorBlock"><p class="post-authorName"><a href="https://twitter.com/wolf4j1" target="_blank" rel="noreferrer noopener">XiaoLong Ran</a></p></div></header><div><span><p>We are excited to see that the Apache Pulsar community has successfully released 2.6.1 version after a lot of hard work. It is a great milestone for this fast-growing project and the Pulsar community. 2.6.1 is the result of a big effort from the community, with over 100 commits and a long list of improvements and bug fixes.</p>
<p>Here are some highlights and major features added in Pulsar 2.6.1.</p>
<!--truncate-->
<h2><a class="anchor" aria-hidden="true" id="broker"></a><a href="#broker" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Broker</h2>
<h3><a class="anchor" aria-hidden="true" id="limit-the-batch-size-to-the-minimum-of-the-maxnumberofmessages-and-maxsizeofmessages"></a><a href="#limit-the-batch-size-to-the-minimum-of-the-maxnumberofmessages-and-maxsizeofmessages" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Limit the batch size to the minimum of the <code>maxNumberOfMessages</code> and <code>maxSizeOfMessages</code></h3>
<ol>
<li><p>Batch size is not limited to the minimum of the <code>maxNumberOfMessages</code> and <code>maxSizeOfMessages</code> from the BatchReceive policy.</p></li>
<li><p>When the batch size is greater than the <code>receiveQ</code> of the consumer (for example, the batch size is 3000 and a receiveQ is 500), the following issue occurs:</p>
<p>In a multi-topic (pattern) consumer, the client stops receiving any messages. The client gets paused and never resumed when setting a timeout in the batch policy. Only one batch is fetched and the client is never resumed.</p></li>
</ol>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/6865">PR-6865</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-hash-range-conflict-issue-in-key_shared-subscription-with-sticky-hash-range"></a><a href="#fix-hash-range-conflict-issue-in-key_shared-subscription-with-sticky-hash-range" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix hash range conflict issue in Key_Shared subscription with sticky hash range</h3>
<p>In <code>Key_Shared</code> subscription where the <code>stickyHashRange</code> is used, consumers are not allowed to use interleaving hashes.</p>
<p>The pull request fixes the hash range conflict issue in <code>Key_Shared</code> with sticky hash range.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7231">PR-7231</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-get-lookup-permission-error"></a><a href="#fix-get-lookup-permission-error" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix get lookup permission error</h3>
<p>If the <code>canProduce</code> or <code>canConsume</code> method throws an exception, the <code>canLookup</code> method just throws the exception and does not check other permissions. The code snippet is as follows:</p>
<pre><code class="hljs css language-java"><span class="hljs-keyword">try</span> {
<span class="hljs-keyword">return</span> canLookupAsync(topicName, role, authenticationData)
.get(conf.getZooKeeperOperationTimeoutSeconds(), SECONDS);
}
</code></pre>
<p>PR-7234 invokes <code>canLookupAsync</code>. When Pulsar AuthorizationService checks lookup permission, if the user has the <code>canProducer</code> or <code>canConsumer</code> role, the user performs <code>canLookup</code> operations.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7234">PR-7234</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="avoid-introducing-null-read-position-for-the-managed-cursor"></a><a href="#avoid-introducing-null-read-position-for-the-managed-cursor" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Avoid introducing null read position for the managed cursor</h3>
<p>Avoid introducing null read position for the managed cursor. The most doubtful thing is the <code>getNextValidPosition</code> method in the <code>ManagedLedgerImpl</code>. If a given position is greater than the position added last time, it returns a <code>null</code> value, and the read position is also <code>null</code>.</p>
<p>In this PR, we add a log and print the stack trace to find the root cause and fallback to the next position if the <code>null</code> occurs at the next valid position.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7264">PR-7264</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-error-in-creation-of-non-durable-cursor"></a><a href="#fix-error-in-creation-of-non-durable-cursor" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix error in creation of non-durable cursor</h3>
<p>An NPE occurs when we fail to create a non-durable cursor and continue to create the subscription instance.</p>
<pre><code class="hljs css language-java"><span class="hljs-keyword">try</span> {
cursor = ledger.newNonDurableCursor(startPosition, subscriptionName);
} <span class="hljs-keyword">catch</span> (ManagedLedgerException e) {
subscriptionFuture.completeExceptionally(e);
}
<span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> PersistentSubscription(<span class="hljs-keyword">this</span>, subscriptionName, cursor, <span class="hljs-keyword">false</span>);
</code></pre>
<p>Additionally, the NPE leads to the topic usage count increasing to 1. When deleting a topic, the topic cannot be deleted even if you use the force flag.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7355">PR-7355</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="avoid-an-npe-occurs-in-the-managedledgerimplisoffloadedneedsdelete-method"></a><a href="#avoid-an-npe-occurs-in-the-managedledgerimplisoffloadedneedsdelete-method" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Avoid an NPE occurs in the <code>ManagedLedgerImpl.isOffloadedNeedsDelete</code> method</h3>
<p>When the default value of the <code>offload-deletion-lag</code> is set to <code>null</code>, an NPE occurs. To fix the bug, null check is added in the <code>ManagedLedgerImpl.isOffloadedNeedsDelete</code> method.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7389">PR-7389</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-producer-stuck-issue-due-to-npe-when-creating-a-new-ledger"></a><a href="#fix-producer-stuck-issue-due-to-npe-when-creating-a-new-ledger" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix producer stuck issue due to NPE when creating a new ledger</h3>
<p>NPE occurs when creating a ledger if the network address is unresolvable. If NPE occurs before adding the timeout task, the timeout mechanism does not work. The unresolvable network address is common in the Kubernetes environment. It happens when a bookie pod or a worker node restarts.</p>
<p>This pull request fixes from the following perspectives:</p>
<ol>
<li>Catch the NPE when creating a new ledger.</li>
<li>When the timeout task is triggered, it always executes the callback. It is totally fine because we already have the logic to ensure the callback is triggered only once.</li>
<li>Add a mechanism to detect that the <code>CreatingLedger</code> state is not moving.</li>
</ol>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7401">PR-7401</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-npe-when-using-advertisedlisteners"></a><a href="#fix-npe-when-using-advertisedlisteners" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix NPE when using advertisedListeners</h3>
<p>The broker failed to acquire ownership for the namespace bundle when using <code>advertisedListeners=internal:pulsar://node1:6650,external:pulsar://node1.external:6650</code> with external listener name. Correct <code>BrokerServiceUrlTls</code> when TLS is not enabled.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7620">PR-7620</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-the-issue-that-the-deduplication-cursor-cannot-be-deleted-after-message-deduplication-is-disabled"></a><a href="#fix-the-issue-that-the-deduplication-cursor-cannot-be-deleted-after-message-deduplication-is-disabled" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix the issue that the deduplication cursor cannot be deleted after message deduplication is disabled</h3>
<p>When enabling the message deduplication in the <code>broker.conf</code> file, disabling it and then restarting the broker, the deduplication cursor is not deleted.</p>
<p>This PR fixes the issue, so when you disable message deduplication, you can delete the deduplication cursor.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7656">PR-7656</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-the-issue-that-getlastentry-reads-entry--1"></a><a href="#fix-the-issue-that-getlastentry-reads-entry--1" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix the issue that GetLastEntry() reads entry <code>-1</code></h3>
<p>Previously, the code does not include a return statement. If the entry is set to <code>-1</code>, after sending code, the response reads the entry and sends a second response, as shown in the following example.</p>
<pre><code class="hljs"><span class="hljs-attribute">16</span>:<span class="hljs-number">34</span>:<span class="hljs-number">25.779</span> [<span class="hljs-attribute">pulsar-io-54-7</span>:org.apache.bookkeeper.client.LedgerHandle<span class="hljs-variable">@748</span>] ERROR org.apache.bookkeeper.client.LedgerHandle - IncorrectParameterException on <span class="hljs-attribute">ledgerId</span>:<span class="hljs-number">0</span> <span class="hljs-attribute">firstEntry</span>:-<span class="hljs-number">1</span> <span class="hljs-attribute">lastEntry</span>:-<span class="hljs-number">1</span>
<span class="hljs-number">16</span>:<span class="hljs-number">34</span>:<span class="hljs-number">25.779</span> [<span class="hljs-attribute">pulsar-client-io-82-1</span>:org.apache.pulsar.client.impl.ConsumerImpl<span class="hljs-variable">@1986</span>] INFO org.apache.pulsar.client.impl.ConsumerImpl - [<span class="hljs-attribute">persistent</span>:<span class="hljs-comment">//external-repl-prop/pulsar-function-admin/assignment][c-use-fw-localhost-0-function-assignment-initialize-reader-b21f7607c9] Successfully getLastMessageId 0:-1</span>
<span class="hljs-number">16</span>:<span class="hljs-number">34</span>:<span class="hljs-number">25.779</span> [<span class="hljs-attribute">pulsar-client-io-82-1</span>:org.apache.pulsar.client.impl.ClientCnx<span class="hljs-variable">@602</span>] WARN org.apache.pulsar.client.impl.ClientCnx - [<span class="hljs-attribute">id</span>: <span class="hljs-number">0</span>xc78f4a0e, <span class="hljs-attribute">L</span>:/<span class="hljs-number">127.0</span>.<span class="hljs-number">0.1</span>:<span class="hljs-number">55657</span> - <span class="hljs-attribute">R</span>:localhost/<span class="hljs-number">127.0</span>.<span class="hljs-number">0.1</span>:<span class="hljs-number">55615</span>] Received error from <span class="hljs-attribute">server</span>: Failed to get batch size for entry org.apache.bookkeeper.mledger.<span class="hljs-attribute">ManagedLedgerException</span>: Incorrect parameter input
<span class="hljs-number">16</span>:<span class="hljs-number">34</span>:<span class="hljs-number">25.779</span> [<span class="hljs-attribute">pulsar-client-io-82-1</span>:org.apache.pulsar.client.impl.ClientCnx<span class="hljs-variable">@612</span>] WARN org.apache.pulsar.client.impl.ClientCnx - [<span class="hljs-attribute">id</span>: <span class="hljs-number">0</span>xc78f4a0e, <span class="hljs-attribute">L</span>:/<span class="hljs-number">127.0</span>.<span class="hljs-number">0.1</span>:<span class="hljs-number">55657</span> - <span class="hljs-attribute">R</span>:localhost/<span class="hljs-number">127.0</span>.<span class="hljs-number">0.1</span>:<span class="hljs-number">55615</span>] Received unknown request id from <span class="hljs-attribute">server</span>: <span class="hljs-number">10</span>
</code></pre>
<p>PR-7495 adds a return statement to code, so GetLastEntry() reads the last entry, instead of <code>-1</code>.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7495">PR-7495</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-the-error-of-updating-partitions-for-non-persistent-topic"></a><a href="#fix-the-error-of-updating-partitions-for-non-persistent-topic" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix the error of updating partitions for non-persistent topic</h3>
<p>When updating partitions on a non-persistent topic, Error 409 is returned. The pull request fixes partitions errors for non-persistent topics.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7459">PR-7459</a>.</p>
<h2><a class="anchor" aria-hidden="true" id="zookeeper"></a><a href="#zookeeper" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>ZooKeeper</h2>
<h3><a class="anchor" aria-hidden="true" id="use-hostname-for-bookie-rack-awareness-mapping"></a><a href="#use-hostname-for-bookie-rack-awareness-mapping" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Use hostname for bookie rack awareness mapping</h3>
<p>In <a href="https://github.com/apache/pulsar/pull/5607">PR-5607</a>, the <code>useHostName()</code> is added with <code>return false</code>. The rack-aware policy passes the Bookie's hostname into an IP address and then uses that IP address to figure out to which rack the bookie belongs.</p>
<p>Then two issues occur:</p>
<ol>
<li>The IP does not match the hostname which is recorded in the <code>/bookies</code> z-node</li>
<li>If there is an error in parsing the bookie hostname (eg: transient DNS error), an NPE is triggered and the BK client never realizes that this bookie is available in the cluster.</li>
</ol>
<p>The exception is thrown at Line 77(as shown in the following code snippet), since <code>getAddress()</code> returns a <code>null</code> given that the address is parsed.</p>
<pre><code class="hljs css language-java"><span class="hljs-number">74</span> <span class="hljs-keyword">if</span> (dnsResolver.useHostName()) {
<span class="hljs-number">75</span> names.add(addr.getHostName());
<span class="hljs-number">76</span> } <span class="hljs-keyword">else</span> {
<span class="hljs-number">77</span> names.add(addr.getAddress().getHostAddress());
<span class="hljs-number">78</span> }
</code></pre>
<p>The default implementation for the <code>DnsResolver.useHostName()</code> returns <code>true</code>.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7361">PR-7361</a>.</p>
<h2><a class="anchor" aria-hidden="true" id="java-client"></a><a href="#java-client" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Java Client</h2>
<h3><a class="anchor" aria-hidden="true" id="fix-the-issue-that-the-http-header-used-in-athenz-authentication-can-not-be-renamed"></a><a href="#fix-the-issue-that-the-http-header-used-in-athenz-authentication-can-not-be-renamed" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix the issue that the HTTP header used in Athenz authentication can not be renamed</h3>
<p>The authentication plugin for Athenz allows users to change the name of the HTTP header for sending an authentication token to a broker server with a parameter named <code>roleHeader</code>. The change uses the value of the <code>roleHeader</code> parameter on the <code>AuthenticationAthenz</code> side, and uses it directly as the header name.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7311">PR-7311</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-the-issue-that-batch-ack-set-is-recycled-multiple-times"></a><a href="#fix-the-issue-that-batch-ack-set-is-recycled-multiple-times" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix the issue that batch ack set is recycled multiple times</h3>
<p>The batch ack sets are recycled multiple times, due to race condition in group ack flush and cumulative Ack. So we add a recycled state check for the ack set in PR-7409, and fix the recycle issue.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7409">PR-7409</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="add-authentication-client-with-oauth2-support"></a><a href="#add-authentication-client-with-oauth2-support" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Add authentication client with OAuth2 support</h3>
<p>Pulsar supports authenticating clients using OAuth 2.0 access tokens. You can use tokens to identify a Pulsar client and associate with some &quot;principal&quot; (or &quot;role&quot;) that is permitted to do some actions, for example, publish messages to a topic or consume messages from a topic.</p>
<p>This module is to support Pulsar Client Authentication Plugin for OAuth 2.0 directly. The client communicates with the Oauth 2.0 server, gets an <code>access token</code> from the Oauth 2.0 server, and passes the <code>access token</code> to Pulsar broker to do the authentication.</p>
<p>So, the broker can use <code>org.apache.pulsar.broker.authentication.AuthenticationProviderToken</code>,
and the user can add their own <code>AuthenticationProvider</code> to work with this module.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7420">PR-7420</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="not-subscribe-to-the-topic-when-the-consumer-is-closed"></a><a href="#not-subscribe-to-the-topic-when-the-consumer-is-closed" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Not subscribe to the topic when the consumer is closed</h3>
<p>Fix race condition on the closed consumer while reconnecting to the broker.</p>
<p>The race condition happens when the consumer reconnects to the broker. The connection of the consumer is set to <code>null</code> when the consumer reconnects to the broker. If the consumer is not connected to broker at this time, the client does not send the consumer command to the broker. So, when the consumer reconnects to the broker, the consumer sends the subscribe command again.</p>
<p>This pull request adds a state check when the <code>connectionOpened()</code> of the consumer opens. If the consumer is in closing or closed state, the consumer does not send the subscribe command.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7589">PR-7589</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="oauth2-authentication-plugin-uses-asynchttpclient"></a><a href="#oauth2-authentication-plugin-uses-asynchttpclient" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>OAuth2 authentication plugin uses AsyncHttpClient</h3>
<p>Previously, the OAuth2 client authentication plugin used Apache HTTP client lib to make requests, Apache HTTP client is used to validate hostname. As suggested in <a href="https://github.com/apache/pulsar/issues/7612">#7612</a>, we get rid of the dependency of using Apache HTTP client.</p>
<p>In PR-7615, OAuth2 client authentication plugin uses AsyncHttpClient, which is used in client and broker. For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7615">PR-7615</a>.</p>
<h2><a class="anchor" aria-hidden="true" id="cpp-client"></a><a href="#cpp-client" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>CPP Client</h2>
<h3><a class="anchor" aria-hidden="true" id="cpp-oauth2-authentication-client"></a><a href="#cpp-oauth2-authentication-client" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>CPP Oauth2 authentication client</h3>
<p>Pulsar supports authenticating clients using OAuth 2.0 access tokens. You can use tokens to identify a Pulsar client and associate with some &quot;principal&quot; (or &quot;role&quot;) that is permitted to do some actions (eg: publish messages to a topic or consume messages from a topic). This change tries to support it in cpp client.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7467">PR-7467</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-partition-index-error-in-close-callback"></a><a href="#fix-partition-index-error-in-close-callback" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix partition index error in close callback</h3>
<p>In partitioned producer/consumer's close callback, the partition index is always <code>0</code>. The <code>ProducerImpl/ConsumerImpl</code> internal partition index field should be passed to <code>PartitionedProducerImpl/PartitionedConsumerImpl</code> close callback.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7282">PR-7282</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-segment-crashes-caused-by-race-condition-of-timer-in-cpp-client"></a><a href="#fix-segment-crashes-caused-by-race-condition-of-timer-in-cpp-client" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix segment crashes caused by race condition of timer in CPP client</h3>
<p>Segment crashes occur in a race condition:
- The close operation calls the <code>keepAliveTimer_.reset()</code>.
- The <code>keepAliveTimer</code> is called by <code>startConsumerStatsTimer</code> and <code>handleKeepAliveTimeout</code> methods. Actually, the <code>keepAliveTimer</code> should not be called by those two methods.</p>
<p>This pull request fixes those issues.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7572">PR-7572</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="add-support-to-read-credentials-from-file"></a><a href="#add-support-to-read-credentials-from-file" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Add support to read credentials from file</h3>
<p>Support reading credentials from a file to make it align with the Java client.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7606">PR-7606</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-multi-topic-consumer-segfault-on-connection-error"></a><a href="#fix-multi-topic-consumer-segfault-on-connection-error" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix multi-topic consumer segfault on connection error</h3>
<p>The multi-topic consumer triggers a segfault when an error occurs in creating a consumer. This is due to the calls to close the partial consumers with a null callback.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7588">PR-7588</a>.</p>
<h2><a class="anchor" aria-hidden="true" id="functions"></a><a href="#functions" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Functions</h2>
<h3><a class="anchor" aria-hidden="true" id="use-fully-qualified-hostname-as-default-to-advertise-worker"></a><a href="#use-fully-qualified-hostname-as-default-to-advertise-worker" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Use fully qualified hostname as default to advertise worker</h3>
<p>There is a difference in getting hostnames between <code>Java 8</code> and <code>Java 11</code>. In Java 8, <code>InetAddress.getLocalHost().getHostName()</code> returns the fully qualified hostname; in Java 11, it returns a simple hostname. In this case, we should rather use the <code>getCanonicalHostName()</code>, which returns the fully qualified hostname. This is the same method to get the advertised address for workers as well.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7360">PR-7360</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="fix-the-function-bc-issue-introduced-in-release-260"></a><a href="#fix-the-function-bc-issue-introduced-in-release-260" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fix the function BC issue introduced in release 2.6.0</h3>
<p>A backwards compatibility breakage is introduced in <a href="https://github.com/apache/pulsar/pull/5985">PR-5985</a>. When the running function workers are separated from brokers, updating workers and brokers independently from release 2.5.0 to 2.6.0 results in the following error:</p>
<pre><code class="hljs css language-text">java.lang.NullPointerException: null\n\tat java.net.URI$Parser.parse(URI.java:3104) ~[?:?]
java.net.URI.<init>(URI.java:600) ~[?:?]\n\tat java.net.URI.create(URI.java:881) ~[?:?]
org.apache.pulsar.functions.worker.WorkerUtils.initializeDlogNamespace(WorkerUtils.java:160) ~[org.apache.pulsar-pulsar-functions-worker-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
org.apache.pulsar.functions.worker.Worker.initialize(Worker.java:155) ~[org.apache.pulsar-pulsar-functions-worker-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
org.apache.pulsar.functions.worker.Worker.start(Worker.java:69) ~[org.apache.pulsar-pulsar-functions-worker-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
org.apache.pulsar.functions.worker.FunctionWorkerStarter.main(FunctionWorkerStarter.java:67) [org.apache.pulsar-pulsar-functions-worker-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
</code></pre>
<p>This is because the broker 2.5.0 supports &quot;bookkeeperMetadataServiceUri&quot; and the admin client returns a <code>null</code> field, thus causing the NPE.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7528">PR-7528</a>.</p>
<h2><a class="anchor" aria-hidden="true" id="pulsar-perf"></a><a href="#pulsar-perf" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>pulsar-perf</h2>
<h3><a class="anchor" aria-hidden="true" id="support-tlsallowinsecureconnection-in-pulsar-perf-produceconsumeread-performance-tests"></a><a href="#support-tlsallowinsecureconnection-in-pulsar-perf-produceconsumeread-performance-tests" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Support <code>tlsAllowInsecureConnection</code> in pulsar-perf produce/consume/read performance tests</h3>
<p>Add <code>tlsAllowInsecureConnection</code> config to the CLI tool <strong>pulsar-perf</strong>, to support produce/consume/read performance tests to clusters with insecure TLS connections.</p>
<p>For more information about implementation, see <a href="https://github.com/apache/pulsar/pull/7300">PR-7300</a>.</p>
<h2><a class="anchor" aria-hidden="true" id="more-information"></a><a href="#more-information" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>More information</h2>
<ul>
<li>To download Apache Pulsar 2.6.1, click <a href="https://pulsar.apache.org/en/download/">download</a>.</li>
<li>For more information about Apache Pulsar 2.6.1, see <a href="https://pulsar.apache.org/release-notes/#2.6.1">2.6.1 release notes</a> and <a href="https://github.com/apache/pulsar/pulls?q=is%3Apr+label%3Arelease%2F2.6.1+is%3Aclosed">2.6.1 PR list</a>.</li>
</ul>
<p>If you have any questions or suggestions, contact us with mailing lists or slack.</p>
<ul>
<li><a href="mailto:users@pulsar.apache.org">users@pulsar.apache.org</a></li>
<li><a href="mailto:dev@pulsar.apache.org">dev@pulsar.apache.org</a></li>
<li>Pulsar slack channel: <a href="https://apache-pulsar.slack.com/">https://apache-pulsar.slack.com/</a></li>
<li>Self-registration at <a href="https://apache-pulsar.herokuapp.com/">https://apache-pulsar.herokuapp.com/</a></li>
</ul>
<p>Looking forward to your contributions to <a href="https://github.com/apache/pulsar">Pulsar</a>.</p>
</span></div></div><div class="blogSocialSection"><div class="blogSocialSectionItem"><a href="https://twitter.com/share" class="twitter-share-button" data-text="Apache Pulsar 2.6.1" data-url="https://pulsar.apache.org/blog/2020/08/21/Apache-Pulsar-2-6-1" data-related="true" data-show-count="false">Tweet</a></div></div></div><div class="blog-recent"><a class="button" href="/blog/">Recent Posts</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#broker">Broker</a><ul class="toc-headings"><li><a href="#limit-the-batch-size-to-the-minimum-of-the-maxnumberofmessages-and-maxsizeofmessages">Limit the batch size to the minimum of the <code>maxNumberOfMessages</code> and <code>maxSizeOfMessages</code></a></li><li><a href="#fix-hash-range-conflict-issue-in-key_shared-subscription-with-sticky-hash-range">Fix hash range conflict issue in Key_Shared subscription with sticky hash range</a></li><li><a href="#fix-get-lookup-permission-error">Fix get lookup permission error</a></li><li><a href="#avoid-introducing-null-read-position-for-the-managed-cursor">Avoid introducing null read position for the managed cursor</a></li><li><a href="#fix-error-in-creation-of-non-durable-cursor">Fix error in creation of non-durable cursor</a></li><li><a href="#avoid-an-npe-occurs-in-the-managedledgerimplisoffloadedneedsdelete-method">Avoid an NPE occurs in the <code>ManagedLedgerImpl.isOffloadedNeedsDelete</code> method</a></li><li><a href="#fix-producer-stuck-issue-due-to-npe-when-creating-a-new-ledger">Fix producer stuck issue due to NPE when creating a new ledger</a></li><li><a href="#fix-npe-when-using-advertisedlisteners">Fix NPE when using advertisedListeners</a></li><li><a href="#fix-the-issue-that-the-deduplication-cursor-cannot-be-deleted-after-message-deduplication-is-disabled">Fix the issue that the deduplication cursor cannot be deleted after message deduplication is disabled</a></li><li><a href="#fix-the-issue-that-getlastentry-reads-entry--1">Fix the issue that GetLastEntry() reads entry <code>-1</code></a></li><li><a href="#fix-the-error-of-updating-partitions-for-non-persistent-topic">Fix the error of updating partitions for non-persistent topic</a></li></ul></li><li><a href="#zookeeper">ZooKeeper</a><ul class="toc-headings"><li><a href="#use-hostname-for-bookie-rack-awareness-mapping">Use hostname for bookie rack awareness mapping</a></li></ul></li><li><a href="#java-client">Java Client</a><ul class="toc-headings"><li><a href="#fix-the-issue-that-the-http-header-used-in-athenz-authentication-can-not-be-renamed">Fix the issue that the HTTP header used in Athenz authentication can not be renamed</a></li><li><a href="#fix-the-issue-that-batch-ack-set-is-recycled-multiple-times">Fix the issue that batch ack set is recycled multiple times</a></li><li><a href="#add-authentication-client-with-oauth2-support">Add authentication client with OAuth2 support</a></li><li><a href="#not-subscribe-to-the-topic-when-the-consumer-is-closed">Not subscribe to the topic when the consumer is closed</a></li><li><a href="#oauth2-authentication-plugin-uses-asynchttpclient">OAuth2 authentication plugin uses AsyncHttpClient</a></li></ul></li><li><a href="#cpp-client">CPP Client</a><ul class="toc-headings"><li><a href="#cpp-oauth2-authentication-client">CPP Oauth2 authentication client</a></li><li><a href="#fix-partition-index-error-in-close-callback">Fix partition index error in close callback</a></li><li><a href="#fix-segment-crashes-caused-by-race-condition-of-timer-in-cpp-client">Fix segment crashes caused by race condition of timer in CPP client</a></li><li><a href="#add-support-to-read-credentials-from-file">Add support to read credentials from file</a></li><li><a href="#fix-multi-topic-consumer-segfault-on-connection-error">Fix multi-topic consumer segfault on connection error</a></li></ul></li><li><a href="#functions">Functions</a><ul class="toc-headings"><li><a href="#use-fully-qualified-hostname-as-default-to-advertise-worker">Use fully qualified hostname as default to advertise worker</a></li><li><a href="#fix-the-function-bc-issue-introduced-in-release-260">Fix the function BC issue introduced in release 2.6.0</a></li></ul></li><li><a href="#pulsar-perf">pulsar-perf</a><ul class="toc-headings"><li><a href="#support-tlsallowinsecureconnection-in-pulsar-perf-produceconsumeread-performance-tests">Support <code>tlsAllowInsecureConnection</code> in pulsar-perf produce/consume/read performance tests</a></li></ul></li><li><a href="#more-information">More information</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="copyright">Copyright © 2022 The Apache Software Foundation. All Rights Reserved. Apache, Apache Pulsar and the Apache feather logo are trademarks of The Apache Software Foundation.</section><span><script>
const community = document.querySelector("a[href='#community']").parentNode;
const communityMenu =
'<li>' +
'<a id="community-menu" href="#">Community <span style="font-size: 0.75em">&nbsp;▼</span></a>' +
'<div id="community-dropdown" class="hide">' +
'<ul id="community-dropdown-items">' +
'<li><a href="/en/contact">Contact</a></li>' +
'<li><a href="/en/contributing">Contributing</a></li>' +
'<li><a href="/en/coding-guide">Coding guide</a></li>' +
'<li><a href="/en/events">Events</a></li>' +
'<li><a href="https://twitter.com/Apache_Pulsar" target="_blank">Twitter &#x2750</a></li>' +
'<li><a href="https://github.com/apache/pulsar/wiki" target="_blank">Wiki &#x2750</a></li>' +
'<li><a href="https://github.com/apache/pulsar/issues" target="_blank">Issue tracking &#x2750</a></li>' +
'<li><a href="https://pulsar-summit.org/" target="_blank">Pulsar Summit &#x2750</a></li>' +
'<li>&nbsp;</li>' +
'<li><a href="/en/resources">Resources</a></li>' +
'<li><a href="/en/team">Team</a></li>' +
'<li><a href="/en/powered-by">Powered By</a></li>' +
'</ul>' +
'</div>' +
'</li>';
community.innerHTML = communityMenu;
const communityMenuItem = document.getElementById("community-menu");
const communityDropDown = document.getElementById("community-dropdown");
communityMenuItem.addEventListener("click", function(event) {
event.preventDefault();
if (communityDropDown.className == 'hide') {
communityDropDown.className = 'visible';
} else {
communityDropDown.className = 'hide';
}
});
</script></span></footer></div><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script></body></html>