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 — [improve][ml] Share immutable publish positions with cached entries by lhotari · Pull Request #26526 · apache/pulsar

Conversation

@lhotari

@lhotari lhotari commented Sep 10, 2026

Copy link
Copy Markdown
Member

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.

  • Make sure that the change passes the CI checks.

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

  • 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
[improve][ml] Share immutable publish positions with cached entries
1691b1b
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
@lhotari
lhotari requested review from Technoboy-, dao-jun, merlimat and nodece September 10, 2026 13:00
merlimat
merlimat approved these changes Sep 10, 2026
View reviewed changes
@merlimat
Merge branch 'master' into lh-perfopt-improve-publish-position-sharing
757a3ba
@lhotari
lhotari merged commit 7bcae18 into apache:master Sep 10, 2026
43 checks passed

Uh oh!

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

@lhotari lhotari added this to the 5.0.0-M2 milestone Sep 12, 2026
dao-jun pushed a commit to ascentstream/pulsar that referenced this pull request Sep 20, 2026
@lhotari @dao-jun
[improve][ml] Share immutable publish positions with cached entries (a…
2371628
…pache#26526)

(cherry picked from commit 7bcae18)
dao-jun pushed a commit to ascentstream/pulsar that referenced this pull request Sep 20, 2026
@lhotari @dao-jun
[improve][ml] Share immutable publish positions with cached entries (a…
e34774a
…pache#26526)

(cherry picked from commit 7bcae18)
@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 ascentstream/pulsar#105
Closed
Radiancebobo pushed a commit to Radiancebobo/pulsar that referenced this pull request Oct 8, 2026
@lhotari hechengbo
[improve][ml] Share immutable publish positions with cached entries (a…
1913227
…pache#26526)
@nodece nodece mentioned this pull request Oct 13, 2026
[feat][ml] Port batch read and managed-ledger cache improvements (PIP-430) on BK 4.17.4.1 (ml-only subset) ascentstream/pulsar#106
Closed
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Oct 13, 2026
@lhotari @nodece
[improve][ml] Share immutable publish positions with cached entries (a…
81702ab
…pache#26526)

(cherry picked from commit 7bcae18)
(cherry picked from commit e34774a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merlimat merlimat merlimat approved these changes
@nodece nodece Awaiting requested review from nodece
@dao-jun dao-jun Awaiting requested review from dao-jun
@Technoboy- Technoboy- Awaiting requested review from Technoboy-

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

5.0.0-M2

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@lhotari @merlimat
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.