Repository navigation
[improve][ml] Share immutable publish positions with cached entries - #26526
Merged
lhotari merged 2 commits intoSep 10, 2026
Merged
Conversation
Create the completion position before cache insertion and pass it to the existing EntryImpl.create overload taking Position. Reuse the immutable instance for the cache and completion state; preserve uncached, shadow-ledger and rollover paths. Include a pooled-entry position-sharing benchmark and Netty-thread executor. Assisted-by: Codex
merlimat
approved these changes
Sep 10, 2026
dao-jun
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
Sep 20, 2026
…pache#26526) (cherry picked from commit 7bcae18)
dao-jun
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
Sep 20, 2026
…pache#26526) (cherry picked from commit 7bcae18)
Radiancebobo
pushed a commit
to Radiancebobo/pulsar
that referenced
this pull request
Oct 8, 2026
nodece
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
Oct 13, 2026
…pache#26526) (cherry picked from commit 7bcae18) (cherry picked from commit e34774a)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Cached publish completion creates a position for the cache entry and then another identical immutable position for the last-confirmed state and add callback.
Modifications
Create the completion position before cache insertion and pass it to the existing EntryImpl.create overload taking Position. Reuse the immutable instance for the cache and completion state; preserve uncached, shadow-ledger and rollover paths. Include a pooled-entry position-sharing benchmark and Netty-thread executor.
Verifying this change
Historical pooled-entry JMH reduced cached-path allocation from 64 to 32 B, with CPU effectively flat; uncached allocation remained 32 B. The targeted position allocation disappeared in the full profile, but aggregate broker allocation/CPU were flat. No aggregate gain is claimed. Run the benchmark fork with -Djmh.executor=CUSTOM -Djmh.executor.class=org.apache.pulsar.client.impl.FastThreadLocalBenchmarkExecutor; its runtime guard verifies appropriate threads. No new performance experiments were run for extraction.
Local extraction validation passed:
spotlessCheck checkstyleMain checkstyleTest, benchmark compilation, and 19 scoped tests with no failures or skips: org.apache.bookkeeper.mledger.impl.EntryImplTest (10), org.apache.bookkeeper.mledger.impl.ManagedLedgerTest (8), org.apache.bookkeeper.mledger.impl.ShadowManagedLedgerImplTest (1). Retries were disabled; Gradle ran with--max-workers=2 --no-parallel.Does this pull request potentially affect one of the following parts: