You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2024/01/31 09:11:52 UTC

[PR] [feature] Add support Oxia as a metadata store [pulsar]

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

   ### Motivation
   
   Add support for Oxia (https://github.com/streamnative/oxia) as a possible metadata store backed.
   
   ### Modifications
   
   <!-- Describe the modifications you've done. -->
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [X] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] Add support Oxia as a metadata store [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#issuecomment-1919603951

   Ok, I can create a PIP, similar to Etcd support. 


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] Add support Oxia as a metadata store [pulsar]

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on code in PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#discussion_r1472803958


##########
pulsar-broker/pom.xml:
##########
@@ -164,6 +164,12 @@
       <scope>test</scope>
     </dependency>
 
+    <dependency>
+      <groupId>io.streamnative.oxia</groupId>
+      <artifactId>oxia-testcontainers</artifactId>
+      <scope>test</scope>
+    </dependency>

Review Comment:
   Should you remove this dependency? There is no new test added to `pulsar-broker`.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] Add support Oxia as a metadata store [pulsar]

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#issuecomment-1919082140

   And I agree with @nodece that we need a PIP for introducing a new plugin to the broker side.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] PIP-335: Add support Oxia as a metadata store [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #22007:
URL: https://github.com/apache/pulsar/pull/22007


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] PIP-335: Add support Oxia as a metadata store [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on code in PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#discussion_r1475091004


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/oxia/OxiaMetadataStore.java:
##########
@@ -0,0 +1,283 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.metadata.impl.oxia;
+
+import io.streamnative.oxia.client.OxiaClientBuilder;
+import io.streamnative.oxia.client.api.AsyncOxiaClient;
+import io.streamnative.oxia.client.api.DeleteOption;
+import io.streamnative.oxia.client.api.KeyAlreadyExistsException;
+import io.streamnative.oxia.client.api.Notification;
+import io.streamnative.oxia.client.api.PutOption;
+import io.streamnative.oxia.client.api.PutResult;
+import io.streamnative.oxia.client.api.UnexpectedVersionIdException;
+import io.streamnative.oxia.client.api.Version;
+import java.time.Duration;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionStage;
+import lombok.NonNull;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.pulsar.metadata.api.GetResult;
+import org.apache.pulsar.metadata.api.MetadataEventSynchronizer;
+import org.apache.pulsar.metadata.api.MetadataStoreConfig;
+import org.apache.pulsar.metadata.api.MetadataStoreException;
+import org.apache.pulsar.metadata.api.NotificationType;
+import org.apache.pulsar.metadata.api.Stat;
+import org.apache.pulsar.metadata.api.extended.CreateOption;
+import org.apache.pulsar.metadata.impl.AbstractMetadataStore;
+
+@Slf4j
+public class OxiaMetadataStore extends AbstractMetadataStore {
+
+    private final AsyncOxiaClient client;
+
+    private final String identity;
+    private final Optional<MetadataEventSynchronizer> synchronizer;
+
+    OxiaMetadataStore(
+            @NonNull String serviceAddress,
+            @NonNull String namespace,
+            @NonNull MetadataStoreConfig metadataStoreConfig,
+            boolean enableSessionWatcher)
+            throws Exception {
+        super("oxia-metadata");
+
+        var linger = metadataStoreConfig.getBatchingMaxDelayMillis();
+        if (!metadataStoreConfig.isBatchingEnabled()) {
+            linger = 0;
+        }
+        this.synchronizer = Optional.ofNullable(metadataStoreConfig.getSynchronizer());
+        identity = UUID.randomUUID().toString();
+        client =
+                new OxiaClientBuilder(serviceAddress)
+                        .clientIdentifier(identity)
+                        .namespace(namespace)
+                        .sessionTimeout(Duration.ofMillis(metadataStoreConfig.getSessionTimeoutMillis()))
+                        .batchLinger(Duration.ofMillis(linger))
+                        .maxRequestsPerBatch(metadataStoreConfig.getBatchingMaxOperations())
+                        .asyncClient()
+                        .get();
+        client.notifications(this::notificationCallback);
+        super.registerSyncListener(Optional.ofNullable(metadataStoreConfig.getSynchronizer()));
+    }
+
+    private void notificationCallback(Notification notification) {
+        if (notification instanceof Notification.KeyCreated keyCreated) {
+            receivedNotification(
+                    new org.apache.pulsar.metadata.api.Notification(
+                            NotificationType.Created, keyCreated.key()));
+            notifyParentChildrenChanged(keyCreated.key());
+
+        } else if (notification instanceof Notification.KeyModified keyModified) {
+            receivedNotification(
+                    new org.apache.pulsar.metadata.api.Notification(
+                            NotificationType.Modified, keyModified.key()));
+        } else if (notification instanceof Notification.KeyDeleted keyDeleted) {
+            receivedNotification(
+                    new org.apache.pulsar.metadata.api.Notification(
+                            NotificationType.Deleted, keyDeleted.key()));
+            notifyParentChildrenChanged(keyDeleted.key());
+        } else {
+            log.error("Unknown notification type {}", notification);
+        }
+    }
+
+    Optional<GetResult> convertGetResult(
+            String path, io.streamnative.oxia.client.api.GetResult result) {
+        if (result == null) {
+            return Optional.empty();
+        }
+        return Optional.of(result)
+                .map(
+                        oxiaResult ->
+                                new GetResult(oxiaResult.getValue(), convertStat(path, oxiaResult.getVersion())));
+    }
+
+    Stat convertStat(String path, Version version) {
+        return new Stat(
+                path,
+                version.versionId(),
+                version.createdTimestamp(),
+                version.modifiedTimestamp(),
+                version.sessionId().isPresent(),
+                version.clientIdentifier().stream().anyMatch(identity::equals),
+                version.modificationsCount() == 0);
+    }
+
+    @Override
+    protected CompletableFuture<List<String>> getChildrenFromStore(String path) {
+        var pathWithSlash = path + "/";
+
+        return client
+                .list(pathWithSlash, pathWithSlash + "/")
+                .thenApply(
+                        children ->
+                                children.stream().map(child -> child.substring(pathWithSlash.length())).toList())
+                .exceptionallyCompose(this::convertException);
+    }
+
+    @Override
+    protected CompletableFuture<Boolean> existsFromStore(String path) {
+        return client.get(path).thenApply(Objects::nonNull)
+                .exceptionallyCompose(this::convertException);
+    }
+
+    @Override
+    protected CompletableFuture<Optional<GetResult>> storeGet(String path) {
+        return client.get(path).thenApply(res -> convertGetResult(path, res))
+                .exceptionallyCompose(this::convertException);
+    }
+
+    @Override
+    protected CompletableFuture<Void> storeDelete(String path, Optional<Long> expectedVersion) {
+        return getChildrenFromStore(path)
+                .thenCompose(
+                        children -> {
+                            if (children.size() > 0) {
+                                return CompletableFuture.failedFuture(
+                                        new MetadataStoreException("Key '" + path + "' has children"));
+                            } else {
+                                var delOption =
+                                        expectedVersion
+                                                .map(DeleteOption::ifVersionIdEquals)
+                                                .orElse(DeleteOption.Unconditionally);
+                                CompletableFuture<Boolean> result = client.delete(path, delOption);
+                                return result
+                                        .thenCompose(
+                                                exists -> {
+                                                    if (!exists) {
+                                                        return CompletableFuture.failedFuture(
+                                                                new MetadataStoreException.NotFoundException(
+                                                                        "Key '" + path + "' does not exist"));
+                                                    }
+                                                    return CompletableFuture.completedFuture((Void) null);
+                                                })
+                                        .exceptionallyCompose(this::convertException);
+                            }
+                        });
+    }
+
+    @Override
+    protected CompletableFuture<Stat> storePut(
+            String path, byte[] data, Optional<Long> optExpectedVersion, EnumSet<CreateOption> options) {
+        CompletableFuture<Void> parentsCreated = createParents(path);
+        return parentsCreated.thenCompose(
+                __ -> {
+                    var expectedVersion = optExpectedVersion;
+                    if (expectedVersion.isPresent()
+                            && expectedVersion.get() != -1L

Review Comment:
   This is used across all plugins. The metadata store interface takes -1 as no version, following the ZK api. We should change for all plugins. 



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] Add support Oxia as a metadata store [pulsar]

Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#issuecomment-1919037091

   This PR seems to require a PIP, could you make a PIP?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] Add support Oxia as a metadata store [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on code in PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#discussion_r1473218577


##########
pulsar-broker/pom.xml:
##########
@@ -164,6 +164,12 @@
       <scope>test</scope>
     </dependency>
 
+    <dependency>
+      <groupId>io.streamnative.oxia</groupId>
+      <artifactId>oxia-testcontainers</artifactId>
+      <scope>test</scope>
+    </dependency>

Review Comment:
   There are end-to-end tests for different metadata stores in `pulsar-broker`. It was failing to pull this which is already a test-scoped dependency for `pulsar-metadata`.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] PIP-335: Add support Oxia as a metadata store [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on code in PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#discussion_r1475644534


##########
pom.xml:
##########
@@ -1152,6 +1153,18 @@ flexible messaging model and an intuitive client API.</description>
         <version>${sketches.version}</version>
       </dependency>
 
+      <dependency>
+        <groupId>io.streamnative.oxia</groupId>
+        <artifactId>oxia-client</artifactId>
+        <version>${oxia.version}</version>
+        <classifier>shaded</classifier>
+      </dependency>
+      <dependency>
+        <groupId>io.streamnative.oxia</groupId>
+        <artifactId>oxia-testcontainers</artifactId>
+        <version>${oxia.version}</version>
+      </dependency>

Review Comment:
   This is the `dependencyManagement` section, just to fix the version, it's not adding the dependency.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] PIP-335: Add support Oxia as a metadata store [pulsar]

Posted by "eolivelli (via GitHub)" <gi...@apache.org>.
eolivelli commented on code in PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#discussion_r1474253973


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/oxia/OxiaMetadataStore.java:
##########
@@ -0,0 +1,283 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.metadata.impl.oxia;
+
+import io.streamnative.oxia.client.OxiaClientBuilder;
+import io.streamnative.oxia.client.api.AsyncOxiaClient;
+import io.streamnative.oxia.client.api.DeleteOption;
+import io.streamnative.oxia.client.api.KeyAlreadyExistsException;
+import io.streamnative.oxia.client.api.Notification;
+import io.streamnative.oxia.client.api.PutOption;
+import io.streamnative.oxia.client.api.PutResult;
+import io.streamnative.oxia.client.api.UnexpectedVersionIdException;
+import io.streamnative.oxia.client.api.Version;
+import java.time.Duration;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionStage;
+import lombok.NonNull;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.pulsar.metadata.api.GetResult;
+import org.apache.pulsar.metadata.api.MetadataEventSynchronizer;
+import org.apache.pulsar.metadata.api.MetadataStoreConfig;
+import org.apache.pulsar.metadata.api.MetadataStoreException;
+import org.apache.pulsar.metadata.api.NotificationType;
+import org.apache.pulsar.metadata.api.Stat;
+import org.apache.pulsar.metadata.api.extended.CreateOption;
+import org.apache.pulsar.metadata.impl.AbstractMetadataStore;
+
+@Slf4j
+public class OxiaMetadataStore extends AbstractMetadataStore {
+
+    private final AsyncOxiaClient client;
+
+    private final String identity;
+    private final Optional<MetadataEventSynchronizer> synchronizer;
+
+    OxiaMetadataStore(
+            @NonNull String serviceAddress,
+            @NonNull String namespace,
+            @NonNull MetadataStoreConfig metadataStoreConfig,
+            boolean enableSessionWatcher)
+            throws Exception {
+        super("oxia-metadata");
+
+        var linger = metadataStoreConfig.getBatchingMaxDelayMillis();
+        if (!metadataStoreConfig.isBatchingEnabled()) {
+            linger = 0;
+        }
+        this.synchronizer = Optional.ofNullable(metadataStoreConfig.getSynchronizer());
+        identity = UUID.randomUUID().toString();
+        client =
+                new OxiaClientBuilder(serviceAddress)
+                        .clientIdentifier(identity)
+                        .namespace(namespace)
+                        .sessionTimeout(Duration.ofMillis(metadataStoreConfig.getSessionTimeoutMillis()))
+                        .batchLinger(Duration.ofMillis(linger))
+                        .maxRequestsPerBatch(metadataStoreConfig.getBatchingMaxOperations())
+                        .asyncClient()
+                        .get();
+        client.notifications(this::notificationCallback);
+        super.registerSyncListener(Optional.ofNullable(metadataStoreConfig.getSynchronizer()));
+    }
+
+    private void notificationCallback(Notification notification) {
+        if (notification instanceof Notification.KeyCreated keyCreated) {
+            receivedNotification(
+                    new org.apache.pulsar.metadata.api.Notification(
+                            NotificationType.Created, keyCreated.key()));
+            notifyParentChildrenChanged(keyCreated.key());
+
+        } else if (notification instanceof Notification.KeyModified keyModified) {
+            receivedNotification(
+                    new org.apache.pulsar.metadata.api.Notification(
+                            NotificationType.Modified, keyModified.key()));
+        } else if (notification instanceof Notification.KeyDeleted keyDeleted) {
+            receivedNotification(
+                    new org.apache.pulsar.metadata.api.Notification(
+                            NotificationType.Deleted, keyDeleted.key()));
+            notifyParentChildrenChanged(keyDeleted.key());
+        } else {
+            log.error("Unknown notification type {}", notification);
+        }
+    }
+
+    Optional<GetResult> convertGetResult(
+            String path, io.streamnative.oxia.client.api.GetResult result) {
+        if (result == null) {
+            return Optional.empty();
+        }
+        return Optional.of(result)
+                .map(
+                        oxiaResult ->
+                                new GetResult(oxiaResult.getValue(), convertStat(path, oxiaResult.getVersion())));
+    }
+
+    Stat convertStat(String path, Version version) {
+        return new Stat(
+                path,
+                version.versionId(),
+                version.createdTimestamp(),
+                version.modifiedTimestamp(),
+                version.sessionId().isPresent(),
+                version.clientIdentifier().stream().anyMatch(identity::equals),
+                version.modificationsCount() == 0);
+    }
+
+    @Override
+    protected CompletableFuture<List<String>> getChildrenFromStore(String path) {
+        var pathWithSlash = path + "/";
+
+        return client
+                .list(pathWithSlash, pathWithSlash + "/")
+                .thenApply(
+                        children ->
+                                children.stream().map(child -> child.substring(pathWithSlash.length())).toList())
+                .exceptionallyCompose(this::convertException);
+    }
+
+    @Override
+    protected CompletableFuture<Boolean> existsFromStore(String path) {
+        return client.get(path).thenApply(Objects::nonNull)
+                .exceptionallyCompose(this::convertException);
+    }
+
+    @Override
+    protected CompletableFuture<Optional<GetResult>> storeGet(String path) {
+        return client.get(path).thenApply(res -> convertGetResult(path, res))
+                .exceptionallyCompose(this::convertException);
+    }
+
+    @Override
+    protected CompletableFuture<Void> storeDelete(String path, Optional<Long> expectedVersion) {
+        return getChildrenFromStore(path)
+                .thenCompose(
+                        children -> {
+                            if (children.size() > 0) {
+                                return CompletableFuture.failedFuture(
+                                        new MetadataStoreException("Key '" + path + "' has children"));
+                            } else {
+                                var delOption =
+                                        expectedVersion
+                                                .map(DeleteOption::ifVersionIdEquals)
+                                                .orElse(DeleteOption.Unconditionally);
+                                CompletableFuture<Boolean> result = client.delete(path, delOption);
+                                return result
+                                        .thenCompose(
+                                                exists -> {
+                                                    if (!exists) {
+                                                        return CompletableFuture.failedFuture(
+                                                                new MetadataStoreException.NotFoundException(
+                                                                        "Key '" + path + "' does not exist"));
+                                                    }
+                                                    return CompletableFuture.completedFuture((Void) null);
+                                                })
+                                        .exceptionallyCompose(this::convertException);
+                            }
+                        });
+    }
+
+    @Override
+    protected CompletableFuture<Stat> storePut(
+            String path, byte[] data, Optional<Long> optExpectedVersion, EnumSet<CreateOption> options) {
+        CompletableFuture<Void> parentsCreated = createParents(path);
+        return parentsCreated.thenCompose(
+                __ -> {
+                    var expectedVersion = optExpectedVersion;
+                    if (expectedVersion.isPresent()
+                            && expectedVersion.get() != -1L

Review Comment:
   nit: is it better to have a constant for the magic value -1 ?



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] PIP-335: Add support Oxia as a metadata store [pulsar]

Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on code in PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#discussion_r1475412127


##########
pom.xml:
##########
@@ -1152,6 +1153,18 @@ flexible messaging model and an intuitive client API.</description>
         <version>${sketches.version}</version>
       </dependency>
 
+      <dependency>
+        <groupId>io.streamnative.oxia</groupId>
+        <artifactId>oxia-client</artifactId>
+        <version>${oxia.version}</version>
+        <classifier>shaded</classifier>
+      </dependency>
+      <dependency>
+        <groupId>io.streamnative.oxia</groupId>
+        <artifactId>oxia-testcontainers</artifactId>
+        <version>${oxia.version}</version>
+      </dependency>

Review Comment:
   ```suggestion
           <scope>test</scope>
         </dependency>
   ```



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat] PIP-335: Add support Oxia as a metadata store [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on PR #22007:
URL: https://github.com/apache/pulsar/pull/22007#issuecomment-1920224739

   @nodece @BewareMyPower PIP created #22009  
   
   https://lists.apache.org/thread/bmlo879sm1dd9wkgqzhb7fzlppdzm3yl 
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org