You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2026/06/09 23:14:00 UTC
[PR] [fix][ml] Reset messageMetadataInitialized when recycling RangeCacheEntryWrapper [pulsar]
merlimat opened a new pull request, #25987:
URL: https://github.com/apache/pulsar/pull/25987
### Motivation
`RangeCacheEntryWrapper.recycle()` resets all wrapper fields except `messageMetadataInitialized`. Once a wrapper has served a cache hit (which sets the flag in `getValueInternal`), every entry later stored in that recycled wrapper instance inherits `messageMetadataInitialized=true`, so `getValueInternal()` skips the lazy `EntryImpl.initializeMessageMetadataIfNeeded()` call.
After recycler warm-up, cache hits return entries whose message metadata was never parsed, and each dispatcher falls back to `Commands.peekAndCopyMessageMetadata` — a full metadata parse plus a `MessageMetadata` copy per entry per subscription. This silently defeats the parse-once-per-cached-entry optimization, with the cost multiplied by subscription fan-out.
### Modifications
Reset `messageMetadataInitialized` in `recycle()`, matching the reset of the other wrapper fields. `recycle()` is the wrapper's only return-to-pool path, so this fully restores the intended lazy-init behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][ml] Reset messageMetadataInitialized when recycling RangeCacheEntryWrapper [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #25987:
URL: https://github.com/apache/pulsar/pull/25987
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org