-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[PIP-236][fix][broker]Fix using schema to create consumer fails after using AUTO_CONSUME consumer to subscribe topic #17449
Conversation
…g AUTO_CONSUME consumer to subscribe topic
67220fe
to
74f23b4
Compare
Hi @Denovo1998 , we'd better add test for this. |
…g AUTO_CONSUME consumer to subscribe topic
74f23b4
to
d1c40ff
Compare
…ls after using AUTO_CONSUME consumer to subscribe topic
Already done @Technoboy- |
22d6a06
to
37a48e4
Compare
…g AUTO_CONSUME consumer to subscribe topic
…ls after using AUTO_CONSUME consumer to subscribe topic
37a48e4
to
350bef1
Compare
/pulsarbot rerun-failure-checks |
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AutoConsumeSchema.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java
Outdated
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java
Show resolved
Hide resolved
…O. Reduce the duplication of convertAutoConsumeSchema code and reuse convertSchema.
…hemaType(SchemaType type), and delete the judgment of schema as AutoConsume in ServerCnx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
This is my first contribution. Maybe now I need more review and approval? Or add a ready-to-test label to the PR? In my own forked repository, all the tests are already passing. |
@liangyepianzhou please help review this PR |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
@Denovo1998 hi, could you merge |
@congbobo184 I'm done. But in this pr I see 2 workflows awaiting approval. |
@Denovo1998 I've triggered the CI workflow for you :) |
@tisonkun Thanks for your help. |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
That's weird. I ran this test a few times and sometimes it worked and sometimes it failed.
I found some issues and pr that might be related. Do I need to continue running `run-fail-checks`` for the test to succeed? |
/pulsarbot run-failure-checks |
@congbobo184 Now we can merge. |
Fixes #17354
PIP #19113
Motivation
Fixed the failure to use schema to create consumer after using AUTO-CONSUME consumer to subscribe an empty topic, and Broker returned the error message as
IncompatibleSchemaException("Topic does not have schema to check")
.Modifications
In PersistentTopic::addSchemaIfIdleOrCheckCompatible, when there is an active consumer, but the consumer is using the AUTO_CONSUME schema to subscribe to the topic. Continuing to create a schema consumer to subscribe to the topic will fail.
numActiveConsumers != 0
, and check the schema of the currently existing consumers is AUTO_CONSUME schema.Verifying this change
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
Check the box below or label this PR directly.
Need to update docs?
doc-required
(Your PR needs to update docs and you will update later)
doc-not-needed
(Please explain why)
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)
Matching PR in forked repository
PR in forked repository: Denovo1998#1