AnonHxy commented on code in PR #18293:
URL: https://github.com/apache/pulsar/pull/18293#discussion_r1016114150


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java:
##########
@@ -154,6 +168,18 @@ public void writeReadBackDeleteSchemaEntry() throws 
Exception {
         assertNull(schemaRegistryService.getSchema(schemaId1).get());
     }
 
+    @Test
+    public void testConcurrentPutSchema() throws Exception {
+        String schemaId = "tenant/ns/topic_test_concurrent_put_schema" + 
UUID.randomUUID();
+        CompletableFuture.allOf(
+                putSchema(schemaId, schemaData1),
+                putSchema(schemaId, schemaData1),
+                putSchema(schemaId, schemaData1),
+                putSchema(schemaId, schemaData1))
+                .get();
+        assertEquals(getAllSchemas(schemaId).size(), 1);

Review Comment:
   OK, how about changing the title of this PR to `fix creating lots of 
versions for the same schema`. Because it seems that this PR doesn't fix 
creating lots of ledgers,  instead it fix creating lot of versions. @aloyszhang 



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