-
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 schema versions(auto_produce) #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
Merged
poorbarcode
merged 18 commits into
apache:master
from
poorbarcode:fix/multiple_version_schema_publish
May 7, 2025
Merged
[fix][broker]fix memory leak, messages lost, incorrect replication state if using multiple schema versions(auto_produce) #24178
poorbarcode
merged 18 commits into
apache:master
from
poorbarcode:fix/multiple_version_schema_publish
May 7, 2025
Conversation
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
/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
af91444
to
30a488c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24178 +/- ##
============================================
+ Coverage 73.57% 74.18% +0.60%
+ Complexity 32624 32504 -120
============================================
Files 1877 1865 -12
Lines 139502 144709 +5207
Branches 15299 16538 +1239
============================================
+ Hits 102638 107350 +4712
+ Misses 28908 28867 -41
- Partials 7956 8492 +536
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
lhotari
reviewed
Apr 17, 2025
pulsar-common/src/main/java/org/apache/pulsar/client/impl/schema/SchemaUtils.java
Show resolved
Hide resolved
lhotari
reviewed
Apr 17, 2025
pulsar-common/src/main/java/org/apache/pulsar/client/impl/schema/SchemaInfoImpl.java
Outdated
Show resolved
Hide resolved
lhotari
reviewed
Apr 17, 2025
...lient/src/main/java/org/apache/pulsar/client/impl/PulsarClientImplementationBindingImpl.java
Outdated
Show resolved
Hide resolved
…ate if using multiple versions schema
poorbarcode
added a commit
that referenced
this pull request
May 7, 2025
…ate if using multiple schema versions(auto_produce) (#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20)
2 tasks
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 8, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
4 tasks
liangyepianzhou
pushed a commit
that referenced
this pull request
May 12, 2025
…h incompatible schema is discarded (#24282) Fixes #24262 Main Issue: #24262 ### Motivation The issue is a regression of #24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages ### Modifications Fix the issue
lhotari
pushed a commit
that referenced
this pull request
May 14, 2025
…h incompatible schema is discarded (#24282) Fixes #24262 Main Issue: #24262 ### Motivation The issue is a regression of #24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages ### Modifications Fix the issue (cherry picked from commit df2c619)
lhotari
pushed a commit
that referenced
this pull request
May 14, 2025
…h incompatible schema is discarded (#24282) Fixes #24262 Main Issue: #24262 ### Motivation The issue is a regression of #24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages ### Modifications Fix the issue (cherry picked from commit df2c619)
lhotari
pushed a commit
that referenced
this pull request
May 14, 2025
…h incompatible schema is discarded (#24282) Fixes #24262 Main Issue: #24262 ### Motivation The issue is a regression of #24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages ### Modifications Fix the issue (cherry picked from commit df2c619)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 15, 2025
…h incompatible schema is discarded (apache#24282) Fixes apache#24262 Main Issue: apache#24262 The issue is a regression of apache#24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages Fix the issue (cherry picked from commit df2c619) (cherry picked from commit 5496d92)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 15, 2025
…h incompatible schema is discarded (apache#24282) Fixes apache#24262 Main Issue: apache#24262 The issue is a regression of apache#24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages Fix the issue (cherry picked from commit df2c619) (cherry picked from commit 5496d92)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 15, 2025
…h incompatible schema is discarded (apache#24282) Fixes apache#24262 Main Issue: apache#24262 The issue is a regression of apache#24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages Fix the issue (cherry picked from commit df2c619) (cherry picked from commit 5496d92)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 15, 2025
…h incompatible schema is discarded (apache#24282) Fixes apache#24262 Main Issue: apache#24262 The issue is a regression of apache#24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages Fix the issue (cherry picked from commit df2c619) (cherry picked from commit a66d6b7)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 16, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 16, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 16, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 16, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 16, 2025
…h incompatible schema is discarded (apache#24282) Fixes apache#24262 Main Issue: apache#24262 The issue is a regression of apache#24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages Fix the issue (cherry picked from commit df2c619) (cherry picked from commit 5496d92)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 16, 2025
…h incompatible schema is discarded (apache#24282) Fixes apache#24262 Main Issue: apache#24262 The issue is a regression of apache#24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages Fix the issue (cherry picked from commit df2c619) (cherry picked from commit 5496d92)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 18, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 18, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 18, 2025
…h incompatible schema is discarded (apache#24282) Fixes apache#24262 Main Issue: apache#24262 The issue is a regression of apache#24178. The flow of the issue occurring is as follows - Publish msg 1, which has an incompatible schema - Publish msg 2, which has an incompatible schema - The first message's schema failed to register because it is incompatible - The message was discarded. - Issue: it did not trigger a schema registration of the following messages Fix the issue (cherry picked from commit df2c619) (cherry picked from commit a66d6b7)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 19, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 19, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 29, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace) (cherry picked from commit 21d727d)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 30, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace) (cherry picked from commit 21d727d)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 30, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace) (cherry picked from commit 21d727d)
ganesh-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 30, 2025
…ate if using multiple schema versions(auto_produce) (apache#24178) Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Penghui Li <[email protected]> (cherry picked from commit 82e1d20) (cherry picked from commit 0f7aace) (cherry picked from commit 21d727d)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-3.0
cherry-picked/branch-3.3
cherry-picked/branch-4.0
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