GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — cherrypick batch read and managedLedger cache PRs by dao-jun · Pull Request #102 · ascentstream/pulsar

Conversation

@dao-jun

@dao-jun dao-jun commented Sep 20, 2026

Copy link
Copy Markdown
Member

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lhotari and others added 3 commits September 20, 2026 17:15
@lhotari @dao-jun
[pip] PIP-430: Pulsar Broker cache improvements: refactoring eviction…
d5b620d
… and adding a new cache strategy based on expected read count (apache#24444)

(cherry picked from commit cf3d7d1)
@lhotari @dao-jun
[refactor][ml] Replace cache eviction algorithm with centralized remo…
0128390
…val queue and job (apache#24363)

(cherry picked from commit 8ce67b9)
@3pacccccc @dao-jun
[fix][test] Fix flaky EntryCacheManagerTest.simple (apache#24609)
f523a14
(cherry picked from commit 7ab68b1)
@github-actions github-actions Bot added the PIP label Sep 20, 2026
@dao-jun
dao-jun force-pushed the dev/pick_batchread_and_cache branch 2 times, most recently from 74481c0 to 7b885b2 Compare September 20, 2026 17:10
lhotari and others added 24 commits September 21, 2026 02:53
@lhotari @dao-jun
[improve][broker] Implement PIP-430 Pulsar Broker cache improvements (a…
f784137
…pache#24623)

(cherry picked from commit 490ba0c)
@merlimat @dao-jun
[fix][test] Fix flaky PersistentTopicTest.testBacklogCursor (apache#2…
5226956
…5348)

(cherry picked from commit db221ad)
@merlimat @dao-jun
[fix][ml] Fix eviction trigger race that cleared the in-progress mark…
6ea72a9
…er (apache#25988)

(cherry picked from commit fbcfacf)
@lhotari @dao-jun
[fix][ml] Fix active cursor retention and deferred-update synchroniza…
cd9dd80
…tion (apache#26511)

(cherry picked from commit 72632e5)
@lhotari @dao-jun
[improve][ml] Improve cache insert performance by removing exists che…
dde4580
…ck since it's already covered by putIfAbsent (apache#24699)

(cherry picked from commit 669ab61)
@lhotari @dao-jun
[improve][broker] Reduce unnecessary MessageMetadata parsing by cachi…
87e7159
…ng the parsed instance in the broker cache (apache#24682)

(cherry picked from commit 53bbd4a)
@lhotari @dao-jun
[fix][ml] PIP-430: Fix concurrency issue in MessageMetadata caching a…
15b4421
…nd improve caching (apache#24836)

(cherry picked from commit 9737d03)
@merlimat @dao-jun
[fix][ml] Reset messageMetadataInitialized when recycling RangeCacheE…
dbbb648
…ntryWrapper (apache#25987)

(cherry picked from commit 98bac65)
@merlimat @dao-jun
[improve][ml] Parse message metadata at entry cache insert time inste…
feb4935
…ad of under the wrapper write lock (apache#26463)

(cherry picked from commit ce60798)
@lhotari @dao-jun
[fix][ml] Parse the cached entry's message metadata from the buffer t…
0796516
…he cache keeps (apache#26495)

(cherry picked from commit 9e0f694)
@lhotari @dao-jun
[improve][ml] Share immutable publish positions with cached entries (a…
e34774a
…pache#26526)

(cherry picked from commit 7bcae18)
@lhotari @dao-jun
[improve][ml] Build cached read results without an intermediate colle…
d72a1d1
…ction (apache#26529)

(cherry picked from commit a3de5dd)
@lhotari @dao-jun
[improve][ml] Avoid capturing cache insertion arguments (apache#26524)
05a17f3
(cherry picked from commit 78688dd)
@lhotari @dao-jun
[improve][ml] Share read-permit release callbacks within a batch (apa…
27120c2
…che#26523)

(cherry picked from commit 30b975a)
@dao-jun
[build] Upgrade to Apache BookKeeper/DistributedLog 4.18.0 and Netty …
2201154
…4.2.17 to enable the BK batch read API

Dependency enablement for apache#25280 (BK batch read): switch from the
com.ascentstream fork artifacts (bookkeeper 4.17.4.0) to Apache
org.apache.bookkeeper/org.apache.distributedlog 4.18.0, align Netty to
4.2.17 with io_uring promoted out of the incubator coordinates, raise
pulsar.client.compiler.release to 17 (BK 4.18.0 jars are Java 17
bytecode in the client dependency chain), and bump rocksdb to 9.9.3.
Carries the API-migration ripple: PulsarFlowControlHandler (netty 4.2),
EventLoopUtil, Recycler-based test adaptations, pulsar-metadata BK 4.18
ZK/underreplication API changes, offload LedgerMetadataFormat migration,
BKStateStoreProviderImpl, BookKeeperClusterTestCase loopback
advertisement, and the module pom/shading updates.

Clear the client endpoint identification algorithm in SecurityUtility's
client SslContext builders: Netty 4.2's SslContextBuilder.forClient()
defaults it to "HTTPS", which silently re-enables hostname verification
when tlsHostnameVerificationEnable=false (the per-engine HTTPS overlay
in configureSSLHandler still applies it when the flag is on). The
algorithm is final at context-build time on the OpenSSL backend, so the
default must be countered at the builder (mirrors upstream's
TlsContexts.buildNettyClientContext in PIP-478).

Extracted from the batch-read WIP (8d38f112a8 + f2b2d43759), excluding
the batch-read feature changes that arrive with apache#25280.
@lhotari @dao-jun
[feat][misc] Support AdaptiveByteBufAllocator with configurable alloc…
b271678
…ator type and metrics (apache#26595)

(cherry picked from commit e1a1581)
@lhotari @dao-jun
[improve][broker] Optimize consumer selection for shared subscriptions (
c9f5b7f
apache#26593)

(cherry picked from commit e7cbb33)
@lhotari @dao-jun
[feat][ml] Configure and track named Pulsar allocators independently (a…
d96a0c3
…pache#26597)

(cherry picked from commit ca58c20)
@dao-jun @lhotari @merlimat
[feat][ml] Support Bookkeeper Batch Read API (apache#25280)
bc48257
Co-authored-by: Lari Hotari <[email protected]>
Co-authored-by: Matteo Merli <[email protected]>
(cherry picked from commit f369915)
@lhotari @dao-jun
[improve][ml] Use adaptive allocation for managed ledger cache copies (…
4f184f2
…apache#26603)

(cherry picked from commit 0677be2)
@lhotari @dao-jun
[fix][test] Disable Pulsar message parsing for raw ledger test entries (
cd27e27
apache#26604)

(cherry picked from commit 14e0ede)
@StevenLuMT @merlimat @dao-jun
[improve][broker] Upgrade bookkeeper to 4.18.1 (apache#26574)
5aaa616
Co-authored-by: Matteo Merli <[email protected]>
(cherry picked from commit 1759f73)
@merlimat @dao-jun
[improve][ml] Open ledgers through the BookKeeper builder API (apache…
78bb14a
…#26598)

(cherry picked from commit 504c48c)
@lhotari @dao-jun
[improve][broker] Reduce cache retention after reads and apply retent…
d88d711
…ion settings at startup (apache#26627)

(cherry picked from commit bed06a0)
Denovo1998 and others added 5 commits September 21, 2026 02:53
@Denovo1998 @dao-jun
[fix][ml] Fix active cursor position tracking after untracking (apach…
5f96571
…e#26629)

(cherry picked from commit 467159e)
@merlimat @dao-jun
[fix][test] Fix flaky ManagedLedgerBkTest.verifyConcurrentUsage (apac…
29c8879
…he#26637)

(cherry picked from commit df943eb)
@lhotari @dao-jun
[improve][ml] Defer cached message metadata parsing until first read (a…
63cd52b
…pache#26628)

(cherry picked from commit 3efae19)
@dao-jun
[fix][sec] Upgrade Netty to 4.2.18 to address several CVEs and bugs (a…
cedf213
…pache#26514)

Port of the upstream netty 4.2.17.Final -> 4.2.18.Final upgrade:
- root pom netty.version bump; netty-tcnative follows via the netty-bom
  (2.0.81.Final -> 2.0.84.Final)
- LICENSE.bin.txt (server + shell) netty/tcnative version lines realigned
  with the bundled jars
- ProxyProtocolTest.testSniProxyProtocol: use unresolvable-broker-address
  in the broker service URL so it matches the certificate SAN, as required
  by the now default-on hostname verification (same change as upstream
  PIP-478 core migration apache#26282)

Fixes the TLS handshake failures ("Connection already closed") seen with
netty 4.2.17 in ProxyServiceTlsStarterTest / ProxyProtocolTest.

(cherry picked from commit 7ddeac8e2339f3bd2b9e7c1d3694ec7c1a820bdc)
@dao-jun
[ci] Drop Shade on Java 8/11 matrix entries
eea0351
BookKeeper 4.18 jars are Java 17 bytecode (verified: class file major 61,
vs major 52 for the previous ascentstream 4.17.4.0 fork) and they are part
of the client dependency chain, so the shaded client artifacts cannot run
on Java 8/11 anymore. apache/pulsar made the same change when adopting
PIP-421 "Require Java 17 as the minimum for Pulsar Java client SDK"
(apache#24475): the SHADE_RUN matrix keeps only JDK 17+ entries.
@dao-jun
dao-jun force-pushed the dev/pick_batchread_and_cache branch from 7b885b2 to eea0351 Compare September 20, 2026 19:01
@dao-jun
[fix][test] Adapt testAdvanceCursorsIfNecessaryNeverLoseMarkDeletePro…
b6e2921
…perties stub to the 6-arg internalAsyncMarkDelete

The apache#25796 backport (39f0def) landed both the production fix and its
test, but the test stubs the 5-arg internalAsyncMarkDelete overload:
that is the arity master's asyncMarkDelete chain reaches, while on this
branch the chain routes through the 6-arg overload (adding
propagatePersistFailure/durableFallback) that NonDurableCursorImpl
overrides. The stub therefore never intercepted the advance-path call
and the entry latch deterministically timed out, leaving the test red
since the backport landed. Stub the 6-arg overload instead; the
null-properties contract asserted by apache#25796 is unchanged.
@dao-jun dao-jun mentioned this pull request Sep 21, 2026
[ci-debug] DO NOT MERGE — one instrumented CI run for PR #102 diagnostics #103
Closed
dao-jun added 5 commits September 21, 2026 17:41
@dao-jun
[ci] Point CI maven cache and build-artifact paths at the fork's grou…
e85c4c0
…pId com.ascentstream

The fork renamed the maven groupId from org.apache.pulsar to
com.ascentstream.pulsar, but the CI infrastructure still referenced the
upstream path ~/.m2/repository/org/apache/pulsar:

- the actions/cache exclusion lists kept caching com.ascentstream
  SNAPSHOT reactor artifacts under a key derived only from
  hashFiles('**/pom.xml'), so java-only fixes never changed the key and
  unit jobs kept testing whatever jars were cached when the key was
  first saved (observed: the netty-4.2 TLS builder fix and the
  PulsarMockBookKeeper properties fix were amended into the branch
  without touching any pom; CI restored a pre-fix cache entry and the
  already-fixed AuthenticationTlsHostnameVerificationTest[false],
  SchemaTest.testConcurrentCreateSchemaNoOrphanLedger and
  ProxyServiceTlsStarterTest.testProducer kept failing with the exact
  pre-fix signatures while every local configuration was green);
- the pulsar-maven-repository-binaries tar packed (and therefore the
  unit jobs' restore delivered) zero fork artifacts, so the fresh build
  could never override the stale cache;
- the coverage/deps tooling (snapshot_pulsar_maven_artifacts, classpath
  greps, sourcefiles extraction) silently matched nothing.

Point all of these at com/ascentstream so snapshot reactor artifacts are
never served from the shared cache and unit jobs always consume the
fresh build results, matching the upstream design under the fork's
groupId.
@dao-jun
Merge branch-as-4.0 into dev/pick_batchread_and_cache
4eb9471
Brings in the base's cursor reset/GC series (checkpoint ledger sweep,
batch-index-ack dirty flagging, failed-flush GC race hardening) and the
persistentUnackedRangesMaxEntrySize startup validation. The only textual
conflict was the add/add on ManagedLedgerClientFactoryTest — resolved by
keeping both sides' tests (apache#26627's cache-extension settings plumbing
tests plus the base's checkpoint maxEntrySize validation tests).
ManagedCursorTest 214/214 and the merged factory test 6/6 green on the
merged tree.
@dao-jun
[ci] Fix license header template in merged ManagedLedgerClientFactory…
0b80d99
…Test
@dao-jun
[fix][fn] Bundle slog into java-instance.jar so process-runtime insta…
818079b
…nces start with BookKeeper 4.18

BookKeeper 4.18's allocator classes log through slog, whose Log4j2 backend
probes for disruptor with its own classloader and, when disruptor is visible,
evaluates log4j's AsyncLogger (implements EventTranslatorVararg on log4j
2.26.x). In the function instance JVM the root classloader holds only
java-instance.jar (log4j bundled, disruptor not) while the child classloader
(/pulsar/lib) has disruptor via bookkeeper-server, so the probe enabled the
async fast path and the parent-delegated AsyncLogger definition failed with
NoClassDefFoundError: com/lmax/disruptor/EventTranslatorVararg. Every
process-runtime function/source instance died at startup, failing the System
jobs: PulsarMetadataStateStoreTest.testJavaWordCountFunction,
PulsarFunctionsJavaProcessTest.testAutoSchemaFunctionTest,
PulsarDebeziumSourcesTest.testDebeziumMongoDbSource and
PulsarDebeziumOracleSourceTest.testDebeziumOracleDbSource.

Bundling slog (zero transitive dependencies) into java-instance.jar - the
same jar content upstream master reaches via PIP-467 (apache#25508, slog on
pulsar-functions-api) - makes the probe run in the root classloader where
disruptor is absent, keeping the fast path disabled. JavaInstanceDepsTest
whitelists io/github/merlimat/slog, matching upstream.

Verified A/B locally against the built distribution: with the previous jar
the instance dies with the exact CI signature; with the bundled-slog jar the
wordcount instance reaches running=true and processes messages
(numReceived/numSuccessfullyProcessed > 0).
@dao-jun
[ci] Complete the artifactId extraction regex in pulsar_ci_tool.sh fo…
195068a
…r the fork groupId

The previous org/apache/pulsar -> com/ascentstream path fix missed one path
segment here: the fork's groupId com.ascentstream.pulsar resolves artifacts
under ~/.m2/repository/com/ascentstream/pulsar/<artifactId>/..., so the perl
expression captured the constant segment 'pulsar' instead of the artifactId.
Every jar then greps multiple lines of the project mapping and the coverage
--sourcefiles arguments are dropped. Anchor the pattern one segment deeper,
matching the tar exclusion fixed in the same commit.
nodece
nodece reviewed Sep 23, 2026
View reviewed changes
Comment thread pom.xml
Comment on lines +189 to +192
<bookkeeper.groupId>org.apache.bookkeeper</bookkeeper.groupId>
<distributedlog.groupId>org.apache.distributedlog</distributedlog.groupId>
<bookkeeper.version>4.18.1</bookkeeper.version>
<distributedlog.version>4.18.0</distributedlog.version>

@nodece nodece Sep 23, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO NOT change this package. If you need [email protected], we need to publish our own bk.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
nodece
nodece reviewed Sep 23, 2026
View reviewed changes
Comment thread pom.xml
bytecode (and netty-transport-classes-io_uring is Java 9) and they are part of the client
dependency chain, so a Java 8 client bytecode guarantee is no longer possible
(aligned with Apache Pulsar master). -->
<pulsar.client.compiler.release>17</pulsar.client.compiler.release>

@nodece nodece Sep 23, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks client SDK compatibility.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dao-jun dao-jun mentioned this pull request Oct 4, 2026
[feat][ml] Port batch read and managed-ledger cache improvements (PIP-430) on BK 4.17.4.1 #105
Closed
@liudezhi2098 liudezhi2098 closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nodece nodece nodece left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

PIP

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@dao-jun @nodece @liudezhi2098 @lhotari @3pacccccc @merlimat @StevenLuMT @Denovo1998
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.