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

   ### Motivation
   
   #11441 supports replicate schema to remote clusters.
   But there is a mistake that the returned schema state is incorrect.
   
   
https://github.com/apache/pulsar/blob/e826d849ceef9d6aef28569ad57950bba90dfff1/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java#L765-L770
   
   Because the replicator used MessageImpl will not have the schema.
   And this will cause the producer to skip the schema upload.
   
   
https://github.com/apache/pulsar/blob/e826d849ceef9d6aef28569ad57950bba90dfff1/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L2147-L2149
   
   We should remove
   
   
https://github.com/apache/pulsar/blob/e826d849ceef9d6aef28569ad57950bba90dfff1/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java#L766-L768
   
   To return the correct schema state.
   
   And then we should also provide the correct schema hash.
   If the message is used by the replicator, the schema hash should
   be based on the replicator schema. Otherwise, it should use based
   on the schema of the message.
   
   ### Modification
   
   - Fixed the incorrect returned schema state
   - Provide the method for getting schema hash for MessageImpl
   
   ### Verification
   
   Update the test only to create a producer to one cluster.
   Because if create a producer for other clusters, the producer will
   upload the schema. This is the reason why the test can get
   passed before.


-- 
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