Jason918 commented on code in PR #16005:
URL: https://github.com/apache/pulsar/pull/16005#discussion_r894973097
##########
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/MetadataStoreTest.java:
##########
@@ -447,4 +448,33 @@ public void run() {
assertEquals(successWrites.get(), maxValue);
assertEquals(store.get(path).get().get().getValue()[0], maxValue);
}
+
+ @Test(dataProvider = "impl")
+ public void testConcurrentPut(String provider, Supplier<String>
urlSupplier) throws Exception {
+ MetadataStore store = MetadataStoreFactory.create(urlSupplier.get(),
MetadataStoreConfig.builder().build());
+
+ String k = newKey();
+ CompletableFuture<Void> f1 =
+ CompletableFuture.runAsync(() -> store.put(k, new byte[0],
Optional.of(-1L)).join());
+ CompletableFuture<Void> f2 =
+ CompletableFuture.runAsync(() -> store.put(k, new byte[0],
Optional.of(-1L)).join());
Review Comment:
Do you mean increase concurrency?
It's not necessary in this case, two threads can reproduce the issue easily.
--
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]