codelipenghui opened a new pull request, #17523:
URL: https://github.com/apache/pulsar/pull/17523

   ### Motivation
   
   We can see many logs like the following (not master since 
https://github.com/apache/pulsar/pull/16345 has changed to level to debug)
   
   
![image](https://user-images.githubusercontent.com/12592133/188914368-b2384e02-1a15-49b3-a78b-31f1384b0b16.png)
   
   And it is easy to reproduce. You can just create a geo-replicated cluster
   and produce the bytes messages.
   
   It should be related to this change 
https://github.com/apache/pulsar/pull/17049(haven't released) which fixed the 
replicated schema issue.
   But we shouldn't get the schema from the broker for the BYTES schema, the 
client side will not cache the BYTES schema.
   So, the replicator tries to get the schema again and again.
   
   
https://github.com/apache/pulsar/blob/eab2bb5fe089217d39a71965526729a3d93b74b6/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L756-L763
   
   ### Modifications
   
   The fix is the same as the normal messages with AUTO_PRODUCE producer do
   
   
https://github.com/apache/pulsar/blob/eab2bb5fe089217d39a71965526729a3d93b74b6/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L709-L713
   
   If the users will not change the message schema(send with bytes), the 
message schema is also AUTO_PRODUCE,
   so the producer will not try to fetch schema from the broker.
   
   ### Verifying this change
   
   New test added.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### 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)
     
   - [x] `doc-not-needed` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to