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


##########
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:
   Sounds good.
   One point to clarify is "creating lot of versions" will create lots of new 
schema ledger too.



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