Skip to content

[fix][broker] In replication scenario, remote consumer could not be registered if there has no message was sent#20888

Merged
poorbarcode merged 3 commits intoapache:masterfrom
poorbarcode:fix/replicator_consumer_earlier
Jul 28, 2023
Merged

[fix][broker] In replication scenario, remote consumer could not be registered if there has no message was sent#20888
poorbarcode merged 3 commits intoapache:masterfrom
poorbarcode:fix/replicator_consumer_earlier

Conversation

@poorbarcode
Copy link
Copy Markdown
Contributor

Motivation

In the replication scenario, we want to produce messages on the native cluster and consume messages on the remote cluster, the producer and consumer both use a same schema, but the consumer cannot be registered if there has no messages in the topic yet.

The root cause is that for the remote cluster, there is a producer who has been registered with AUTO_PRODUCE_BYTES schema, so there is no schema to check the compatibility.

Modifications

If there is no schema and only the replicator producer was registered, skip the compatibility check.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Jul 26, 2023
@poorbarcode poorbarcode self-assigned this Jul 26, 2023
@poorbarcode poorbarcode added this to the 3.2.0 milestone Jul 26, 2023
@codelipenghui codelipenghui added the type/bug The PR fixed a bug or issue reported a bug label Jul 27, 2023
Copy link
Copy Markdown
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +1296 to +1298
* TODO: I think this design should be improved: if a producer used "AUTO_PRODUCE_BYTES" schema, we should allow
* the new consumer to register new schema. But before we can solve this problem, we need to modify
* "CmdProducer" to let the Broker know that the Producer uses a schema of type "AUTO_PRODUCE_BYTES".
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. It should be the right solution. Please help create an issue to track the following fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, it is #20891

…neWayReplicatorTest.java

Co-authored-by: Penghui Li <penghui@apache.org>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.11%. Comparing base (ffb9d30) to head (b8425c1).
Report is 1593 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #20888       +/-   ##
=============================================
+ Coverage     34.70%   73.11%   +38.40%     
- Complexity    12078    32226    +20148     
=============================================
  Files          1697     1874      +177     
  Lines        129786   139377     +9591     
  Branches      14157    15328     +1171     
=============================================
+ Hits          45037   101899    +56862     
+ Misses        78757    29402    -49355     
- Partials       5992     8076     +2084     
Flag Coverage Δ
inttests 24.21% <100.00%> (?)
systests 25.09% <100.00%> (+<0.01%) ⬆️
unittests 72.39% <100.00%> (+40.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rg/apache/pulsar/broker/service/AbstractTopic.java 86.45% <100.00%> (+28.24%) ⬆️
...sar/broker/service/persistent/PersistentTopic.java 79.17% <ø> (+28.78%) ⬆️

... and 1454 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@poorbarcode poorbarcode requested a review from mattisonchao July 27, 2023 17:46
@nodece nodece changed the title [fix] [broker] In replication scenario, remote consumer could not be registered if there has no message was sent [fix][broker] In replication scenario, remote consumer could not be registered if there has no message was sent Jul 28, 2023
@poorbarcode poorbarcode merged commit 9be0b52 into apache:master Jul 28, 2023
poorbarcode added a commit that referenced this pull request Jul 28, 2023
…egistered if there has no message was sent (#20888)

Motivation: In the replication scenario, we want to produce messages on the native cluster and consume messages on the remote cluster, the producer and consumer both use a same schema, but the consumer cannot be registered if there has no messages in the topic yet.The root cause is that for the remote cluster, there is a producer who has been registered with `AUTO_PRODUCE_BYTES` schema, so there is no schema to check the compatibility.

Modifications: If there is no schema and only the replicator producer was registered, skip the compatibility check.
(cherry picked from commit 9be0b52)
poorbarcode added a commit that referenced this pull request Jul 28, 2023
…egistered if there has no message was sent (#20888)

Motivation: In the replication scenario, we want to produce messages on the native cluster and consume messages on the remote cluster, the producer and consumer both use a same schema, but the consumer cannot be registered if there has no messages in the topic yet.The root cause is that for the remote cluster, there is a producer who has been registered with `AUTO_PRODUCE_BYTES` schema, so there is no schema to check the compatibility.

Modifications: If there is no schema and only the replicator producer was registered, skip the compatibility check.
(cherry picked from commit 9be0b52)
poorbarcode added a commit that referenced this pull request Jul 28, 2023
…egistered if there has no message was sent (#20888)

Motivation: In the replication scenario, we want to produce messages on the native cluster and consume messages on the remote cluster, the producer and consumer both use a same schema, but the consumer cannot be registered if there has no messages in the topic yet.The root cause is that for the remote cluster, there is a producer who has been registered with `AUTO_PRODUCE_BYTES` schema, so there is no schema to check the compatibility.

Modifications: If there is no schema and only the replicator producer was registered, skip the compatibility check.
(cherry picked from commit 9be0b52)
@Technoboy- Technoboy- removed this from the 3.2.0 milestone Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants