merlimat opened a new pull request #2203: Make sure schema is initialized 
before the topic is loaded
URL: https://github.com/apache/incubator-pulsar/pull/2203
 
 
   ### Motivation
   
   There is a race condition when the topic creation is triggered by multiple 
producers at the same with a schema definition. 
   
    1. The topic is created correctly and then each producers tries to add the 
schema
    2. One single operation will first create the z-node entry for schema 
registry (that points to no schema) and then will add the schema
    3. Other producers might happen to see the z-node but content will be 
invalid (ledgerId=-1)
   
   ### Modifications
   
    * Do the `topic.addSchema()` operation *before* the topic is visible. That 
will ensure the whole chain of "schema" operations will be done at least once 
before the topic is finally loaded. After that, each producer/consumer will see 
at least a valid schema. 
   
   ### Result
   This fixes the flakyness in `PartitionedTopicsSchemaTest`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to