Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529741336


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespaceAuthZTest.java:
##
@@ -0,0 +1,159 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+public class NamespaceAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testProperties() {
+final String random = UUID.randomUUID().toString();
+final String namespace = "public/default";
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createNonPartitionedTopic(topic);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+Map properties = new HashMap<>();
+properties.put("key1", "value1");
+superUserAdmin.namespaces().setProperties(namespace, properties);
+superUserAdmin.namespaces().setProperty(namespace, "key2", "value2");
+superUserAdmin.namespaces().getProperties(namespace);
+superUserAdmin.namespaces().getProperty(namespace, "key2");
+superUserAdmin.namespaces().removeProperty(namespace, "key2");
+superUserAdmin.namespaces().clearProperties(namespace);
+
+// test tenant manager
+tenantManagerAdmin.namespaces().setProperties(namespace, properties);
+tenantManagerAdmin.namespaces().setProperty(namespace, "key2", 
"value2");
+tenantManagerAdmin.namespaces().getProperties(namespace);
+tenantManagerAdmin.namespaces().getProperty(namespace, "key2");
+tenantManagerAdmin.namespaces().removeProperty(namespace, "key2");
+

(pulsar-site) branch main updated: Fix Cisco case study which seemed like it was a copy of a presentation description (#856)

2024-03-18 Thread penghui
This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
 new 62aaff0e9146 Fix Cisco case study which seemed like it was a copy of a 
presentation description (#856)
62aaff0e9146 is described below

commit 62aaff0e91460fb6c442e861065bad7e03a757f4
Author: Karan Singh Malhi 
AuthorDate: Mon Mar 18 22:29:21 2024 -0700

Fix Cisco case study which seemed like it was a copy of a presentation 
description (#856)
---
 data/case-studies.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/case-studies.ts b/data/case-studies.ts
index 2b9bad6ff5ac..8c3ceaad50f7 100644
--- a/data/case-studies.ts
+++ b/data/case-studies.ts
@@ -69,7 +69,7 @@ export const resources: Record =
   company: "Cisco",
   link: 'https://youtu.be/nNUKnxfJeeo?si=XKzv73RDAzRyWWpQ',
   image: '/img/cisco.svg',
-  description: "Cisco IoT Control Center is among the world's largest IoT 
platforms, with numerous data centers spread across continents, hosting 
thousands of applications for the management of hundreds of millions of IoT 
devices, including connected cars and wireless phones. This presentation 
outlines the two-year process of transforming this platform into a cloud-native 
GitOps platform, where Pulsar is replacing legacy message queue services and is 
deployed across multiple Kubernet [...]
+  description: "Cisco IoT Control Center is among the world's largest IoT 
platforms, with numerous data centers spread across continents, hosting 
thousands of applications for the management of hundreds of millions of IoT 
devices, including connected cars and wireless phones. Cisco underwent a 
two-year process of transforming their platform into a cloud-native GitOps 
platform, where Pulsar replaced legacy message queue services and is deployed 
across multiple Kubernetes clusters."
 },
 {
   company: "Clever Cloud",



Re: [PR] Fix Cisco case study which seemed like it was a copy of a presentation description [pulsar-site]

2024-03-18 Thread via GitHub


codelipenghui merged PR #856:
URL: https://github.com/apache/pulsar-site/pull/856


-- 
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-unsubscr...@pulsar.apache.org

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



[PR] Fix Cisco case study which seemed like it was a copy of a presentation description [pulsar-site]

2024-03-18 Thread via GitHub


kmalhi opened a new pull request, #856:
URL: https://github.com/apache/pulsar-site/pull/856

   ### ✅ Contribution Checklist
   
   
   
   - [ ] I read the [contribution 
guide](https://pulsar.apache.org/contribute/document-contribution/)
   - [ ] I updated the [versioned 
docs](https://pulsar.apache.org/contribute/document-contribution/#update-versioned-docs)
   


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529727988


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+

[I] Add sdkman support [pulsar]

2024-03-18 Thread via GitHub


nodece opened a new issue, #22298:
URL: https://github.com/apache/pulsar/issues/22298

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Motivation
   
   https://sdkman.io/ is a good tool for managing our Java, and when using a 
shell, it automatically loads(sdkman_auto_env=true) the configured version of 
the programming language.
   
   1. Add `.sdkmanrc` to project root
   ```
   java=17.0.10-amzn
   ```
   
   2. Load config
   ```
   $ sdk env
   
   Using java version 17.0.10-amzn in this shell.
   ```
   
   This can maintain JDK version consistency between the development/build 
environment and the CI environment.
   
   ### Solution
   
   _No response_
   
   ### Alternatives
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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-unsubscr...@pulsar.apache.org.apache.org

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



Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529727988


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+

Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529727669


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+

Re: [I] Flaky-test: ExtensibleLoadManagerImplTest.testSplitBundleAdminAPI [pulsar]

2024-03-18 Thread via GitHub


lhotari closed issue #21553: Flaky-test: 
ExtensibleLoadManagerImplTest.testSplitBundleAdminAPI
URL: https://github.com/apache/pulsar/issues/21553


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix] [broker] Close dispatchers stuck due to mismatch between dispatcher.consumerList and dispatcher.consumerSet [pulsar]

2024-03-18 Thread via GitHub


codecov-commenter commented on PR #22270:
URL: https://github.com/apache/pulsar/pull/22270#issuecomment-2005764317

   ## 
[Codecov](https://app.codecov.io/gh/apache/pulsar/pull/22270?dropdown=coverage=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 Report
   Attention: Patch coverage is `92.85714%` with `1 lines` in your changes are 
missing coverage. Please review.
   > Project coverage is 73.65%. Comparing base 
[(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 to head 
[(`b709898`)](https://app.codecov.io/gh/apache/pulsar/pull/22270?dropdown=coverage=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache).
   > Report is 65 commits behind head on master.
   
   Additional details and impacted files
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/pulsar/pull/22270/graphs/tree.svg?width=650=150=pr=acYqCpsK9J_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/22270?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
   
   ```diff
   @@ Coverage Diff  @@
   ## master   #22270  +/-   ##
   
   + Coverage 73.57%   73.65%   +0.07% 
   + Complexity3262432252 -372 
   
 Files  1877 1887  +10 
 Lines139502   139458  -44 
 Branches  1529915294   -5 
   
   + Hits 102638   102714  +76 
   + Misses2890828791 -117 
   + Partials   7956 7953   -3 
   ```
   
   | 
[Flag](https://app.codecov.io/gh/apache/pulsar/pull/22270/flags?src=pr=flags_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[inttests](https://app.codecov.io/gh/apache/pulsar/pull/22270/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `26.89% <50.00%> (+2.30%)` | :arrow_up: |
   | 
[systests](https://app.codecov.io/gh/apache/pulsar/pull/22270/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `24.54% <50.00%> (+0.21%)` | :arrow_up: |
   | 
[unittests](https://app.codecov.io/gh/apache/pulsar/pull/22270/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `72.92% <92.85%> (+0.07%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click 
here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#carryforward-flags-in-the-pull-request-comment)
 to find out more.
   
   | 
[Files](https://app.codecov.io/gh/apache/pulsar/pull/22270?dropdown=coverage=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...sistent/PersistentDispatcherMultipleConsumers.java](https://app.codecov.io/gh/apache/pulsar/pull/22270?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL3BlcnNpc3RlbnQvUGVyc2lzdGVudERpc3BhdGNoZXJNdWx0aXBsZUNvbnN1bWVycy5qYXZh)
 | `74.37% <92.85%> (+0.04%)` | :arrow_up: |
   
   ... and [104 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/pulsar/pull/22270/indirect-changes?src=pr=tree-more_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
   
   


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix] [client] Unclear error message when creating a consumer with two same topics [pulsar]

2024-03-18 Thread via GitHub


poorbarcode commented on code in PR #22255:
URL: https://github.com/apache/pulsar/pull/22255#discussion_r1529701819


##
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##
@@ -165,7 +165,7 @@ public class MultiTopicsConsumerImpl extends 
ConsumerBase {
 return;
 }
 
-checkArgument(topicNamesValid(conf.getTopicNames()), "Topics is 
invalid.");
+checkArgument(topicNamesValid(conf.getTopicNames()), "The param 
[topics] is invalid.");

Review Comment:
   Sure, fixed.



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


codecov-commenter commented on PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#issuecomment-2005754060

   ## 
[Codecov](https://app.codecov.io/gh/apache/pulsar/pull/22292?dropdown=coverage=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 Report
   Attention: Patch coverage is `92.70073%` with `10 lines` in your changes are 
missing coverage. Please review.
   > Project coverage is 73.67%. Comparing base 
[(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 to head 
[(`2039c6a`)](https://app.codecov.io/gh/apache/pulsar/pull/22292?dropdown=coverage=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache).
   > Report is 65 commits behind head on master.
   
   Additional details and impacted files
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/pulsar/pull/22292/graphs/tree.svg?width=650=150=pr=acYqCpsK9J_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/22292?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
   
   ```diff
   @@ Coverage Diff  @@
   ## master   #22292  +/-   ##
   
   + Coverage 73.57%   73.67%   +0.10% 
   - Complexity3262432779 +155 
   
 Files  1877 1887  +10 
 Lines139502   139473  -29 
 Branches  1529915292   -7 
   
   + Hits 102638   102762 +124 
   + Misses2890828749 -159 
   - Partials   7956 7962   +6 
   ```
   
   | 
[Flag](https://app.codecov.io/gh/apache/pulsar/pull/22292/flags?src=pr=flags_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[inttests](https://app.codecov.io/gh/apache/pulsar/pull/22292/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `26.86% <51.09%> (+2.28%)` | :arrow_up: |
   | 
[systests](https://app.codecov.io/gh/apache/pulsar/pull/22292/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `24.42% <6.56%> (+0.09%)` | :arrow_up: |
   | 
[unittests](https://app.codecov.io/gh/apache/pulsar/pull/22292/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `72.95% <92.70%> (+0.10%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click 
here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#carryforward-flags-in-the-pull-request-comment)
 to find out more.
   
   | 
[Files](https://app.codecov.io/gh/apache/pulsar/pull/22292?dropdown=coverage=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...ker/authorization/PulsarAuthorizationProvider.java](https://app.codecov.io/gh/apache/pulsar/pull/22292?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-cHVsc2FyLWJyb2tlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9icm9rZXIvYXV0aG9yaXphdGlvbi9QdWxzYXJBdXRob3JpemF0aW9uUHJvdmlkZXIuamF2YQ==)
 | `68.61% <ø> (ø)` | |
   | 
[.../org/apache/pulsar/broker/admin/AdminResource.java](https://app.codecov.io/gh/apache/pulsar/pull/22292?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9hZG1pbi9BZG1pblJlc291cmNlLmphdmE=)
 | `76.88% <100.00%> (-0.74%)` | :arrow_down: |
   | 
[...pache/pulsar/broker/admin/impl/NamespacesBase.java](https://app.codecov.io/gh/apache/pulsar/pull/22292?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9hZG1pbi9pbXBsL05hbWVzcGFjZXNCYXNlLmphdmE=)
 | `74.63% <100.00%> (+1.55%)` | :arrow_up: |
   | 
[...pulsar/broker/admin/impl/PersistentTopicsBase.java](https://app.codecov.io/gh/apache/pulsar/pull/22292?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9hZG1pbi9pbXBsL1BlcnNpc3RlbnRUb3BpY3NCYXNlLmphdmE=)
 | `65.85% <85.07%> (+0.39%)` | :arrow_up: |
   
   ... and [105 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/pulsar/pull/22292/indirect-changes?src=pr=tree-more_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
   
   


-- 
This is 

Re: [PR] [fix][broker] Fix one potential to add duplicated consumer [pulsar]

2024-03-18 Thread via GitHub


poorbarcode commented on code in PR #20583:
URL: https://github.com/apache/pulsar/pull/20583#discussion_r1529686180


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##
@@ -1184,7 +1184,6 @@ protected void handleSubscribe(final CommandSubscribe 
subscribe) {
 ServerError error = 
getErrorCodeWithErrorLog(existingConsumerFuture, true,
 String.format("Consumer subscribe failure. 
remoteAddress: %s, subscription: %s",
 remoteAddress, subscriptionName));
-consumers.remove(consumerId, existingConsumerFuture);

Review Comment:
   @TakaHiR07 
   
   Could you take a look at this PR https://github.com/apache/pulsar/pull/22283 
, https://github.com/apache/pulsar/pull/22270 and modify the current one? If 
yes, I will close https://github.com/apache/pulsar/pull/22283, 
https://github.com/apache/pulsar/pull/22270 ❤️ 



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix][broker] Fix one potential to add duplicated consumer [pulsar]

2024-03-18 Thread via GitHub


poorbarcode commented on code in PR #20583:
URL: https://github.com/apache/pulsar/pull/20583#discussion_r1529686180


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##
@@ -1184,7 +1184,6 @@ protected void handleSubscribe(final CommandSubscribe 
subscribe) {
 ServerError error = 
getErrorCodeWithErrorLog(existingConsumerFuture, true,
 String.format("Consumer subscribe failure. 
remoteAddress: %s, subscription: %s",
 remoteAddress, subscriptionName));
-consumers.remove(consumerId, existingConsumerFuture);

Review Comment:
   @TakaHiR07 
   
   Could you take a look at this PR https://github.com/apache/pulsar/pull/22283 
and modify the current one? If yes, I will close 
https://github.com/apache/pulsar/pull/22283 ❤️ 



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix][broker] Fix one potential to add duplicated consumer [pulsar]

2024-03-18 Thread via GitHub


poorbarcode commented on code in PR #20583:
URL: https://github.com/apache/pulsar/pull/20583#discussion_r1529686180


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##
@@ -1184,7 +1184,6 @@ protected void handleSubscribe(final CommandSubscribe 
subscribe) {
 ServerError error = 
getErrorCodeWithErrorLog(existingConsumerFuture, true,
 String.format("Consumer subscribe failure. 
remoteAddress: %s, subscription: %s",
 remoteAddress, subscriptionName));
-consumers.remove(consumerId, existingConsumerFuture);

Review Comment:
   @TakaHiR07 
   
   Could you take a look at this PR https://github.com/apache/pulsar/pull/22283 
and modify this one? If yes, I will close 
https://github.com/apache/pulsar/pull/22283 ❤️ 



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix] [broker] fix mismatch between dispatcher.consumerList and dispatcher.consumerSet [pulsar]

2024-03-18 Thread via GitHub


poorbarcode commented on PR #22283:
URL: https://github.com/apache/pulsar/pull/22283#issuecomment-2005736338

   > The same issue with https://github.com/apache/pulsar/pull/20583, right ?
   
   yes.


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529656527


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+Assert.fail("unexpected 

Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529660396


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+Assert.fail("unexpected 

Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529659989


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+Assert.fail("unexpected 

Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529659647


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+Assert.fail("unexpected 

Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529656527


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+Assert.fail("unexpected 

Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529656527


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAuthZTest.java:
##
@@ -0,0 +1,387 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.AuthAction;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TopicAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testUnloadAndCompactAndTrim() {
+final String random = UUID.randomUUID().toString();
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createPartitionedTopic(topic, 2);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+superUserAdmin.topics().unload(topic);
+superUserAdmin.topics().triggerCompaction(topic);
+
superUserAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+superUserAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, 
false);
+
+// test tenant manager
+tenantManagerAdmin.topics().unload(topic);
+tenantManagerAdmin.topics().triggerCompaction(topic);
+
tenantManagerAdmin.topics().trimTopic(TopicName.get(topic).getPartition(0).getLocalName());
+
tenantManagerAdmin.topicPolicies().getSchemaCompatibilityStrategy(topic, false);
+
+// test nobody
+try {
+subAdmin.topics().unload(topic);
+Assert.fail("unexpected 

Re: [PR] [improve][broker] Add missing configuration keys for caching catch-up reads [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on code in PR #22295:
URL: https://github.com/apache/pulsar/pull/22295#discussion_r1529650363


##
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##
@@ -2195,13 +2195,13 @@ The max allowed delay for delayed delivery (in 
milliseconds). If the broker rece
 category = CATEGORY_STORAGE_ML,
 doc = "Minimum backlog entries for any cursor before start caching 
reads"
 )
-private int managedLedgerMinimumBacklogEntriesForCaching = 1000;
+private int managedLedgerMinimumBacklogEntriesForCaching = 100;

Review Comment:
   > make ServiceConfiguration.java defaults match the defaults in broker.conf
   
   Which is the correct value for these two fields?



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add missing configuration keys for caching catch-up reads [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on code in PR #22295:
URL: https://github.com/apache/pulsar/pull/22295#discussion_r1529648938


##
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##
@@ -2195,13 +2195,13 @@ The max allowed delay for delayed delivery (in 
milliseconds). If the broker rece
 category = CATEGORY_STORAGE_ML,
 doc = "Minimum backlog entries for any cursor before start caching 
reads"
 )
-private int managedLedgerMinimumBacklogEntriesForCaching = 1000;
+private int managedLedgerMinimumBacklogEntriesForCaching = 100;

Review Comment:
   This will also make it's value different in ManagedLedgerImpl.
   
(https://github.com/apache/pulsar/blob/8dc9a9b1b4cf960bb868fbea72317c20373d0d72/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L229-L230)



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add missing configuration keys for caching catch-up reads [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on code in PR #22295:
URL: https://github.com/apache/pulsar/pull/22295#discussion_r1529648938


##
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##
@@ -2195,13 +2195,13 @@ The max allowed delay for delayed delivery (in 
milliseconds). If the broker rece
 category = CATEGORY_STORAGE_ML,
 doc = "Minimum backlog entries for any cursor before start caching 
reads"
 )
-private int managedLedgerMinimumBacklogEntriesForCaching = 1000;
+private int managedLedgerMinimumBacklogEntriesForCaching = 100;

Review Comment:
   This will also make it's value different with ManagedLedgerImpl



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add missing configuration keys for caching catch-up reads [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on code in PR #22295:
URL: https://github.com/apache/pulsar/pull/22295#discussion_r1529646971


##
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##
@@ -2195,13 +2195,13 @@ The max allowed delay for delayed delivery (in 
milliseconds). If the broker rece
 category = CATEGORY_STORAGE_ML,
 doc = "Minimum backlog entries for any cursor before start caching 
reads"
 )
-private int managedLedgerMinimumBacklogEntriesForCaching = 1000;
+private int managedLedgerMinimumBacklogEntriesForCaching = 100;

Review Comment:
   Why do you change here ? 



##
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##
@@ -2195,13 +2195,13 @@ The max allowed delay for delayed delivery (in 
milliseconds). If the broker rece
 category = CATEGORY_STORAGE_ML,
 doc = "Minimum backlog entries for any cursor before start caching 
reads"
 )
-private int managedLedgerMinimumBacklogEntriesForCaching = 1000;
+private int managedLedgerMinimumBacklogEntriesForCaching = 100;
 @FieldContext(
 dynamic = true,
 category = CATEGORY_STORAGE_ML,
 doc = "Maximum backlog entry difference to prevent caching entries 
that can't be reused"
 )
-private int managedLedgerMaxBacklogBetweenCursorsForCaching = 1000;
+private int managedLedgerMaxBacklogBetweenCursorsForCaching = 1;

Review Comment:
   And here



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529648031


##
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespaceAuthZTest.java:
##
@@ -0,0 +1,159 @@
+/*
+ * 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.broker.admin;
+
+import io.jsonwebtoken.Jwts;
+import lombok.Cleanup;
+import lombok.SneakyThrows;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.client.impl.auth.AuthenticationToken;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.security.MockedPulsarStandalone;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+public class NamespaceAuthZTest extends MockedPulsarStandalone {
+
+private PulsarAdmin superUserAdmin;
+
+private PulsarAdmin tenantManagerAdmin;
+
+private static final String TENANT_ADMIN_SUBJECT =  
UUID.randomUUID().toString();
+private static final String TENANT_ADMIN_TOKEN = Jwts.builder()
+.claim("sub", TENANT_ADMIN_SUBJECT).signWith(SECRET_KEY).compact();
+
+@SneakyThrows
+@BeforeClass
+public void before() {
+configureTokenAuthentication();
+configureDefaultAuthorization();
+start();
+this.superUserAdmin =PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(SUPER_USER_TOKEN))
+.build();
+final TenantInfo tenantInfo = 
superUserAdmin.tenants().getTenantInfo("public");
+tenantInfo.getAdminRoles().add(TENANT_ADMIN_SUBJECT);
+superUserAdmin.tenants().updateTenant("public", tenantInfo);
+this.tenantManagerAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(TENANT_ADMIN_TOKEN))
+.build();
+}
+
+
+@SneakyThrows
+@AfterClass
+public void after() {
+if (superUserAdmin != null) {
+superUserAdmin.close();
+}
+if (tenantManagerAdmin != null) {
+tenantManagerAdmin.close();
+}
+close();
+}
+
+
+@SneakyThrows
+@Test
+public void testProperties() {
+final String random = UUID.randomUUID().toString();
+final String namespace = "public/default";
+final String topic = "persistent://public/default/" + random;
+final String subject =  UUID.randomUUID().toString();
+final String token = Jwts.builder()
+.claim("sub", subject).signWith(SECRET_KEY).compact();
+superUserAdmin.topics().createNonPartitionedTopic(topic);
+
+@Cleanup
+final PulsarAdmin subAdmin = PulsarAdmin.builder()
+.serviceHttpUrl(getPulsarService().getWebServiceAddress())
+.authentication(new AuthenticationToken(token))
+.build();
+// test superuser
+Map properties = new HashMap<>();
+properties.put("key1", "value1");
+superUserAdmin.namespaces().setProperties(namespace, properties);
+superUserAdmin.namespaces().setProperty(namespace, "key2", "value2");
+superUserAdmin.namespaces().getProperties(namespace);
+superUserAdmin.namespaces().getProperty(namespace, "key2");
+superUserAdmin.namespaces().removeProperty(namespace, "key2");
+superUserAdmin.namespaces().clearProperties(namespace);
+
+// test tenant manager
+tenantManagerAdmin.namespaces().setProperties(namespace, properties);
+tenantManagerAdmin.namespaces().setProperty(namespace, "key2", 
"value2");
+tenantManagerAdmin.namespaces().getProperties(namespace);
+tenantManagerAdmin.namespaces().getProperty(namespace, "key2");
+tenantManagerAdmin.namespaces().removeProperty(namespace, "key2");
+

(pulsar-client-python) branch merlimat-patch-1 deleted (was ceb2a63)

2024-03-18 Thread xyz
This is an automated email from the ASF dual-hosted git repository.

xyz pushed a change to branch merlimat-patch-1
in repository https://gitbox.apache.org/repos/asf/pulsar-client-python.git


 was ceb2a63  Merge branch 'main' into merlimat-patch-1

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(pulsar-client-python) branch main updated: Enable CodeQL static scanner (#197)

2024-03-18 Thread xyz
This is an automated email from the ASF dual-hosted git repository.

xyz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-client-python.git


The following commit(s) were added to refs/heads/main by this push:
 new 1aca467  Enable CodeQL static scanner (#197)
1aca467 is described below

commit 1aca467ee4a7ec8d4ef3249e45bf5dfc03db411a
Author: Matteo Merli 
AuthorDate: Mon Mar 18 20:30:52 2024 -0700

Enable CodeQL static scanner (#197)

Co-authored-by: Yunze Xu 
---
 .github/workflows/codeql.yml | 80 
 1 file changed, 80 insertions(+)

diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 000..f9e45f6
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,80 @@
+#
+# 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.
+#
+
+name: "CodeQL"
+
+on:
+  push:
+branches: [ "main" ]
+  pull_request:
+branches: [ "main" ]
+  schedule:
+- cron: '27 21 * * 6'
+
+jobs:
+  analyze:
+name: Analyze
+runs-on: 'ubuntu-latest'
+timeout-minutes: 360
+permissions:
+  # required for all workflows
+  security-events: write
+
+  # only required for workflows in private repositories
+  actions: read
+  contents: read
+
+strategy:
+  fail-fast: false
+  matrix:
+language: [ 'c-cpp', 'python' ]
+
+steps:
+- name: Checkout repository
+  uses: actions/checkout@v4
+
+# Initializes the CodeQL tools for scanning.
+- name: Initialize CodeQL
+  uses: github/codeql-action/init@v3
+  with:
+languages: ${{ matrix.language }}
+# If you wish to specify custom queries, you can do so here or in a 
config file.
+# By default, queries listed here will override any specified in a 
config file.
+# Prefix the list here with "+" to use these queries and those in the 
config file.
+
+# For more details on CodeQL's query packs, refer to: 
https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+# queries: security-extended,security-and-quality
+
+- uses: actions/setup-python@v5
+  with:
+python-version: "3.12"
+
+- name: Install Pulsar C++ client
+  run: build-support/install-dependencies.sh
+
+- name: CMake
+  run: cmake .
+
+- name: Build
+  run: make -j8
+
+- name: Perform CodeQL Analysis
+  uses: github/codeql-action/analyze@v3
+  with:
+category: "/language:${{matrix.language}}"



Re: [PR] Enable CodeQL static scanner [pulsar-client-python]

2024-03-18 Thread via GitHub


BewareMyPower merged PR #197:
URL: https://github.com/apache/pulsar-client-python/pull/197


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529633681


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##
@@ -2411,14 +2408,13 @@ private void 
internalCreateSubscriptionForNonPartitionedTopic(
 protected void internalUpdateSubscriptionProperties(AsyncResponse 
asyncResponse, String subName,
 Map 
subscriptionProperties,
 boolean authoritative) 
{
-CompletableFuture future;
-if (topicName.isGlobal()) {
-future = validateGlobalNamespaceOwnershipAsync(namespaceName);
-} else {
-future = CompletableFuture.completedFuture(null);
-}
-
-future.thenCompose(__ -> validateTopicOwnershipAsync(topicName, 
authoritative)).thenAccept(__ -> {
+CompletableFuture future = 
validateTopicOperationAsync(topicName, TopicOperation.CONSUME, subName);

Review Comment:
   `SUBSCRIBE` looks better.



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Add fine-grain authorization to ns/topic management endpoints [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22292:
URL: https://github.com/apache/pulsar/pull/22292#discussion_r1529633681


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##
@@ -2411,14 +2408,13 @@ private void 
internalCreateSubscriptionForNonPartitionedTopic(
 protected void internalUpdateSubscriptionProperties(AsyncResponse 
asyncResponse, String subName,
 Map 
subscriptionProperties,
 boolean authoritative) 
{
-CompletableFuture future;
-if (topicName.isGlobal()) {
-future = validateGlobalNamespaceOwnershipAsync(namespaceName);
-} else {
-future = CompletableFuture.completedFuture(null);
-}
-
-future.thenCompose(__ -> validateTopicOwnershipAsync(topicName, 
authoritative)).thenAccept(__ -> {
+CompletableFuture future = 
validateTopicOperationAsync(topicName, TopicOperation.CONSUME, subName);

Review Comment:
   `SUBSCRIBE` looks better.



-- 
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-unsubscr...@pulsar.apache.org

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



(pulsar-client-python) branch merlimat-patch-1 updated (995ba36 -> ceb2a63)

2024-03-18 Thread xyz
This is an automated email from the ASF dual-hosted git repository.

xyz pushed a change to branch merlimat-patch-1
in repository https://gitbox.apache.org/repos/asf/pulsar-client-python.git


from 995ba36  Enable CodeQL static scanner
 add 865bc9d  Disable topic level policies to make tests work for latest 
Pulsar (#201)
 add 48be179  Fix incorrect logs when a message failed to be decoded with 
the writer schema (#200)
 add ceb2a63  Merge branch 'main' into merlimat-patch-1

No new revisions were added by this update.

Summary of changes:
 pulsar/schema/schema_avro.py| 3 ++-
 tests/test-conf/standalone-ssl.conf | 5 +
 2 files changed, 7 insertions(+), 1 deletion(-)



Re: [PR] [cleanup][meta] Remove com.beust.jcommander.internal import [pulsar]

2024-03-18 Thread via GitHub


nodece merged PR #22294:
URL: https://github.com/apache/pulsar/pull/22294


-- 
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-unsubscr...@pulsar.apache.org

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



(pulsar) branch master updated: [cleanup][meta] Remove com.beust.jcommander.internal import (#22294)

2024-03-18 Thread zixuan
This is an automated email from the ASF dual-hosted git repository.

zixuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new 8dc9a9b1b4c [cleanup][meta] Remove com.beust.jcommander.internal 
import (#22294)
8dc9a9b1b4c is described below

commit 8dc9a9b1b4cf960bb868fbea72317c20373d0d72
Author: Zixuan Liu 
AuthorDate: Tue Mar 19 10:40:06 2024 +0800

[cleanup][meta] Remove com.beust.jcommander.internal import (#22294)
---
 .../bookkeeper/replication/AuditorBookieCheckTaskTest.java | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/pulsar-metadata/src/test/java/org/apache/bookkeeper/replication/AuditorBookieCheckTaskTest.java
 
b/pulsar-metadata/src/test/java/org/apache/bookkeeper/replication/AuditorBookieCheckTaskTest.java
index d30af4de6a8..d151226992f 100644
--- 
a/pulsar-metadata/src/test/java/org/apache/bookkeeper/replication/AuditorBookieCheckTaskTest.java
+++ 
b/pulsar-metadata/src/test/java/org/apache/bookkeeper/replication/AuditorBookieCheckTaskTest.java
@@ -29,9 +29,9 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static org.testng.AssertJUnit.assertTrue;
-import com.beust.jcommander.internal.Lists;
-import com.beust.jcommander.internal.Sets;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -122,8 +122,8 @@ public class AuditorBookieCheckTaskTest {
 OpStatsLogger numUnderReplicatedLedgerStats = 
mock(OpStatsLogger.class);
 
when(auditorStats.getNumUnderReplicatedLedger()).thenReturn(numUnderReplicatedLedgerStats);
 
-final List availableBookies = Lists.newArrayList();
-final List readOnlyBookies = Lists.newArrayList();
+final List availableBookies = new ArrayList<>();
+final List readOnlyBookies = new ArrayList<>();
 // test bookie1 lost
 availableBookies.add(BookieId.parse(bookieId2));
 when(admin.getAvailableBookies()).thenReturn(availableBookies);
@@ -144,7 +144,7 @@ public class AuditorBookieCheckTaskTest {
 }
 
 private Set getLedgers(long count) {
-final Set ledgers = Sets.newHashSet();
+final Set ledgers = new HashSet<>();
 for (int i = 0; i < count; i++) {
 ledgers.add(i + startLedgerId++);
 }



Re: [PR] [cleanup][meta] Remove com.beust.jcommander.internal import [pulsar]

2024-03-18 Thread via GitHub


codecov-commenter commented on PR #22294:
URL: https://github.com/apache/pulsar/pull/22294#issuecomment-2005622643

   ## 
[Codecov](https://app.codecov.io/gh/apache/pulsar/pull/22294?dropdown=coverage=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 73.66%. Comparing base 
[(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 to head 
[(`d203098`)](https://app.codecov.io/gh/apache/pulsar/pull/22294?dropdown=coverage=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache).
   > Report is 64 commits behind head on master.
   
   Additional details and impacted files
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/pulsar/pull/22294/graphs/tree.svg?width=650=150=pr=acYqCpsK9J_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/22294?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
   
   ```diff
   @@ Coverage Diff  @@
   ## master   #22294  +/-   ##
   
   + Coverage 73.57%   73.66%   +0.09% 
   - Complexity3262432744 +120 
   
 Files  1877 1887  +10 
 Lines139502   139453  -49 
 Branches  1529915293   -6 
   
   + Hits 102638   102731  +93 
   + Misses2890828761 -147 
   - Partials   7956 7961   +5 
   ```
   
   | 
[Flag](https://app.codecov.io/gh/apache/pulsar/pull/22294/flags?src=pr=flags_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[inttests](https://app.codecov.io/gh/apache/pulsar/pull/22294/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `26.92% <ø> (+2.33%)` | :arrow_up: |
   | 
[systests](https://app.codecov.io/gh/apache/pulsar/pull/22294/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `24.68% <ø> (+0.35%)` | :arrow_up: |
   | 
[unittests](https://app.codecov.io/gh/apache/pulsar/pull/22294/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `72.90% <ø> (+0.06%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click 
here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#carryforward-flags-in-the-pull-request-comment)
 to find out more.
   
   [see 106 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/pulsar/pull/22294/indirect-changes?src=pr=tree-more_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
   
   


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [cleanup][meta] Remove com.beust.jcommander.internal import [pulsar]

2024-03-18 Thread via GitHub


nodece commented on PR #22294:
URL: https://github.com/apache/pulsar/pull/22294#issuecomment-2005537875

   /pulsarbot rerun-failure-checks


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] Add support for HasMessageAvailable [pulsar-dotpulsar]

2024-03-18 Thread via GitHub


smbecker commented on code in PR #207:
URL: https://github.com/apache/pulsar-dotpulsar/pull/207#discussion_r1529526379


##
src/DotPulsar/Internal/ConsumerChannel.cs:
##
@@ -70,6 +70,29 @@ public sealed class ConsumerChannel : 
IConsumerChannel
 _firstFlow = true;
 }
 
+public async ValueTask HasMessageAvailable(CancellationToken 
cancellationToken)
+{
+using (await _lock.Lock(cancellationToken).ConfigureAwait(false))
+{
+if (HasMessageQueued())
+{
+return true;
+}
+
+if (_sendWhenZero == 0)

Review Comment:
   I don't know how I feel about this implementation. The Java Client leverages 
a cached MessageId for the [last dequeued 
message](https://github.com/apache/pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L2390)
 but that doesn't seem available here unless changes were made to `Receive`, 
which I was trying to avoid. Any thoughts on how to improve? 



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [cleanup][meta] Remove com.beust.jcommander.internal import [pulsar]

2024-03-18 Thread via GitHub


nodece commented on PR #22294:
URL: https://github.com/apache/pulsar/pull/22294#issuecomment-2005368527

   pulsarbot rerun-failure-checks


-- 
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-unsubscr...@pulsar.apache.org

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



[PR] Add support for HasMessageAvailable [pulsar-dotpulsar]

2024-03-18 Thread via GitHub


smbecker opened a new pull request, #207:
URL: https://github.com/apache/pulsar-dotpulsar/pull/207

   Fixes #206
   
   # Description
   
   Add `IReceive.HasMessageAvailable` to allow a consumer to check if any 
messages could be received or not.


-- 
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-unsubscr...@pulsar.apache.org

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



[I] Support HasMessageAvailable [pulsar-dotpulsar]

2024-03-18 Thread via GitHub


smbecker opened a new issue, #206:
URL: https://github.com/apache/pulsar-dotpulsar/issues/206

   ### Is your feature request related to a problem? Please describe
   
   Given that `Receive` will block until a message is available or until a 
timeout occurs, it is pretty typical to want to check if a message is available 
before calling `Receive`. This is something already supported by the [Java 
API](https://pulsar.apache.org/api/client/3.1.x/org/apache/pulsar/client/api/Reader.html#hasMessageAvailableAsync()).
   
   ### Describe the solution you'd like and alternatives you've considered
   
   Provide an implementation of `HasMessageAvailable` that will determine if a 
message can be immediately received or not.


-- 
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-unsubscr...@pulsar.apache.org.apache.org

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



Re: [PR] Add DockerHub repo link to downloads page [pulsar-site]

2024-03-18 Thread via GitHub


visortelle commented on PR #855:
URL: https://github.com/apache/pulsar-site/pull/855#issuecomment-2004630676

   https://github.com/apache/pulsar-site/assets/9302460/3ded1654-b390-4a91-97c2-a4f62989056e;>
   


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [I] [Doc] Add link to Docker Hub images to Pulsar website download page [pulsar]

2024-03-18 Thread via GitHub


visortelle commented on issue #22276:
URL: https://github.com/apache/pulsar/issues/22276#issuecomment-2004629365

   Resolved: https://github.com/apache/pulsar-site/pull/855


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [I] [Doc] Add link to Docker Hub images to Pulsar website download page [pulsar]

2024-03-18 Thread via GitHub


visortelle closed issue #22276: [Doc] Add link to Docker Hub images to Pulsar 
website download page
URL: https://github.com/apache/pulsar/issues/22276


-- 
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-unsubscr...@pulsar.apache.org

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



(pulsar-site) branch main updated: Add DockerHub repo link to downloads page (#855)

2024-03-18 Thread visortelle
This is an automated email from the ASF dual-hosted git repository.

visortelle pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
 new c8378fc3b0ce Add DockerHub repo link to downloads page (#855)
c8378fc3b0ce is described below

commit c8378fc3b0ce508ef68e4aa65a468b4b34b0d571
Author: Kiryl Valkovich  
AuthorDate: Mon Mar 18 22:20:01 2024 +0400

Add DockerHub repo link to downloads page (#855)

* Add DockerHub repo link to downloads page

* Update src/pages/download.mdx

Co-authored-by: Lari Hotari 

-

Co-authored-by: Lari Hotari 
---
 src/pages/download.mdx | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/pages/download.mdx b/src/pages/download.mdx
index ea0a6c047f04..6f15a526ae8b 100644
--- a/src/pages/download.mdx
+++ b/src/pages/download.mdx
@@ -37,6 +37,16 @@ import SupportedVersionsTable from 
"@site/src/components/SupportedVersionsTable"
 - [All Versions Schedule](pathname:///contribute/release-policy)
 - [Release notes](pathname:///release-notes)
 
+## Container Image
+
+Pulsar is also available as a container image:
+
+- [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
+
+The container image can be used with Docker or Kubernetes:
+
+- [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
+- [Apache Pulsar Helm Chart](https://github.com/apache/pulsar-helm-chart/)
 ## Current version 
 
 You can download all previous versions of Pulsar at [the archive 
page](https://archive.apache.org/dist/pulsar/).



Re: [PR] Add DockerHub repo link to downloads page [pulsar-site]

2024-03-18 Thread via GitHub


visortelle merged PR #855:
URL: https://github.com/apache/pulsar-site/pull/855


-- 
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-unsubscr...@pulsar.apache.org

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



(pulsar-site) branch docker-on-download-page updated (d89350134a47 -> d597b986ad02)

2024-03-18 Thread visortelle
This is an automated email from the ASF dual-hosted git repository.

visortelle pushed a change to branch docker-on-download-page
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


from d89350134a47 Add DockerHub repo link to downloads page
 add d597b986ad02 Update src/pages/download.mdx

No new revisions were added by this update.

Summary of changes:
 src/pages/download.mdx | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)



Re: [PR] Add DockerHub repo link to downloads page [pulsar-site]

2024-03-18 Thread via GitHub


lhotari commented on code in PR #855:
URL: https://github.com/apache/pulsar-site/pull/855#discussion_r1529031430


##
src/pages/download.mdx:
##
@@ -37,6 +37,13 @@ import SupportedVersionsTable from 
"@site/src/components/SupportedVersionsTable"
 - [All Versions Schedule](pathname:///contribute/release-policy)
 - [Release notes](pathname:///release-notes)
 
+## Docker Image
+
+The recommended way to run Pulsar is to use it as a Docker container.
+
+- [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
+- [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
+

Review Comment:
   ```suggestion
   ## Container Image
   
   Pulsar is also available as a container image:
   
   - [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
   
   The container image can be used with Docker or Kubernetes:
   
   - [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
   - [Apache Pulsar Helm Chart for 
Kubernetes](https://github.com/apache/pulsar-helm-chart/)
   ```



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] Add DockerHub repo link to downloads page [pulsar-site]

2024-03-18 Thread via GitHub


lhotari commented on code in PR #855:
URL: https://github.com/apache/pulsar-site/pull/855#discussion_r1529031430


##
src/pages/download.mdx:
##
@@ -37,6 +37,13 @@ import SupportedVersionsTable from 
"@site/src/components/SupportedVersionsTable"
 - [All Versions Schedule](pathname:///contribute/release-policy)
 - [Release notes](pathname:///release-notes)
 
+## Docker Image
+
+The recommended way to run Pulsar is to use it as a Docker container.
+
+- [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
+- [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
+

Review Comment:
   ```suggestion
   ## Container Image
   
   Pulsar is also available as a container image:
   
   - [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
   
   The container image can be used with Docker or Kubernetes:
   
   - [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
   - [Apache Pulsar Helm Chart](https://github.com/apache/pulsar-helm-chart/)
   ```



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] Add DockerHub repo link to downloads page [pulsar-site]

2024-03-18 Thread via GitHub


lhotari commented on code in PR #855:
URL: https://github.com/apache/pulsar-site/pull/855#discussion_r1529031430


##
src/pages/download.mdx:
##
@@ -37,6 +37,13 @@ import SupportedVersionsTable from 
"@site/src/components/SupportedVersionsTable"
 - [All Versions Schedule](pathname:///contribute/release-policy)
 - [Release notes](pathname:///release-notes)
 
+## Docker Image
+
+The recommended way to run Pulsar is to use it as a Docker container.
+
+- [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
+- [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
+

Review Comment:
   ```suggestion
   ## Container Image
   
   Pulsar is also available as a container image:
   
   - [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
   
   The container image can be used with Docker or Kubernetes:
   
   - [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
   - [Apache Pulsar Helmchart](https://github.com/apache/pulsar-helm-chart/)
   ```



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] Add DockerHub repo link to downloads page [pulsar-site]

2024-03-18 Thread via GitHub


lhotari commented on code in PR #855:
URL: https://github.com/apache/pulsar-site/pull/855#discussion_r1529031430


##
src/pages/download.mdx:
##
@@ -37,6 +37,13 @@ import SupportedVersionsTable from 
"@site/src/components/SupportedVersionsTable"
 - [All Versions Schedule](pathname:///contribute/release-policy)
 - [Release notes](pathname:///release-notes)
 
+## Docker Image
+
+The recommended way to run Pulsar is to use it as a Docker container.
+
+- [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
+- [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
+

Review Comment:
   ```suggestion
   ## Container Image
   
   Pulsar is also available as a container image.
   - [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
   
   The container image can be used with Docker and Kubernetes:
   - [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
   - [Apache Pulsar Helmchart](https://github.com/apache/pulsar-helm-chart/)
   ```



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] Add DockerHub repo link to downloads page [pulsar-site]

2024-03-18 Thread via GitHub


visortelle commented on PR #855:
URL: https://github.com/apache/pulsar-site/pull/855#issuecomment-2004522619

   Maybe add a link to https://github.com/apache/pulsar-helm-chart too?
   
   https://github.com/apache/pulsar-site/assets/9302460/755b5705-d36b-494e-a48e-ad278774960a;>
   


-- 
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-unsubscr...@pulsar.apache.org

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



[PR] Add DockerHub repo link to downloads page [pulsar-site]

2024-03-18 Thread via GitHub


visortelle opened a new pull request, #855:
URL: https://github.com/apache/pulsar-site/pull/855

   https://github.com/apache/pulsar-site/assets/9302460/474047cb-801a-4d87-99cb-84271039a3bf;>
   
   
   Ref: https://github.com/apache/pulsar/issues/22276
   


-- 
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-unsubscr...@pulsar.apache.org

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



(pulsar-site) 01/01: Add DockerHub repo link to downloads page

2024-03-18 Thread visortelle
This is an automated email from the ASF dual-hosted git repository.

visortelle pushed a commit to branch docker-on-download-page
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit d89350134a473d8bd93c9ca7a6caa132f976557c
Author: visortelle 
AuthorDate: Mon Mar 18 21:23:18 2024 +0400

Add DockerHub repo link to downloads page
---
 src/pages/download.mdx | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/pages/download.mdx b/src/pages/download.mdx
index ea0a6c047f04..a17bc7174928 100644
--- a/src/pages/download.mdx
+++ b/src/pages/download.mdx
@@ -37,6 +37,13 @@ import SupportedVersionsTable from 
"@site/src/components/SupportedVersionsTable"
 - [All Versions Schedule](pathname:///contribute/release-policy)
 - [Release notes](pathname:///release-notes)
 
+## Docker Image
+
+The recommended way to run Pulsar is to use it as a Docker container.
+
+- [DockerHub Repository](https://hub.docker.com/r/apachepulsar/pulsar)
+- [Run a standalone Pulsar cluster in Docker 
](https://pulsar.apache.org/docs/next/getting-started-docker/)
+
 ## Current version 
 
 You can download all previous versions of Pulsar at [the archive 
page](https://archive.apache.org/dist/pulsar/).



(pulsar-site) branch docker-on-download-page created (now d89350134a47)

2024-03-18 Thread visortelle
This is an automated email from the ASF dual-hosted git repository.

visortelle pushed a change to branch docker-on-download-page
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


  at d89350134a47 Add DockerHub repo link to downloads page

This branch includes the following new commits:

 new d89350134a47 Add DockerHub repo link to downloads page

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[I] Deployment using JWT authentication is not working properly [pulsar-helm-chart]

2024-03-18 Thread via GitHub


Mortom123 opened a new issue, #472:
URL: https://github.com/apache/pulsar-helm-chart/issues/472

   **Describe the bug**
   Deploying Pulsar with JWT-Authentication enabled is impossible for me. Would 
be very glad for any advice :)
   
   I populated the key for JWT authentification using this script (basically a 
very shortened `prepare_pulsar_release.sh` script using StreamNative's 
pulsarctl:
   ```
   set -e
   
   SCRIPT_DIR=$(dirname $0)
   PULSAR_CTL=${SCRIPT_DIR}/pulsarctl
   echo $SCRIPT_DIR
   ls $SCRIPT_DIR
   chmod +x "$PULSAR_CTL"
   
   usage() {
   cat < ${tmpfile}"
   kubectl get -n ${namespace} secrets ${secret_name} -o 
jsonpath="{.data['${type}']}" | base64 --decode > ${tmpfile}
   fi
   }
   
   function pulsar::jwt::generate_asymmetric_token() {
   role=$1
   echo "${role}"
   local token_name="${release}-token-${role}"
   local secret_name="${release}-token-asymmetric-key"
   
   privatekeytmpfile=$(mktemp)
   trap "test -f $privatekeytmpfile && rm $privatekeytmpfile" RETURN
   tokentmpfile=$(mktemp)
   trap "test -f $tokentmpfile && rm $tokentmpfile" RETURN
   pulsar::jwt::get_secret PRIVATEKEY ${privatekeytmpfile} ${secret_name}
   ${PULSAR_CTL} token create -a RS256 --private-key-file 
${privatekeytmpfile} --subject ${role} 2&> ${tokentmpfile}
   newtokentmpfile=$(mktemp)
   tr -d '\n' < ${tokentmpfile} > ${newtokentmpfile}
   kubectl create secret generic ${token_name} -n ${namespace} 
--from-file="TOKEN=${newtokentmpfile}" --from-literal="TYPE=asymmetric"
   }
   
   pulsar::jwt::generate_asymmetric_key_secret
   
   IFS=', ' read -r -a superusers <<< "$pulsar_superusers"
   for user in "${superusers[@]}"
   do
   echo "generate the token for $user" >&2
   pulsar::jwt::generate_asymmetric_token $user
   done
   ```
   
   `values.yaml` auth section is set to:
   ```
   # Enable or disable broker authentication and authorization.
   auth:
 authentication:
   enabled: true
   provider: "jwt"
   jwt:
 # Enable JWT authentication
 # If the token is generated by a secret key, set the usingSecretKey as 
true.
 # If the token is generated by a private key, set the usingSecretKey 
as false.
 usingSecretKey: false
 authorization:
   enabled: true
 superUsers:
   # broker to broker communication
   broker: "broker-admin"
   # proxy to broker communication
   proxy: "proxy-admin"
   # pulsar-admin client to broker/proxy communication
   client: "admin"
   ```
   
   
   This results in the following error:
   ```
   at 
org.apache.pulsar.broker.PulsarService.startWorkerService(PulsarService.java:1624)
 ~[org.apache.pulsar-pulsar-broker-2.10.4.jar:2.10.4]
   2024-03-18T16:18:13.576164634Z   at 
org.apache.pulsar.broker.PulsarService.start(PulsarService.java:808) 
~[org.apache.pulsar-pulsar-broker-2.10.4.jar:2.10.4]
... 2 more
Suppressed: 
org.apache.pulsar.client.admin.PulsarAdminException$NotAuthorizedException: 
HTTP 401 Unauthorized
at 
org.apache.pulsar.client.admin.internal.BaseResource.getApiException(BaseResource.java:232)
 ~[org.apache.pulsar-pulsar-client-admin-original-2.10.4.jar:2.10.4]
   ```
   
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Download release 2.10.4
   2. Enable auth in `values.yaml`
   3. Use the script together with [pulsarctl 
](https://github.com/streamnative/pulsarctl) to generate a pair of asymmetric 
keys and tokens, Put the `pulsarctl` as a sibling of the script and run: 
`generate_secrets.sh --namespace pulsar --release pulsar --pulsar_superusers 
proxy-admin,broker-admin,admin`
   4. `helm install -n pulsar ...`
   
   **Expected behavior**
   I expect the helm chart to install successfully with no errors on side of 
the broker. 
   
   
   **Additional context**
   I am using an older version of the helm-chart (2.10.4)
   


-- 
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-unsubscr...@pulsar.apache.org.apache.org

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



Re: [I] Flaky-test: ExtensibleLoadManagerTest.testStopBroker [pulsar]

2024-03-18 Thread via GitHub


lhotari commented on issue #21555:
URL: https://github.com/apache/pulsar/issues/21555#issuecomment-2004362617

   fixed by #21811


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [I] Flaky-test: ExtensibleLoadManagerTest.testStopBroker [pulsar]

2024-03-18 Thread via GitHub


lhotari closed issue #21555: Flaky-test: 
ExtensibleLoadManagerTest.testStopBroker
URL: https://github.com/apache/pulsar/issues/21555


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Remove the atomicity on active consumer of a dispatcher [pulsar]

2024-03-18 Thread via GitHub


Technoboy- closed pull request #22285: [improve][broker] Remove the atomicity 
on active consumer of a dispatcher
URL: https://github.com/apache/pulsar/pull/22285


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix] [broker] Close dispatchers stuck due to mismatch between dispatcher.consumerList and dispatcher.consumerSet [pulsar]

2024-03-18 Thread via GitHub


poorbarcode commented on code in PR #22270:
URL: https://github.com/apache/pulsar/pull/22270#discussion_r1528815436


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##
@@ -214,18 +214,10 @@ public synchronized void removeConsumer(Consumer 
consumer) throws BrokerServiceE
 // decrement unack-message count for removed consumer
 addUnAckedMessages(-consumer.getUnackedMessages());
 if (consumerSet.removeAll(consumer) == 1) {

Review Comment:
   > Is there a need to continue to have conditional logic based on this?
   
   Good question, I think this conditional logic is still needed.
   
   There are other operations after removing a consumer success:
   - Move the pending acked messages into `redeliveryMessages`
   - Update `totalAvailablePermits`
   - Trigger a `readMoreEntries`
   
   For the scenario that `consumerList` has two same consumer, and 
`consumerSet` only has one, the method `removeConsumer` will be called by 
`dispatcher.disconnectAllConsumers` twice, but the broker should only trigger 
the operations above once.



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix][broker] Fix wrong double-checked locking for readOnActiveConsumerTask in dispatcher [pulsar]

2024-03-18 Thread via GitHub


lhotari commented on PR #22279:
URL: https://github.com/apache/pulsar/pull/22279#issuecomment-2004271355

   > Generally, developers assume all methods must be thread safe so the code 
might become unnecessarily complicated.
   
   @BewareMyPower I agree that generalizing thread safety to a certain style in 
the Pulsar code base won't be very useful. However there are real problems 
where thread safety has been ignored and fixing the issues isn't prioritized. 
For example the topic level policies contain real problems, #21303. 


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix][broker] Fix wrong double-checked locking for readOnActiveConsumerTask in dispatcher [pulsar]

2024-03-18 Thread via GitHub


lhotari commented on PR #22279:
URL: https://github.com/apache/pulsar/pull/22279#issuecomment-2004253512

   > @lhotari This PR is merged too quickly without a 2nd review. After 
revisiting the code, I found the double-checked locking is unnecessary.
   
   @BewareMyPower We don't have a policy that there should be a 2nd review. 
This PR didn't contain any risky changes and wasn't harmful at all and that's 
why I merged. It's better to keep on moving instead of optimizing for perfect 
PRs. The resolution that you have done is a good one: opening another PR with 
follow-up changes.


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix] [broker] Close dispatchers stuck due to mismatch between dispatcher.consumerList and dispatcher.consumerSet [pulsar]

2024-03-18 Thread via GitHub


lhotari commented on code in PR #22270:
URL: https://github.com/apache/pulsar/pull/22270#discussion_r1528791463


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##
@@ -214,18 +214,10 @@ public synchronized void removeConsumer(Consumer 
consumer) throws BrokerServiceE
 // decrement unack-message count for removed consumer
 addUnAckedMessages(-consumer.getUnackedMessages());
 if (consumerSet.removeAll(consumer) == 1) {

Review Comment:
   Is there a need to continue to have conditional logic based on this?



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [D] Geo-Replication: how to sync topics and policies between clusters [pulsar]

2024-03-18 Thread via GitHub


GitHub user asafm added a comment to the discussion: Geo-Replication: how to 
sync topics and policies between clusters

>From my understanding there is a central Configuration Store - i.e. a single 
>shared ZK - which stores the metadata of topics/namespaces/tenants. You should 
>configure both clusters to use the same configuration store (ZK). So one ZK 
>(metadata) per cluster and one shared ZK (configuration store)

GitHub link: 
https://github.com/apache/pulsar/discussions/22278#discussioncomment-8829254


This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscr...@pulsar.apache.org



(pulsar) branch branch-3.2 updated: [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)

2024-03-18 Thread lhotari
This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
 new 0918288250a [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)
0918288250a is described below

commit 0918288250ae8195ef0a9b7e3eef9c93fd2c2b3e
Author: Zixuan Liu 
AuthorDate: Mon Mar 18 21:37:03 2024 +0800

[improve][misc] Upgrade checkstyle to 10.14.2 (#22291)

(cherry picked from commit cd512e4da6a04c68d448a452c76b10b49014033d)
---
 buildtools/pom.xml   |  2 +-
 buildtools/src/main/resources/pulsar/checkstyle.xml  |  2 +-
 pom.xml  |  2 +-
 .../broker/service/persistent/PersistentTopic.java   |  4 ++--
 .../java/org/apache/pulsar/client/impl/ProducerImpl.java |  6 +++---
 .../org/apache/pulsar/common/tls/InetAddressUtils.java   | 16 +---
 .../pulsar/common/util/collections/LongPairSet.java  |  4 ++--
 7 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/buildtools/pom.xml b/buildtools/pom.xml
index fc20bae6694..f4b4ffdaf74 100644
--- a/buildtools/pom.xml
+++ b/buildtools/pom.xml
@@ -45,7 +45,7 @@
 7.7.1
 3.11
 4.1
-8.37
+10.14.2
 3.1.2
 4.1.104.Final
 4.2.3
diff --git a/buildtools/src/main/resources/pulsar/checkstyle.xml 
b/buildtools/src/main/resources/pulsar/checkstyle.xml
index c63c8993408..14808cf8663 100644
--- a/buildtools/src/main/resources/pulsar/checkstyle.xml
+++ b/buildtools/src/main/resources/pulsar/checkstyle.xml
@@ -179,7 +179,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
 
 
 
-
+
 
 
 
diff --git a/pom.xml b/pom.xml
index d99a9a465e1..c633bef7f61 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,7 +158,7 @@ flexible messaging model and an intuitive client 
API.
 2.14.2
 0.10.2
 1.6.2
-8.37
+10.14.2
 0.43.3
 true
 0.5.0
diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
index 9c934072a8c..357c72f7629 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
@@ -916,8 +916,8 @@ public class PersistentTopic extends AbstractTopic 
implements Topic, AddEntryCal
 lock.readLock().unlock();
 }
 
-CompletableFuture subscriptionFuture = 
isDurable ? //
-getDurableSubscription(subscriptionName, initialPosition, 
startMessageRollbackDurationSec,
+CompletableFuture subscriptionFuture = 
isDurable
+? getDurableSubscription(subscriptionName, 
initialPosition, startMessageRollbackDurationSec,
 replicatedSubscriptionState, 
subscriptionProperties)
 : getNonDurableSubscription(subscriptionName, 
startMessageId, initialPosition,
 startMessageRollbackDurationSec, readCompacted, 
subscriptionProperties);
diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
index 4908d10f330..da73514deb3 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
@@ -1835,9 +1835,9 @@ public class ProducerImpl extends ProducerBase 
implements TimerTask, Conne
 producerCreatedFuture.completeExceptionally(cause);
 closeProducerTasks();
 client.cleanupProducer(this);
-} else if (producerCreatedFuture.isDone() || //
-   (cause instanceof PulsarClientException && 
PulsarClientException.isRetriableError(cause)
-&& System.currentTimeMillis() < 
PRODUCER_DEADLINE_UPDATER.get(ProducerImpl.this))) {
+} else if (producerCreatedFuture.isDone()
+|| (cause instanceof PulsarClientException && 
PulsarClientException.isRetriableError(cause)
+&& System.currentTimeMillis() < 
PRODUCER_DEADLINE_UPDATER.get(ProducerImpl.this))) {
 // Either we had already created the producer once 
(producerCreatedFuture.isDone()) or we are
 // still within the initial timeout budget and we are 
dealing with a retriable error
 future.completeExceptionally(cause);
diff --git 

Re: [PR] [cleanup][meta] Remove com.beust.jcommander.internal import [pulsar]

2024-03-18 Thread via GitHub


nodece commented on PR #22294:
URL: https://github.com/apache/pulsar/pull/22294#issuecomment-2004125908

   /pulsarbot rerun-failire-checks


-- 
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-unsubscr...@pulsar.apache.org

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



[PR] [cleanup][meta] Remove com.beust.jcommander.internal import [pulsar]

2024-03-18 Thread via GitHub


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

   ### Motivation
   
   Do not use `com.beust.jcommander.internal` package.
   
   ### Modifications
   
   - Use `new ArrayList()` instead of `Lists.newArray()`
   - Use `new HastSet()` instead of `Sets.newHashSet()`
   
   ### Documentation
   
   
   
   - [ ] `doc` 
   - [ ] `doc-required` 
   - [x] `doc-not-needed` 
   - [ ] `doc-complete` 


-- 
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-unsubscr...@pulsar.apache.org

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



(pulsar) branch branch-3.1 updated: [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)

2024-03-18 Thread lhotari
This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
 new 31c5206619f [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)
31c5206619f is described below

commit 31c5206619f7b9235f6a225ed82152b74b8bc1a3
Author: Zixuan Liu 
AuthorDate: Mon Mar 18 21:37:03 2024 +0800

[improve][misc] Upgrade checkstyle to 10.14.2 (#22291)

(cherry picked from commit cd512e4da6a04c68d448a452c76b10b49014033d)
---
 buildtools/pom.xml   |  2 +-
 buildtools/src/main/resources/pulsar/checkstyle.xml  |  2 +-
 pom.xml  |  2 +-
 .../broker/service/persistent/PersistentTopic.java   |  4 ++--
 .../java/org/apache/pulsar/client/impl/ProducerImpl.java |  6 +++---
 .../org/apache/pulsar/common/tls/InetAddressUtils.java   | 16 +---
 .../pulsar/common/util/collections/LongPairSet.java  |  4 ++--
 7 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/buildtools/pom.xml b/buildtools/pom.xml
index b82d40b181f..221a006a8ec 100644
--- a/buildtools/pom.xml
+++ b/buildtools/pom.xml
@@ -45,7 +45,7 @@
 7.7.1
 3.11
 4.1
-8.37
+10.14.2
 3.1.2
 4.1.100.Final
 4.2.3
diff --git a/buildtools/src/main/resources/pulsar/checkstyle.xml 
b/buildtools/src/main/resources/pulsar/checkstyle.xml
index c63c8993408..14808cf8663 100644
--- a/buildtools/src/main/resources/pulsar/checkstyle.xml
+++ b/buildtools/src/main/resources/pulsar/checkstyle.xml
@@ -179,7 +179,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
 
 
 
-
+
 
 
 
diff --git a/pom.xml b/pom.xml
index a6c40e8b364..cbac6bc3cee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,7 +158,7 @@ flexible messaging model and an intuitive client 
API.
 2.14.2
 0.10.2
 1.6.2
-8.37
+10.14.2
 0.43.3
 true
 0.5.0
diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
index b434d8a2dbc..5bceed099c1 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
@@ -888,8 +888,8 @@ public class PersistentTopic extends AbstractTopic 
implements Topic, AddEntryCal
 lock.readLock().unlock();
 }
 
-CompletableFuture subscriptionFuture = 
isDurable ? //
-getDurableSubscription(subscriptionName, initialPosition, 
startMessageRollbackDurationSec,
+CompletableFuture subscriptionFuture = 
isDurable
+? getDurableSubscription(subscriptionName, 
initialPosition, startMessageRollbackDurationSec,
 replicatedSubscriptionState, 
subscriptionProperties)
 : getNonDurableSubscription(subscriptionName, 
startMessageId, initialPosition,
 startMessageRollbackDurationSec, readCompacted, 
subscriptionProperties);
diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
index 8d2d917d7b8..3fc3bbf3cf7 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
@@ -1831,9 +1831,9 @@ public class ProducerImpl extends ProducerBase 
implements TimerTask, Conne
 producerCreatedFuture.completeExceptionally(cause);
 closeProducerTasks();
 client.cleanupProducer(this);
-} else if (producerCreatedFuture.isDone() || //
-   (cause instanceof PulsarClientException && 
PulsarClientException.isRetriableError(cause)
-&& System.currentTimeMillis() < 
PRODUCER_DEADLINE_UPDATER.get(ProducerImpl.this))) {
+} else if (producerCreatedFuture.isDone()
+|| (cause instanceof PulsarClientException && 
PulsarClientException.isRetriableError(cause)
+&& System.currentTimeMillis() < 
PRODUCER_DEADLINE_UPDATER.get(ProducerImpl.this))) {
 // Either we had already created the producer once 
(producerCreatedFuture.isDone()) or we are
 // still within the initial timeout budget and we are 
dealing with a retriable error
 future.completeExceptionally(cause);
diff --git 

(pulsar) branch branch-3.0 updated: [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)

2024-03-18 Thread lhotari
This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
 new 8fd676eb2a4 [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)
8fd676eb2a4 is described below

commit 8fd676eb2a43f33dee1da3f797e0097703b87c3e
Author: Zixuan Liu 
AuthorDate: Mon Mar 18 21:37:03 2024 +0800

[improve][misc] Upgrade checkstyle to 10.14.2 (#22291)

(cherry picked from commit cd512e4da6a04c68d448a452c76b10b49014033d)

# Conflicts:
#   pom.xml
---
 buildtools/pom.xml   |  2 +-
 buildtools/src/main/resources/pulsar/checkstyle.xml  |  2 +-
 pom.xml  |  2 +-
 .../broker/service/persistent/PersistentTopic.java   |  4 ++--
 .../org/apache/pulsar/compaction/CompactedTopicTest.java |  5 -
 .../java/org/apache/pulsar/client/impl/ProducerImpl.java |  6 +++---
 .../org/apache/pulsar/common/tls/InetAddressUtils.java   | 16 +---
 .../pulsar/common/util/collections/LongPairSet.java  |  4 ++--
 8 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/buildtools/pom.xml b/buildtools/pom.xml
index 36ed4b92c13..6b55e5e02e5 100644
--- a/buildtools/pom.xml
+++ b/buildtools/pom.xml
@@ -45,7 +45,7 @@
 7.7.1
 3.11
 4.1
-8.37
+10.14.2
 3.1.2
 4.1.100.Final
 4.2.3
diff --git a/buildtools/src/main/resources/pulsar/checkstyle.xml 
b/buildtools/src/main/resources/pulsar/checkstyle.xml
index b3812ca8ccc..18075c8a8eb 100644
--- a/buildtools/src/main/resources/pulsar/checkstyle.xml
+++ b/buildtools/src/main/resources/pulsar/checkstyle.xml
@@ -179,7 +179,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
 
 
 
-
+
 
 
 
diff --git a/pom.xml b/pom.xml
index aa7ceb933d8..1cd940ba7ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,7 +158,7 @@ flexible messaging model and an intuitive client 
API.
 2.14.2
 0.10.2
 1.6.10
-8.37
+10.14.2
 0.43.3
 true
 0.5.0
diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
index 24a223fe82a..a6087490744 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
@@ -885,8 +885,8 @@ public class PersistentTopic extends AbstractTopic 
implements Topic, AddEntryCal
 lock.readLock().unlock();
 }
 
-CompletableFuture subscriptionFuture = 
isDurable ? //
-getDurableSubscription(subscriptionName, initialPosition, 
startMessageRollbackDurationSec,
+CompletableFuture subscriptionFuture = 
isDurable
+? getDurableSubscription(subscriptionName, 
initialPosition, startMessageRollbackDurationSec,
 replicatedSubscriptionState, 
subscriptionProperties)
 : getNonDurableSubscription(subscriptionName, 
startMessageId, initialPosition,
 startMessageRollbackDurationSec, readCompacted, 
subscriptionProperties);
diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
 
b/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
index 8524eb27aac..44272f4021e 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
@@ -21,10 +21,8 @@ package org.apache.pulsar.compaction;
 import static org.apache.pulsar.compaction.Compactor.COMPACTION_SUBSCRIPTION;
 import com.github.benmanes.caffeine.cache.AsyncLoadingCache;
 import com.google.common.collect.Sets;
-
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -36,9 +34,7 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.stream.IntStream;
-
 import lombok.Cleanup;
-
 import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.client.BookKeeper;
 import org.apache.bookkeeper.client.LedgerHandle;
@@ -47,7 +43,6 @@ import org.apache.bookkeeper.mledger.impl.PositionImpl;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.commons.lang3.tuple.Triple;
 import org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest;
-import org.apache.pulsar.broker.service.Consumer;
 import org.apache.pulsar.broker.service.Topic;
 import 

(pulsar) branch master updated: [improve][misc] Upgrade jersey to 2.41 (#22290)

2024-03-18 Thread technoboy
This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new 0c9d8601698 [improve][misc] Upgrade jersey to 2.41 (#22290)
0c9d8601698 is described below

commit 0c9d86016983b9683aa3b637be38e281090f40f0
Author: Zixuan Liu 
AuthorDate: Mon Mar 18 22:14:11 2024 +0800

[improve][misc] Upgrade jersey to 2.41 (#22290)
---
 distribution/server/src/assemble/LICENSE.bin.txt | 20 ++--
 distribution/shell/src/assemble/LICENSE.bin.txt  | 14 +++---
 pom.xml  |  2 +-
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/distribution/server/src/assemble/LICENSE.bin.txt 
b/distribution/server/src/assemble/LICENSE.bin.txt
index 9e12db74eb1..dac03d966a6 100644
--- a/distribution/server/src/assemble/LICENSE.bin.txt
+++ b/distribution/server/src/assemble/LICENSE.bin.txt
@@ -582,16 +582,16 @@ CDDL-1.1 -- ../licenses/LICENSE-CDDL-1.1.txt
 - org.glassfish.hk2-osgi-resource-locator-1.0.3.jar
 - org.glassfish.hk2.external-aopalliance-repackaged-2.6.1.jar
  * Jersey
-- org.glassfish.jersey.containers-jersey-container-servlet-2.34.jar
-- org.glassfish.jersey.containers-jersey-container-servlet-core-2.34.jar
-- org.glassfish.jersey.core-jersey-client-2.34.jar
-- org.glassfish.jersey.core-jersey-common-2.34.jar
-- org.glassfish.jersey.core-jersey-server-2.34.jar
-- org.glassfish.jersey.ext-jersey-entity-filtering-2.34.jar
-- org.glassfish.jersey.media-jersey-media-json-jackson-2.34.jar
-- org.glassfish.jersey.media-jersey-media-multipart-2.34.jar
-- org.glassfish.jersey.inject-jersey-hk2-2.34.jar
- * Mimepull -- org.jvnet.mimepull-mimepull-1.9.13.jar
+- org.glassfish.jersey.containers-jersey-container-servlet-2.41.jar
+- org.glassfish.jersey.containers-jersey-container-servlet-core-2.41.jar
+- org.glassfish.jersey.core-jersey-client-2.41.jar
+- org.glassfish.jersey.core-jersey-common-2.41.jar
+- org.glassfish.jersey.core-jersey-server-2.41.jar
+- org.glassfish.jersey.ext-jersey-entity-filtering-2.41.jar
+- org.glassfish.jersey.media-jersey-media-json-jackson-2.41.jar
+- org.glassfish.jersey.media-jersey-media-multipart-2.41.jar
+- org.glassfish.jersey.inject-jersey-hk2-2.41.jar
+ * Mimepull -- org.jvnet.mimepull-mimepull-1.9.15.jar
 
 Eclipse Distribution License 1.0 -- ../licenses/LICENSE-EDL-1.0.txt
  * Jakarta Activation
diff --git a/distribution/shell/src/assemble/LICENSE.bin.txt 
b/distribution/shell/src/assemble/LICENSE.bin.txt
index a9bbd541448..7ae4241dfb9 100644
--- a/distribution/shell/src/assemble/LICENSE.bin.txt
+++ b/distribution/shell/src/assemble/LICENSE.bin.txt
@@ -441,13 +441,13 @@ CDDL-1.1 -- ../licenses/LICENSE-CDDL-1.1.txt
 - aopalliance-repackaged-2.6.1.jar
 - osgi-resource-locator-1.0.3.jar
  * Jersey
-- jersey-client-2.34.jar
-- jersey-common-2.34.jar
-- jersey-entity-filtering-2.34.jar
-- jersey-media-json-jackson-2.34.jar
-- jersey-media-multipart-2.34.jar
-- jersey-hk2-2.34.jar
- * Mimepull -- mimepull-1.9.13.jar
+- jersey-client-2.41.jar
+- jersey-common-2.41.jar
+- jersey-entity-filtering-2.41.jar
+- jersey-media-json-jackson-2.41.jar
+- jersey-media-multipart-2.41.jar
+- jersey-hk2-2.41.jar
+ * Mimepull -- mimepull-1.9.15.jar
 
 Eclipse Distribution License 1.0 -- ../licenses/LICENSE-EDL-1.0.txt
  * Jakarta Activation
diff --git a/pom.xml b/pom.xml
index 98eea81c30a..caa2fc49b27 100644
--- a/pom.xml
+++ b/pom.xml
@@ -148,7 +148,7 @@ flexible messaging model and an intuitive client 
API.
 0.0.24.Final
 9.4.54.v20240208
 2.5.2
-2.34
+2.41
 1.10.50
 0.16.0
 4.3.8



Re: [PR] [improve][misc] Upgrade jersey to 2.41 [pulsar]

2024-03-18 Thread via GitHub


Technoboy- merged PR #22290:
URL: https://github.com/apache/pulsar/pull/22290


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve/feat][site] Layout and content updates to Homepage, Features, Community, Events, Books and Blog, Added Use Cases Page. Resources are split into Articles and Presentations Pages. [pul

2024-03-18 Thread via GitHub


Trakina commented on PR #789:
URL: https://github.com/apache/pulsar-site/pull/789#issuecomment-2004034900

   @visortelle just realised I missed a detail in the blog list, pushed again. 
   Also, added you as contributor to my fork.


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve/feat][site] Layout and content updates to Homepage, Features, Community, Events, Books and Blog, Added Use Cases Page. Resources are split into Articles and Presentations Pages. [pul

2024-03-18 Thread via GitHub


visortelle commented on PR #789:
URL: https://github.com/apache/pulsar-site/pull/789#issuecomment-2004008535

   @Samuel Traquina Thank you. I updated the live preview: 
https://pulsar-site-2024-updates.vercel.app/
   
   I’m going to take a look and commit a bunch of minor fixes for the desktop 
version in the next few days.
   If I find something for mobile or tablet, I'll post it as a separate comment.
   
   Could you add me as a collaborator to your repo fork? 
   


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve/feat][site] Layout and content updates to Homepage, Features, Community, Events, Books and Blog, Added Use Cases Page. Resources are split into Articles and Presentations Pages. [pul

2024-03-18 Thread via GitHub


Trakina commented on PR #789:
URL: https://github.com/apache/pulsar-site/pull/789#issuecomment-2003979300

   - [x] Both should have the same font-weight - `400`
   
   https://github.com/apache/pulsar-site/assets/9302460/a38caed7-9870-4585-8c8c-f5c8019c402a;>
   
   https://github.com/apache/pulsar-site/assets/9302460/80d1695a-cc17-4204-b6e1-666bf2bf9311;>
   
   - [x] Card title should have font-size `22px` (`1.375rem`)
   https://github.com/apache/pulsar-site/assets/9302460/99037f2c-f747-4cc8-8812-f2e1b2ed2077;>
   
   - [x] Same font-weight
   - [x] Number size should be bigger. `64px` vs `96px`
   - [x] Sentences below the numbers also should have different font-size and 
font-weight
   - [x] The `+` in `600+` and `1+` is an icon with a different size, not 
the piece of text.
   - [x] Figma design says that the GitHub number should be a link to 
https://github/apache/pusar
   
   https://github.com/apache/pulsar-site/assets/9302460/2667ea5f-999e-47bd-a9f5-0903167e4d56;>
   
   https://github.com/apache/pulsar-site/assets/9302460/91c191f8-9a54-440f-b84a-aff3ba0e476f;>
   
   - [x] Font weight should be different
   
   https://github.com/apache/pulsar-site/assets/9302460/b60caa80-2143-4c05-9ae3-3c0ca5d25766;>
   
   - [x] Font size should be different
   
   https://github.com/apache/pulsar-site/assets/9302460/de826ec6-f3b6-4d8b-b569-9c068db82c00;>
   
   - [x] The "Explore docs" button should be white
   - [x] The text is still not centered vertically. It's because the `` tag 
has a bottom margin by default. You can just override it for this specific 
place.
   
   https://github.com/apache/pulsar-site/assets/9302460/cb8ecbdd-967e-4e79-bd4b-b6bc944fc6db;>
   
   - Font size should  be different
   
   https://github.com/apache/pulsar-site/assets/9302460/4083ac2a-b787-462f-b47e-ac00e938751a;>
   
   - [x] Font size and font-weight should be different
   
   https://github.com/apache/pulsar-site/assets/9302460/0783110b-4156-4654-b239-8abeacba7d31;>
   
   - [x] Arrow icons should be smaller
   
   https://github.com/apache/pulsar-site/assets/9302460/bec9e527-cfc8-43ca-b667-bf09ee79d687;>
   
   https://github.com/apache/pulsar-site/assets/9302460/c9c30c02-578f-4359-80b1-c28b3ef687dc;>
   
   - [x] Max content width should be smaller
   
   https://github.com/apache/pulsar-site/assets/9302460/5dd6fd26-5b0e-4c23-853a-4a6339878855;>
   
   https://github.com/apache/pulsar-site/assets/9302460/a16bfdce-31a8-490d-bc21-ea5abe42aa44;>
   
   - [x] The space between the title and the first item should be smaller
   
   https://github.com/apache/pulsar-site/assets/9302460/7ca39a9b-e812-4b8d-8da5-9f18d09ac127;>
   
   https://github.com/apache/pulsar-site/assets/9302460/eea068ef-70e4-4c9f-bb00-e68c4d10f129;>
   
   - [x] Title should have different font weight
   
   https://github.com/apache/pulsar-site/assets/9302460/0a8d4a6b-9fc0-4cc4-9ca6-d2149e7c6205;>
   
   https://github.com/apache/pulsar-site/assets/9302460/3c06b2a3-86e7-4743-9c44-5177fdd6a20b;>
   
   - [x] Image size should be bigger. `48px` vs `56px`
   
   https://github.com/apache/pulsar-site/assets/9302460/77cc36ca-0c24-4de4-9694-6dfd19d69708;>
   
   - [x] The vertical space between the text and the button should be a bit 
smaller
   
   https://github.com/apache/pulsar-site/assets/9302460/9a1f87c1-a8bb-4e38-a307-17abbb64b7c3;>
   
   https://github.com/apache/pulsar-site/assets/9302460/05f98b30-bbc3-4f37-a410-e6c162699e18;>
   
   - [x] Icons width should be bigger `48px` vs `66px`
   
   https://github.com/apache/pulsar-site/assets/9302460/fad31d85-8645-4243-a983-dfd5bf849728;>
   
   - [x] I suppose it should be a long dash, not dash-dash `--`
   https://github.com/apache/pulsar-site/assets/9302460/e86ce35c-da8e-46c9-ad51-0f05bc6fb321;>
   
   - [x] Buttons should be under the whole content, not the part of the first 
column.
   
   https://github.com/apache/pulsar-site/assets/9302460/106082a1-ecd7-4056-a783-19428efcf4bc;>
   
   https://github.com/apache/pulsar-site/assets/9302460/9553c7b4-6cc5-4357-aa28-e1f6a9032799;>
   
   - [x] Max content width should be less
   
   https://github.com/apache/pulsar-site/assets/9302460/812e366e-6153-44ca-8dbf-e2b3b45b1ea1;>
   
   https://github.com/apache/pulsar-site/assets/9302460/f53c4d95-fc52-422e-9852-6fc6f26bc294;>
   
   - [x] Please recheck font sizes and font weights for this section
   
   https://github.com/apache/pulsar-site/assets/9302460/baa2c68b-95dc-4cd2-a1f2-489e1a6adc6b;>
   
   https://github.com/apache/pulsar-site/assets/9302460/7e9f26b9-507c-4ccc-862b-ce056fc47da3;>
   
   - [x] Font size and font weight should be different here `16px` vs `18px`, 
`700` vs `600`
   
   https://github.com/apache/pulsar-site/assets/9302460/3fea59aa-43b4-4a85-9622-ae11b46b54ff;>
   
   - [x] The "Go to GitHub" link shouldn't have underlined.
   - [x] The horizontal space between links should be bigger
   
   https://github.com/apache/pulsar-site/assets/9302460/5281b972-fc34-458e-9a65-95d428eec0b3;>
 

Re: [PR] [improve][misc] Upgrade jersey to 2.41 [pulsar]

2024-03-18 Thread via GitHub


codecov-commenter commented on PR #22290:
URL: https://github.com/apache/pulsar/pull/22290#issuecomment-2003973979

   ## 
[Codecov](https://app.codecov.io/gh/apache/pulsar/pull/22290?dropdown=coverage=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 73.68%. Comparing base 
[(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 to head 
[(`e3e034c`)](https://app.codecov.io/gh/apache/pulsar/pull/22290?dropdown=coverage=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache).
   > Report is 63 commits behind head on master.
   
   Additional details and impacted files
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/pulsar/pull/22290/graphs/tree.svg?width=650=150=pr=acYqCpsK9J_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/22290?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
   
   ```diff
   @@ Coverage Diff  @@
   ## master   #22290  +/-   ##
   
   + Coverage 73.57%   73.68%   +0.10% 
   + Complexity3262432259 -365 
   
 Files  1877 1887  +10 
 Lines139502   139446  -56 
 Branches  1529915293   -6 
   
   + Hits 102638   102750 +112 
   + Misses2890828746 -162 
   + Partials   7956 7950   -6 
   ```
   
   | 
[Flag](https://app.codecov.io/gh/apache/pulsar/pull/22290/flags?src=pr=flags_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[inttests](https://app.codecov.io/gh/apache/pulsar/pull/22290/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `26.92% <ø> (+2.34%)` | :arrow_up: |
   | 
[systests](https://app.codecov.io/gh/apache/pulsar/pull/22290/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `24.56% <ø> (+0.24%)` | :arrow_up: |
   | 
[unittests](https://app.codecov.io/gh/apache/pulsar/pull/22290/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `72.92% <ø> (+0.07%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click 
here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#carryforward-flags-in-the-pull-request-comment)
 to find out more.
   
   [see 94 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/pulsar/pull/22290/indirect-changes?src=pr=tree-more_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
   
   


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve/feat][site] Layout and content updates to Homepage, Features, Community, Events, Books and Blog, Added Use Cases Page. Resources are split into Articles and Presentations Pages. [pul

2024-03-18 Thread via GitHub


Trakina commented on PR #789:
URL: https://github.com/apache/pulsar-site/pull/789#issuecomment-2003958682

   - [x] Both should have the same font-weight - `400`
   
   https://github.com/apache/pulsar-site/assets/9302460/a38caed7-9870-4585-8c8c-f5c8019c402a;>
   
   https://github.com/apache/pulsar-site/assets/9302460/80d1695a-cc17-4204-b6e1-666bf2bf9311;>
   
   - [ ] Card title should have font-size `22px` (`1.375rem`)
   https://github.com/apache/pulsar-site/assets/9302460/99037f2c-f747-4cc8-8812-f2e1b2ed2077;>
   
   - [ ] Same font-weight
   - [ ] Number size should be bigger. `64px` vs `96px`
   - [ ] Sentences below the numbers also should have different font-size and 
font-weight
   - [ ] The `+` in `600+` and `1+` is an icon with a different size, not 
the piece of text.
   - [ ] Figma design says that the GitHub number should be a link to 
https://github/apache/pusar
   
   https://github.com/apache/pulsar-site/assets/9302460/2667ea5f-999e-47bd-a9f5-0903167e4d56;>
   
   https://github.com/apache/pulsar-site/assets/9302460/91c191f8-9a54-440f-b84a-aff3ba0e476f;>
   
   - [ ] Font weight should be different
   
   https://github.com/apache/pulsar-site/assets/9302460/b60caa80-2143-4c05-9ae3-3c0ca5d25766;>
   
   - [ ] Font size should be different
   
   https://github.com/apache/pulsar-site/assets/9302460/de826ec6-f3b6-4d8b-b569-9c068db82c00;>
   
   - [ ] The "Explore docs" button should be white
   - [ ] The text is still not centered vertically. It's because the `` tag 
has a bottom margin by default. You can just override it for this specific 
place.
   
   https://github.com/apache/pulsar-site/assets/9302460/cb8ecbdd-967e-4e79-bd4b-b6bc944fc6db;>
   
   - Font size should  be different
   
   https://github.com/apache/pulsar-site/assets/9302460/4083ac2a-b787-462f-b47e-ac00e938751a;>
   
   - [ ] Font size and font-weight should be different
   
   https://github.com/apache/pulsar-site/assets/9302460/0783110b-4156-4654-b239-8abeacba7d31;>
   
   - [ ] Arrow icons should be smaller
   
   https://github.com/apache/pulsar-site/assets/9302460/bec9e527-cfc8-43ca-b667-bf09ee79d687;>
   
   https://github.com/apache/pulsar-site/assets/9302460/c9c30c02-578f-4359-80b1-c28b3ef687dc;>
   
   - [ ] Max content width should be smaller
   
   https://github.com/apache/pulsar-site/assets/9302460/5dd6fd26-5b0e-4c23-853a-4a6339878855;>
   
   https://github.com/apache/pulsar-site/assets/9302460/a16bfdce-31a8-490d-bc21-ea5abe42aa44;>
   
   - [ ] The space between the title and the first item should be smaller
   
   https://github.com/apache/pulsar-site/assets/9302460/7ca39a9b-e812-4b8d-8da5-9f18d09ac127;>
   
   https://github.com/apache/pulsar-site/assets/9302460/eea068ef-70e4-4c9f-bb00-e68c4d10f129;>
   
   - [ ] Title should have different font weight
   
   https://github.com/apache/pulsar-site/assets/9302460/0a8d4a6b-9fc0-4cc4-9ca6-d2149e7c6205;>
   
   https://github.com/apache/pulsar-site/assets/9302460/3c06b2a3-86e7-4743-9c44-5177fdd6a20b;>
   
   - [ ] Image size should be bigger. `48px` vs `56px`
   
   https://github.com/apache/pulsar-site/assets/9302460/77cc36ca-0c24-4de4-9694-6dfd19d69708;>
   
   - [ ] The vertical space between the text and the button should be a bit 
smaller
   
   https://github.com/apache/pulsar-site/assets/9302460/9a1f87c1-a8bb-4e38-a307-17abbb64b7c3;>
   
   https://github.com/apache/pulsar-site/assets/9302460/05f98b30-bbc3-4f37-a410-e6c162699e18;>
   
   - [ ] Icons width should be bigger `48px` vs `66px`
   
   https://github.com/apache/pulsar-site/assets/9302460/fad31d85-8645-4243-a983-dfd5bf849728;>
   
   - [ ] I suppose it should be a long dash, not dash-dash `--`
   https://github.com/apache/pulsar-site/assets/9302460/e86ce35c-da8e-46c9-ad51-0f05bc6fb321;>
   
   - [ ] Buttons should be under the whole content, not the part of the first 
column.
   
   https://github.com/apache/pulsar-site/assets/9302460/106082a1-ecd7-4056-a783-19428efcf4bc;>
   
   https://github.com/apache/pulsar-site/assets/9302460/9553c7b4-6cc5-4357-aa28-e1f6a9032799;>
   
   - [ ] Max content width should be less
   
   https://github.com/apache/pulsar-site/assets/9302460/812e366e-6153-44ca-8dbf-e2b3b45b1ea1;>
   
   https://github.com/apache/pulsar-site/assets/9302460/f53c4d95-fc52-422e-9852-6fc6f26bc294;>
   
   - [ ] Please recheck font sizes and font weights for this section
   
   https://github.com/apache/pulsar-site/assets/9302460/baa2c68b-95dc-4cd2-a1f2-489e1a6adc6b;>
   
   https://github.com/apache/pulsar-site/assets/9302460/7e9f26b9-507c-4ccc-862b-ce056fc47da3;>
   
   - [ ] Font size and font weight should be different here `16px` vs `18px`, 
`700` vs `600`
   
   https://github.com/apache/pulsar-site/assets/9302460/3fea59aa-43b4-4a85-9622-ae11b46b54ff;>
   
   - [ ] The "Go to GitHub" link shouldn't have underlined.
   - [ ] The horizontal space between links should be bigger
   
   https://github.com/apache/pulsar-site/assets/9302460/5281b972-fc34-458e-9a65-95d428eec0b3;>
 

Re: [PR] [improve/feat][site] Layout and content updates to Homepage, Features, Community, Events, Books and Blog, Added Use Cases Page. Resources are split into Articles and Presentations Pages. [pul

2024-03-18 Thread via GitHub


Trakina commented on PR #789:
URL: https://github.com/apache/pulsar-site/pull/789#issuecomment-2003954312

   > @Trakina thank you for the updates!
   > 
   > Figma design: 
https://www.figma.com/file/0jERoA2DTlfQoj1uH09FxQ/Pulsar-website Live preview: 
https://pulsar-site-2024-updates.vercel.app/
   > 
   > * [ x]  Both should have the same font-weight - `400`
   > 
   > 
   > https://private-user-images.githubusercontent.com/9302460/311158632-a38caed7-9870-4585-8c8c-f5c8019c402a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTA3NjM3MDMsIm5iZiI6MTcxMDc2MzQwMywicGF0aCI6Ii85MzAyNDYwLzMxMTE1ODYzMi1hMzhjYWVkNy05ODcwLTQ1ODUtOGM4Yy1mNWM4MDE5YzQwMmEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMThUMTIwMzIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODBjZjc3YjdiOTlhODc4Y2FjZWZiZjY0Y2VkMjFlNDk0OWYyMGNkZDU2NmU1OTAzZDBiNjg5MDYwZmE4ZjhmZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.nN5q9SzxWNUnTjrCqC8fn83dhHN9ZEQNrtIteezdX_Q;>
 https://private-user-images.githubuserco
 
ntent.com/9302460/311158782-80d1695a-cc17-4204-b6e1-666bf2bf9311.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTA3NjM3MDMsIm5iZiI6MTcxMDc2MzQwMywicGF0aCI6Ii85MzAyNDYwLzMxMTE1ODc4Mi04MGQxNjk1YS1jYzE3LTQyMDQtYjZlMS02NjZiZjJiZjkzMTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMThUMTIwMzIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzU3OTBlM2Q2NjRkOGExN2I3NTRmOTIxMDI3MTBmNTU5ZGE5ZTI3ZjI3Y2FkNzE2YWIwNzk4Nzg5YWIyMmFmMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.YWjqvvtPzifl4YKbG7voIdojbEJo1amhPN8AED0NCe8">
   > 
   > * [ ]  Card title should have font-size `22px` (`1.375rem`)
   > 
   > 
   > https://private-user-images.githubusercontent.com/9302460/311159395-99037f2c-f747-4cc8-8812-f2e1b2ed2077.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTA3NjM3MDMsIm5iZiI6MTcxMDc2MzQwMywicGF0aCI6Ii85MzAyNDYwLzMxMTE1OTM5NS05OTAzN2YyYy1mNzQ3LTRjYzgtODgxMi1mMmUxYjJlZDIwNzcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMThUMTIwMzIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2IwMTZiNTgwNmRmMmQ2ZmRhYTcyNmNkNDJjNmFhNmI1NTMzMWY3MGQyZGY0ZjNjZGQxNTMxMTIzYWM0YzU1MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.KCr9GE-seoXL0Y-s3zNgXC-BFWYkecrgg6XZqTEy14U;>
   > 
   > * [ ]  Same font-weight
   > 
   > * [ ]  Number size should be bigger. `64px` vs `96px`
   > 
   > * [ ]  Sentences below the numbers also should have different 
font-size and font-weight
   > 
   > * [ ]  The `+` in `600+` and `1+` is an icon with a different 
size, not the piece of text.
   > 
   > * [ ]  Figma design says that the GitHub number should be a link to 
https://github/apache/pusar
   > 
   > 
   > https://private-user-images.githubusercontent.com/9302460/311181010-2667ea5f-999e-47bd-a9f5-0903167e4d56.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTA3NjM3MDMsIm5iZiI6MTcxMDc2MzQwMywicGF0aCI6Ii85MzAyNDYwLzMxMTE4MTAxMC0yNjY3ZWE1Zi05OTllLTQ3YmQtYTlmNS0wOTAzMTY3ZTRkNTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMThUMTIwMzIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjhlOTM2N2RlOGVmNTVjOTcyOGY2ODZhNTZhOWQ1NGUzNDc4ODYwNWQ3YzVmZTZjYjExN2NlYmIzNzVjYmYxZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.BQiyQ9Nu56H79BTXNtm8xYiAT1r3yfymDQyPeSZQGS8;>
 https://private-user-images.githubuserco
 

(pulsar) branch master updated: [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)

2024-03-18 Thread lhotari
This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new cd512e4da6a [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)
cd512e4da6a is described below

commit cd512e4da6a04c68d448a452c76b10b49014033d
Author: Zixuan Liu 
AuthorDate: Mon Mar 18 21:37:03 2024 +0800

[improve][misc] Upgrade checkstyle to 10.14.2 (#22291)
---
 buildtools/pom.xml   |  2 +-
 buildtools/src/main/resources/pulsar/checkstyle.xml  |  2 +-
 pom.xml  |  2 +-
 .../broker/service/persistent/PersistentTopic.java   |  4 ++--
 .../java/org/apache/pulsar/client/impl/ProducerImpl.java |  6 +++---
 .../org/apache/pulsar/common/tls/InetAddressUtils.java   | 16 +---
 .../pulsar/common/util/collections/LongPairSet.java  |  4 ++--
 7 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/buildtools/pom.xml b/buildtools/pom.xml
index 2b88e1d9ea8..d1e6e5f5ce4 100644
--- a/buildtools/pom.xml
+++ b/buildtools/pom.xml
@@ -45,7 +45,7 @@
 7.7.1
 3.11
 4.1
-8.37
+10.14.2
 3.1.2
 4.1.104.Final
 4.2.3
diff --git a/buildtools/src/main/resources/pulsar/checkstyle.xml 
b/buildtools/src/main/resources/pulsar/checkstyle.xml
index c63c8993408..14808cf8663 100644
--- a/buildtools/src/main/resources/pulsar/checkstyle.xml
+++ b/buildtools/src/main/resources/pulsar/checkstyle.xml
@@ -179,7 +179,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
 
 
 
-
+
 
 
 
diff --git a/pom.xml b/pom.xml
index 04aa742ced3..98eea81c30a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -162,7 +162,7 @@ flexible messaging model and an intuitive client 
API.
 2.14.2
 0.10.2
 1.6.2
-8.37
+10.14.2
 0.43.3
 true
 0.5.0
diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
index 9111aafb2af..6179e73169f 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
@@ -952,8 +952,8 @@ public class PersistentTopic extends AbstractTopic 
implements Topic, AddEntryCal
 lock.readLock().unlock();
 }
 
-CompletableFuture subscriptionFuture = 
isDurable ? //
-getDurableSubscription(subscriptionName, initialPosition, 
startMessageRollbackDurationSec,
+CompletableFuture subscriptionFuture = 
isDurable
+? getDurableSubscription(subscriptionName, 
initialPosition, startMessageRollbackDurationSec,
 replicatedSubscriptionState, 
subscriptionProperties)
 : getNonDurableSubscription(subscriptionName, 
startMessageId, initialPosition,
 startMessageRollbackDurationSec, readCompacted, 
subscriptionProperties);
diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
index 4908d10f330..da73514deb3 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
@@ -1835,9 +1835,9 @@ public class ProducerImpl extends ProducerBase 
implements TimerTask, Conne
 producerCreatedFuture.completeExceptionally(cause);
 closeProducerTasks();
 client.cleanupProducer(this);
-} else if (producerCreatedFuture.isDone() || //
-   (cause instanceof PulsarClientException && 
PulsarClientException.isRetriableError(cause)
-&& System.currentTimeMillis() < 
PRODUCER_DEADLINE_UPDATER.get(ProducerImpl.this))) {
+} else if (producerCreatedFuture.isDone()
+|| (cause instanceof PulsarClientException && 
PulsarClientException.isRetriableError(cause)
+&& System.currentTimeMillis() < 
PRODUCER_DEADLINE_UPDATER.get(ProducerImpl.this))) {
 // Either we had already created the producer once 
(producerCreatedFuture.isDone()) or we are
 // still within the initial timeout budget and we are 
dealing with a retriable error
 future.completeExceptionally(cause);
diff --git 
a/pulsar-common/src/main/java/org/apache/pulsar/common/tls/InetAddressUtils.java
 

Re: [I] IntelliJ checkstyle plugin dropped support for checkstyle 8.x, upgrade checkstyle to newer version [pulsar]

2024-03-18 Thread via GitHub


lhotari closed issue #22286: IntelliJ checkstyle plugin dropped support for 
checkstyle 8.x, upgrade checkstyle to newer version
URL: https://github.com/apache/pulsar/issues/22286


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][misc] Upgrade checkstyle to 10.14.2 [pulsar]

2024-03-18 Thread via GitHub


lhotari merged PR #22291:
URL: https://github.com/apache/pulsar/pull/22291


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][broker] Consistently add fine-grain authorization to REST API [pulsar]

2024-03-18 Thread via GitHub


Technoboy- closed pull request #22292: [improve][broker] Consistently add 
fine-grain authorization to REST API
URL: https://github.com/apache/pulsar/pull/22292


-- 
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-unsubscr...@pulsar.apache.org

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



[PR] [improve][broker] Consistently add fine-grain authorization to REST API [pulsar]

2024-03-18 Thread via GitHub


Technoboy- opened a new pull request, #22292:
URL: https://github.com/apache/pulsar/pull/22292

   
   ### Motivation
   - Partitioned topic operation without authorization check.
   - Some namespace/topic operations are done without authorization check.
   
   ### Modification
   - `TRIM_TOPIC`: we forgot to add this AuthAction, this would cause the 
normal user throw `IllegalStateException` not NotAuthorizedException.
   - `internalSetProperty,` `internalSetProperties,` `internalGetProperty,` 
`internalGetProperties,` `internalRemoveProperty,` `internalClearProperties,`: 
there is no auth for these methods before, adding a new AuthAction could cause 
a compatible issue, so using existing `TenantOperation.CREATE_NAMESPACE` 
instead, which means user can create the namespace, so can get/set the 
namespace properties.
   - `internalUnloadTopic`,`internalGetManagedLedgerInfo`, 
`internalGetPartitionedStats`, `internalGetPartitionedStatsInternal `, 
`internalCreateSubscription`, `internalUpdateSubscriptionProperties`, 
`internalAnalyzeSubscriptionBacklog`, `internalGetSubscriptionProperties `: we 
don't check the auth for these methods of the partitioned topic. Before, for 
partitioned-topic, we need to get the metadata first and then call the 
`admin-client` to execute the auth, which will skip the real auth check. 
   
   ### Verifying this change
   - Add `NamespaceAuthZTest` and `TopicAuthZTest`
   
   ### Documentation
   
   
   
   - [ ] `doc` 
   - [ ] `doc-required` 
   - [x] `doc-not-needed` 
   - [ ] `doc-complete` 
   
   
   


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][misc] Upgrade checkstyle to 10.14.2 [pulsar]

2024-03-18 Thread via GitHub


nodece commented on PR #22291:
URL: https://github.com/apache/pulsar/pull/22291#issuecomment-2003830100

   /pulsarbot rerun-failure-checks


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix][sec] implicit narrowing conversion in compound assignment [pulsar]

2024-03-18 Thread via GitHub


liangyepianzhou closed pull request #22074: [fix][sec] implicit narrowing 
conversion in compound assignment
URL: https://github.com/apache/pulsar/pull/22074


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix] [client] Unclear error message when creating a consumer with two same topics [pulsar]

2024-03-18 Thread via GitHub


nodece commented on code in PR #22255:
URL: https://github.com/apache/pulsar/pull/22255#discussion_r1528443267


##
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##
@@ -165,7 +165,7 @@ public class MultiTopicsConsumerImpl extends 
ConsumerBase {
 return;
 }
 
-checkArgument(topicNamesValid(conf.getTopicNames()), "Topics is 
invalid.");
+checkArgument(topicNamesValid(conf.getTopicNames()), "The param 
[topics] is invalid.");

Review Comment:
   There are two points here:
   
   1. Duplicate topics
   2. The topic name is invalid
   
   and the `param [topics]` only applies to Java client.
   
   That's why I put forward the suggestion.
   



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix] [client] Unclear error message when creating a consumer with two same topics [pulsar]

2024-03-18 Thread via GitHub


poorbarcode commented on code in PR #22255:
URL: https://github.com/apache/pulsar/pull/22255#discussion_r1528417228


##
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##
@@ -165,7 +165,7 @@ public class MultiTopicsConsumerImpl extends 
ConsumerBase {
 return;
 }
 
-checkArgument(topicNamesValid(conf.getTopicNames()), "Topics is 
invalid.");
+checkArgument(topicNamesValid(conf.getTopicNames()), "The param 
[topics] is invalid.");

Review Comment:
   The method `topicNamesValid` also calls `Topic.isValid`, see 
https://github.com/apache/pulsar/pull/22255/files#diff-b1cc861088865a65da05597a90794f9910e0a613fb6eb24e343cec5b5ec7da47R208,
 so the current alert is appropriate.



-- 
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-unsubscr...@pulsar.apache.org

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



Re: [I] [Doc] Add a proper way to submit website issues and improvement proposals [pulsar]

2024-03-18 Thread via GitHub


visortelle commented on issue #22277:
URL: https://github.com/apache/pulsar/issues/22277#issuecomment-2003677752

   > `flacky` --> `flaky`
   
   thanks, good catch 
   
   > The only thing I don't know, in general, is how labels are used, in real 
life.
   
   I can share how I see it:
   
   - We usually prioritize bugs over features. Of course with reasonable 
limits. Adding a label to bugs makes it easy to filter them and answer a 
question about what to do next.
   - Non-critical bugs and nice-to-have features that are planned, but not 
prioritized we can mark as `good-first-issue` and/or `help-wanted` to give new 
contributors a pool of issues they can take from. 
   - I'm not a fan of closing `stale` issues that are neither `resolved` nor 
`not planned`. It looks like it is hiding existing problems under the sofa.
   - The `area/*` labels allow a person who is interested or has good knowledge 
in a specific area to filter issues related to this area to get an overview of 
existing problems, what is work in progress, and retrospection of what has 
happened in this area. If someone is good at writing documentation.
 
 @asafm you could simply filter by `area/metrics` to get an overview of all 
the issues and PRs related to the topic you're interested in. It simplifies 
navigation when you have thousands of issues.


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve] [pip] PIP-344 Correct the behavior of the public API pulsarClient.getPartitionsForTopic(topicName) [pulsar]

2024-03-18 Thread via GitHub


RobertIndie commented on code in PR #22182:
URL: https://github.com/apache/pulsar/pull/22182#discussion_r1528352067


##
pip/pip-344.md:
##
@@ -0,0 +1,78 @@
+# PIP-344: Correct the behavior of the public API 
pulsarClient.getPartitionsForTopic(topicName)
+
+# Background knowledge
+
+**Topic auto-creation**
+- The partitioned topic auto-creation is dependent on 
`pulsarClient.getPartitionsForTopic`
+- It triggers partitioned metadata creation by 
`pulsarClient.getPartitionsForTopic`
+- And triggers the topic partition creation by producers' registration and 
consumers' registration.
+- When calling `pulsarClient.getPartitionsForTopic(topicName)`, Pulsar will 
automatically create the partitioned topic metadata if it does not exist, 
either using `HttpLookupService` or `BinaryProtoLookupService`.
+
+**Now `pulsarClient.getPartitionsForTopic`'s behavior**
+| case | broker allow `auto-create` | param allow  `create if not exists` 
| non-partitioned topic | partitioned topic |  current behavior |
+| --- | --- | --- | --- | --- | --- |
+| 1 | `true/false` | `true/false` | `exists: true` | | REST API: `partitions: 
0` Client API: `partitions: 0` |
+| 2 | `true/false` | `true/false` | | `exists: true`  `partitions: 3` | 
REST API: `partitions: 3` Client API: `partitions: 3` |
+| 3 | `true` | `true` | | | REST API:  - `create new: true` 
 - `partitions: 3`  Client API:  - `create 
new: true`  - `partitions: 3`  |
+| 4 | `true` | `false` | | | REST API:  - `create new: false` 
 - `partitions: 0`  Client API:  not 
support  |
+| 5 | `false` | `true` | | | REST API:  - `create new: false` 
 - `partitions: 0`  Client API:  - `create 
new: false`  - `partitions: 0`  |
+
+# Motivation
+
+The param `create if not exists` of the Client API is always `true.`
+
+- For case 4 of `pulsarClient.getPartitionsForTopic`'s behavior, it always 
tries to create the partitioned metadata, but the API name is `getxxx`.
+- For case 5 of `pulsarClient.getPartitionsForTopic`'s behavior, it returns a 
`0` partitioned metadata, but the topic does not exist. For the correct 
behavior of this case, we had discussed 
[here](https://github.com/apache/pulsar/issues/8813) before.
+
+# Goals
+
+Correct the behaviors of case 4 and case 5.
+
+- Do not create the partitioned metadata when calling 
`pulsarClient.getPartitionsForTopic`. The partitioned metadata will only be 
created when consumers/producers are trying to register.
+- Instead of returning a `0` partitioned metadata, respond to a not found 
error when calling `pulsarClient.getPartitionsForTopic` if the topic does not 
exist.
+
+# Detailed Design
+
+## Public-facing Changes
+
+When you call the public API `pulsarClient.getPartitionsForTopic`, pulsar will 
not create the partitioned metadata anymore.
+- 
[flink-connector-pulsar](https://github.com/apache/flink-connector-pulsar/blob/main/flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/sink/writer/topic/ProducerRegister.java#L221-L227)
 is using this API to create partitioned topic metadata.
+
+### Public API
+**LookupService.java**
+```
+// This API existed before. Not change it, thus ensuring compatibility.
+CompletableFuture 
getPartitionedTopicMetadata(TopicName topicName);
+
++ // A new API that contains an additional param "createIfAutoCreationEnabled."
++ CompletableFuture 
getPartitionedTopicMetadata(TopicName topicName, boolean 
createIfAutoCreationEnabled);
+```
+
+| case | do create partitioned metadata | non-partitioned topic | partitioned 
topic |  current behavior |
+| --- | --- | --- | --- | --- |
+| 1 | `true/false` | `exists: true` | | REST/Client API: `partitions: 0` |
+| 2 | `true/false` | | `exists: true`  `partitions: 3` | REST/Client API: 
`partitions: 3` |
+| 3 | `true` | | | REST/Client API:  - `create new: true`  
- `partitions: 3` |
+| 4 | `false` | | | REST/Client API:  - Not found error |
+
+### Binary protocol
+
+**CommandPartitionedTopicMetadata**
+```
+message CommandPartitionedTopicMetadata {
+  + optional bool metadata_auto_creation_enabled = 6 [default = true];
+}
+```
+
+# Backward & Forward Compatibility
+
+- Old version client and New version Broker
+  - Pulsar will create the partitioned topic metadata when calling 
`pulsarClient.getPartitionsForTopic`.
+  - The client does not pass the `create_if_auto_creation_enabled` parameter 
of `CommandPartitionedTopicMetadata` to the Broker, which defaults to `true` 
and automatically creates the partitioned topic metadata.
+
+- New version client and Old version Broker
+  - Pulsar will create the partitioned topic metadata when calling 
`pulsarClient.getPartitionsForTopic`.
+  - The client passes the `create_if_auto_creation_enabled` parameter of 
`CommandPartitionedTopicMetadata` to the Broker; the Broker will discard it and 
create the partitioned topic metadata automatically.

Review Comment:
   When a client user calls the API using `getPartitionedTopicMetadata(myTopic, 
false)` and the broker is an old 

Re: [PR] [fix][broker] Avoid execute prepareInitPoliciesCacheAsync if namespace is deleted [pulsar]

2024-03-18 Thread via GitHub


Technoboy- commented on PR #22268:
URL: https://github.com/apache/pulsar/pull/22268#issuecomment-2003613293

   > This test works fine, but 
`assertNull(service.getPoliciesCacheInit(namespaceName));` should be added 
after ` service.prepareInitPoliciesCacheAsync(namespaceName).get();`.
   
   yes, I have tested locally, it's fine. 


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [improve][misc] Upgrade checkstyle to 10.14.2 [pulsar]

2024-03-18 Thread via GitHub


nodece commented on PR #22291:
URL: https://github.com/apache/pulsar/pull/22291#issuecomment-2003601459

   /pulsarbot rerun-failure-checks


-- 
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-unsubscr...@pulsar.apache.org

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



(pulsar) branch branch-3.2 updated: [improve] [broker] Support create RawReader based on configuration (#22280)

2024-03-18 Thread technoboy
This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
 new f1bdb78564e [improve] [broker] Support create RawReader based on 
configuration (#22280)
f1bdb78564e is described below

commit f1bdb78564e739ed558fef1e0c9b8ea1d54c402c
Author: Hang Chen 
AuthorDate: Mon Mar 18 18:49:52 2024 +0800

[improve] [broker] Support create RawReader based on configuration (#22280)
---
 .../org/apache/pulsar/client/api/RawReader.java| 11 ++
 .../apache/pulsar/client/impl/RawReaderImpl.java   |  8 +
 .../apache/pulsar/client/impl/RawReaderTest.java   | 39 --
 3 files changed, 56 insertions(+), 2 deletions(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/client/api/RawReader.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/client/api/RawReader.java
index b7805c36b3b..55483708fdf 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/client/api/RawReader.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/client/api/RawReader.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import org.apache.pulsar.client.impl.PulsarClientImpl;
 import org.apache.pulsar.client.impl.RawReaderImpl;
+import org.apache.pulsar.client.impl.conf.ConsumerConfigurationData;
 
 /**
  * Topic reader which receives raw messages (i.e. as they are stored in the 
managed ledger).
@@ -43,6 +44,16 @@ public interface RawReader {
 return future.thenApply(__ -> r);
 }
 
+static CompletableFuture create(PulsarClient client,
+   
ConsumerConfigurationData consumerConfiguration,
+   boolean 
createTopicIfDoesNotExist) {
+CompletableFuture> future = new CompletableFuture<>();
+RawReader r = new RawReaderImpl((PulsarClientImpl) client,
+consumerConfiguration, future, createTopicIfDoesNotExist);
+return future.thenApply(__ -> r);
+}
+
+
 /**
  * Get the topic for the reader.
  *
diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java
index 3d7ad9f5865..5ac051d2271 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java
@@ -65,6 +65,14 @@ public class RawReaderImpl implements RawReader {
 consumer = new RawConsumerImpl(client, consumerConfiguration, 
consumerFuture, createTopicIfDoesNotExist);
 }
 
+public RawReaderImpl(PulsarClientImpl client, 
ConsumerConfigurationData consumerConfiguration,
+ CompletableFuture> consumerFuture,
+ boolean createTopicIfDoesNotExist) {
+this.consumerConfiguration = consumerConfiguration;
+consumer = new RawConsumerImpl(client, consumerConfiguration, 
consumerFuture, createTopicIfDoesNotExist);
+}
+
+
 @Override
 public String getTopic() {
 return consumerConfiguration.getTopicNames().stream()
diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java 
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
index d3fcc36a546..d9ddc00b2e8 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
@@ -44,6 +44,9 @@ import org.apache.pulsar.client.api.Producer;
 import org.apache.pulsar.client.api.PulsarClientException;
 import org.apache.pulsar.client.api.RawMessage;
 import org.apache.pulsar.client.api.RawReader;
+import org.apache.pulsar.client.api.SubscriptionInitialPosition;
+import org.apache.pulsar.client.api.SubscriptionType;
+import org.apache.pulsar.client.impl.conf.ConsumerConfigurationData;
 import org.apache.pulsar.common.api.proto.BrokerEntryMetadata;
 import org.apache.pulsar.common.api.proto.MessageMetadata;
 import org.apache.pulsar.common.policies.data.ClusterData;
@@ -56,6 +59,8 @@ import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import static 
org.apache.pulsar.client.impl.RawReaderImpl.DEFAULT_RECEIVER_QUEUE_SIZE;
+
 @Test(groups = "broker-impl")
 @Slf4j
 public class RawReaderTest extends MockedPulsarServiceBaseTest {
@@ -195,6 +200,36 @@ public class RawReaderTest extends 
MockedPulsarServiceBaseTest {
 reader.closeAsync().get(3, TimeUnit.SECONDS);
 }
 
+@Test
+public void testRawReaderWithConfigurationCreation() throws Exception {
+int numKeys = 10;
+
+String topic = "persistent://my-property/my-ns/" + 
BrokerTestUtil.newUniqueName("reader");
+

(pulsar) branch master updated: [improve] [broker] Support create RawReader based on configuration (#22280)

2024-03-18 Thread technoboy
This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new 34f8e0e9456 [improve] [broker] Support create RawReader based on 
configuration (#22280)
34f8e0e9456 is described below

commit 34f8e0e9456674cd6459105cd7a3619b113b06cf
Author: Hang Chen 
AuthorDate: Mon Mar 18 18:49:52 2024 +0800

[improve] [broker] Support create RawReader based on configuration (#22280)
---
 .../org/apache/pulsar/client/api/RawReader.java| 11 ++
 .../apache/pulsar/client/impl/RawReaderImpl.java   |  8 +
 .../apache/pulsar/client/impl/RawReaderTest.java   | 39 --
 3 files changed, 56 insertions(+), 2 deletions(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/client/api/RawReader.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/client/api/RawReader.java
index b7805c36b3b..55483708fdf 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/client/api/RawReader.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/client/api/RawReader.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import org.apache.pulsar.client.impl.PulsarClientImpl;
 import org.apache.pulsar.client.impl.RawReaderImpl;
+import org.apache.pulsar.client.impl.conf.ConsumerConfigurationData;
 
 /**
  * Topic reader which receives raw messages (i.e. as they are stored in the 
managed ledger).
@@ -43,6 +44,16 @@ public interface RawReader {
 return future.thenApply(__ -> r);
 }
 
+static CompletableFuture create(PulsarClient client,
+   
ConsumerConfigurationData consumerConfiguration,
+   boolean 
createTopicIfDoesNotExist) {
+CompletableFuture> future = new CompletableFuture<>();
+RawReader r = new RawReaderImpl((PulsarClientImpl) client,
+consumerConfiguration, future, createTopicIfDoesNotExist);
+return future.thenApply(__ -> r);
+}
+
+
 /**
  * Get the topic for the reader.
  *
diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java
index 3d7ad9f5865..5ac051d2271 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java
@@ -65,6 +65,14 @@ public class RawReaderImpl implements RawReader {
 consumer = new RawConsumerImpl(client, consumerConfiguration, 
consumerFuture, createTopicIfDoesNotExist);
 }
 
+public RawReaderImpl(PulsarClientImpl client, 
ConsumerConfigurationData consumerConfiguration,
+ CompletableFuture> consumerFuture,
+ boolean createTopicIfDoesNotExist) {
+this.consumerConfiguration = consumerConfiguration;
+consumer = new RawConsumerImpl(client, consumerConfiguration, 
consumerFuture, createTopicIfDoesNotExist);
+}
+
+
 @Override
 public String getTopic() {
 return consumerConfiguration.getTopicNames().stream()
diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java 
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
index d3fcc36a546..d9ddc00b2e8 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
@@ -44,6 +44,9 @@ import org.apache.pulsar.client.api.Producer;
 import org.apache.pulsar.client.api.PulsarClientException;
 import org.apache.pulsar.client.api.RawMessage;
 import org.apache.pulsar.client.api.RawReader;
+import org.apache.pulsar.client.api.SubscriptionInitialPosition;
+import org.apache.pulsar.client.api.SubscriptionType;
+import org.apache.pulsar.client.impl.conf.ConsumerConfigurationData;
 import org.apache.pulsar.common.api.proto.BrokerEntryMetadata;
 import org.apache.pulsar.common.api.proto.MessageMetadata;
 import org.apache.pulsar.common.policies.data.ClusterData;
@@ -56,6 +59,8 @@ import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import static 
org.apache.pulsar.client.impl.RawReaderImpl.DEFAULT_RECEIVER_QUEUE_SIZE;
+
 @Test(groups = "broker-impl")
 @Slf4j
 public class RawReaderTest extends MockedPulsarServiceBaseTest {
@@ -195,6 +200,36 @@ public class RawReaderTest extends 
MockedPulsarServiceBaseTest {
 reader.closeAsync().get(3, TimeUnit.SECONDS);
 }
 
+@Test
+public void testRawReaderWithConfigurationCreation() throws Exception {
+int numKeys = 10;
+
+String topic = "persistent://my-property/my-ns/" + 
BrokerTestUtil.newUniqueName("reader");
+
+   

Re: [PR] [improve] [broker] Support create RawReader based on configuration [pulsar]

2024-03-18 Thread via GitHub


Technoboy- merged PR #22280:
URL: https://github.com/apache/pulsar/pull/22280


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [I] IntelliJ checkstyle plugin dropped support for checkstyle 8.x, upgrade checkstyle to newer version [pulsar]

2024-03-18 Thread via GitHub


nodece commented on issue #22286:
URL: https://github.com/apache/pulsar/issues/22286#issuecomment-2003579905

   Upgrading the checkstyle is simpler, I agree with you. 
   
   Right now, the checkstyle is not strict, some places have extra indentation, 
while others have extra spaces, so I suggest using spotless.


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix][broker] Avoid execute prepareInitPoliciesCacheAsync if namespace is deleted [pulsar]

2024-03-18 Thread via GitHub


nodece commented on PR #22268:
URL: https://github.com/apache/pulsar/pull/22268#issuecomment-2003556927

   This test works fine, but 
`assertNull(service.getPoliciesCacheInit(namespaceName));` should be added 
after `service.prepareInitPoliciesCacheAsync(namespaceName).get();`.


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [I] IntelliJ checkstyle plugin dropped support for checkstyle 8.x, upgrade checkstyle to newer version [pulsar]

2024-03-18 Thread via GitHub


lhotari commented on issue #22286:
URL: https://github.com/apache/pulsar/issues/22286#issuecomment-2003550178

   > What do you think about https://github.com/diffplug/spotless?
   > 
   > This plugin supports check and format code, I think we can use spotless 
instead of checkstyle.
   > 
   > Once we notice that the code has been formatted by spotless on the master 
branch, we will be limited when doing cherry-pick operations. If we can 
double-check by spotless and checkstyle, this will be simpler.
   > 
   > We have this discussion thread on the 
[d...@pulsar.apache.org](mailto:d...@pulsar.apache.org), but I don't know this 
URL, which title is `[DISCUSS] Consistent code style (esp. ws/indent) and 
autotools`
   
   @nodece What you are proposing is a completely different thing. I don't 
think that we want to change the way how code is formatted in Pulsar right now. 
Such changes cause unnecessary code changes without valuable benefits. 
   
   We should simply upgrade checkstyle to a supported version right now. That 
requires migrating the configuration file slightly.
   
   
   
   


-- 
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-unsubscr...@pulsar.apache.org

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



(pulsar) branch branch-3.2 updated: [fix][ci] Enable CI for branch-3.2 (#22287)

2024-03-18 Thread technoboy
This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
 new 5fae440e58f [fix][ci] Enable CI for branch-3.2 (#22287)
5fae440e58f is described below

commit 5fae440e58fab38ea57a6e7ce1927f01427f951d
Author: Lishen Yao 
AuthorDate: Mon Mar 18 18:37:33 2024 +0800

[fix][ci] Enable CI for branch-3.2 (#22287)
---
 .github/workflows/pulsar-ci.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index 02496a82392..ba043ded210 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -22,6 +22,7 @@ on:
   pull_request:
 branches:
   - master
+  - branch-3.2
   schedule:
 # scheduled job with JDK 17
 - cron: '0 12 * * *'



Re: [PR] [fix][ci] Enable CI for branch-3.2 [pulsar]

2024-03-18 Thread via GitHub


Technoboy- merged PR #22287:
URL: https://github.com/apache/pulsar/pull/22287


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [PR] [fix][broker] Avoid execute prepareInitPoliciesCacheAsync if namespace is deleted [pulsar]

2024-03-18 Thread via GitHub


poorbarcode commented on PR #22268:
URL: https://github.com/apache/pulsar/pull/22268#issuecomment-2003487220

   > Do you check the test codes whether it is matched with the reproduced 
steps ?
   > I think the test can pass without this change @hanmz
   
   The test could not pass. The reproduce steps is below:
   
   - create a namespace.
   - set the `ns.policies.deleted` to `true` before the system topic 
`__change_events` was initialized.
   - try to create a new user topic; it will fail and get an error log 
`__change_events does not exist`
   
   But the fix will cause another issue in the following steps: 
   - Create a namespace.
   - Create a new user topic before the system topic `__change_events` is 
initialized.
   - The new topic will be initialized, and the topic-level policies will lead 
the topic to run with the wrong policies.
   
   BTW, the new issue above already exists before this PR, it also happens when 
the internal reader starts failing. See 
https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java#L351-L361
   
   


-- 
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-unsubscr...@pulsar.apache.org

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



Re: [I] publish sdist for pypi [pulsar-client-python]

2024-03-18 Thread via GitHub


BewareMyPower commented on issue #198:
URL: 
https://github.com/apache/pulsar-client-python/issues/198#issuecomment-2003409702

   It's hard to publish a source distribution currently unless rewriting the 
setup.py. I might not have time to look for a solution recently.
   
   BTW, what's the purpose of having a source distribution rather than using 
the wheels?


-- 
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-unsubscr...@pulsar.apache.org

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



  1   2   >