-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fix][broker]fix memory leak, messages lost, incorrect replication state if using multiple versions schema #24178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
poorbarcode
wants to merge
14
commits into
apache:master
Choose a base branch
from
poorbarcode:fix/multiple_version_schema_publish
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[fix][broker]fix memory leak, messages lost, incorrect replication state if using multiple versions schema #24178
poorbarcode
wants to merge
14
commits into
apache:master
from
poorbarcode:fix/multiple_version_schema_publish
+436
−35
Conversation
This file contains 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
/pulsarbot rerun-failure-checks |
lhotari
reviewed
Apr 14, 2025
pulsar-client/src/main/java/org/apache/pulsar/client/impl/GeoReplicationProducerImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
Outdated
Show resolved
Hide resolved
Technoboy-
reviewed
Apr 15, 2025
pulsar-client/src/main/java/org/apache/pulsar/client/impl/GeoReplicationProducerImpl.java
Outdated
Show resolved
Hide resolved
lhotari
reviewed
Apr 15, 2025
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/GeoReplicationProducerImpl.java
Outdated
Show resolved
Hide resolved
…ate if using multiple versions schema
…ucerImpl.java Co-authored-by: Lari Hotari <[email protected]>
…ucerImpl.java Co-authored-by: Lari Hotari <[email protected]>
…ucerImpl.java Co-authored-by: Lari Hotari <[email protected]>
…eplicationProducerImpl.java Co-authored-by: Lari Hotari <[email protected]>
af91444
to
30a488c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
doc-not-needed
Your PR changes do not impact docs
ready-to-test
release/3.0.12
release/3.3.7
release/4.0.5
type/bug
The PR fixed a bug or issue reported a bug
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
Issue 1: memory leak when publishing messages with a broken schema
testBrokenSchema
.Issue 2: incorrect replication/producer state
Ready -> RegisteringSchema
.replication.connected
orproducer.connected
showsfalse
testProducerConnectStateWhenRegisteringSchema
Issue 3: replication lost messages or is out of order
time / task
internal producer of replicator
msg1
with a compatible schemamsg2
with a incompatible schemamsg1
with a compatible schemaResult:
msg1
was sentmsg2
was discarded due to incompatible schemamsg3
was sentIssue 4: Reused a recycled SendCallback, which causes a dangerous issue
time / task
client: publish with a broken schema
broker-side: handle schema
broker-side: disconnect
client: close producer
metadata store threads
orBookie client threads
Broken schema
op
is still inproducer.pendingMessages
[1]op.callback
was recycled`client-side
: disconnectedfailPendingMessages
, which provides a failed callback for all pending messagesAt
step 10
, the producer will call a failed callback on a recycledSendCallback
which has been recycled atstep 8
, but the objectSendCallback
may be used by others, which will cause unexpected and dangenrous issues.[1] https://github.com/apache/pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L894
You can reproduce
issues 3 and 4
with the new testtestIncompatibleMultiVersionSchema
, and you will get following various errors, but the test is not in order to reproduce a special case.Modifications
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x