You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/01/19 07:21:49 UTC
[GitHub] [pulsar] gaozhangmin opened a new pull request #13831: NPE when get isAllowAutoUploadSchema
gaozhangmin opened a new pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831
### Motivation
there were some potential NPE bug when get null value by pulsar-admin
### Modifications
1、set default value true to is_allow_auto_update_schema in Policies as same as ServiceConfiguration
2、changes from boolean to Boolean, long to Long, prevent potential NPE.
Need to update docs?
- [ ] `doc-required`
(If you need help on updating docs, create a doc issue)
- [ ] `no-need-doc`
(Please explain why)
- [ ] `doc`
(If this PR contains doc 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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787509878
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
Sorry I mean, after introduces this change, the Admin will get an NPE? The Admin also define the return type as `long`
```
long getOffloadThreshold(String namespace) throws PulsarAdminException;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] github-actions[bot] commented on pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#issuecomment-1016157957
@gaozhangmin:Thanks for providing doc info!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r789520575
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -2382,6 +2382,9 @@ protected void internalSetSchemaValidationEnforced(boolean schemaValidationEnfor
protected boolean internalGetIsAllowAutoUpdateSchema() {
validateNamespacePolicyOperation(namespaceName, PolicyName.SCHEMA_COMPATIBILITY_STRATEGY,
PolicyOperation.READ);
+ if (getNamespacePolicies(namespaceName).is_allow_auto_update_schema == null) {
+ return pulsar().getConfig().isAllowAutoUpdateSchemaEnabled();
+ }
Review comment:
Hmmm, yes. No good choice here. In principle, we should not return the broker-level configuration. I think we can correct the API in v3 REST API to make sure returns null if the namespace level doesn't have the `AllowAutoUpdateSchema`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] mattisonchao commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
mattisonchao commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r789583975
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -2382,6 +2382,9 @@ protected void internalSetSchemaValidationEnforced(boolean schemaValidationEnfor
protected boolean internalGetIsAllowAutoUpdateSchema() {
validateNamespacePolicyOperation(namespaceName, PolicyName.SCHEMA_COMPATIBILITY_STRATEGY,
PolicyOperation.READ);
+ if (getNamespacePolicies(namespaceName).is_allow_auto_update_schema == null) {
+ return pulsar().getConfig().isAllowAutoUpdateSchemaEnabled();
+ }
Review comment:
+1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] Shoothzj commented on pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
Shoothzj commented on pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#issuecomment-1016974185
> > I think that we may make a break change of client API. before we change: client throws an exception after we change: client raised an NPE
> > Am I correct? cc @codelipenghui @mattisonchao
>
> I think print null value by pulsar-admin client has no problem We don't need to make this change.
People can use pulsar admin not only in terminal, can use it in code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] Shoothzj commented on pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
Shoothzj commented on pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#issuecomment-1016297971
I think that we may make a break change of client API.
before we change: client throws an exception
after we change: client raised an NPE
Am I correct?
cc @codelipenghui @mattisonchao
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787540768
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1630,7 +1630,7 @@ public void setSchemaCompatibilityStrategy(
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
- public boolean getIsAllowAutoUpdateSchema(
+ public Boolean getIsAllowAutoUpdateSchema(
Review comment:
default value in policies is null, if you don't set this value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#issuecomment-1018118695
@codelipenghui PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#issuecomment-1018102224
/pulsarbot run-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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787578559
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1630,7 +1630,7 @@ public void setSchemaCompatibilityStrategy(
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
- public boolean getIsAllowAutoUpdateSchema(
+ public Boolean getIsAllowAutoUpdateSchema(
Review comment:
No, `bin/pulsar-admin namespaces get-deduplication public/default`
this command would print value null if default value is null. I referenced this. I think it's Reasonable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaoran10 commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaoran10 commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r789544935
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -2382,6 +2382,9 @@ protected void internalSetSchemaValidationEnforced(boolean schemaValidationEnfor
protected boolean internalGetIsAllowAutoUpdateSchema() {
validateNamespacePolicyOperation(namespaceName, PolicyName.SCHEMA_COMPATIBILITY_STRATEGY,
PolicyOperation.READ);
+ if (getNamespacePolicies(namespaceName).is_allow_auto_update_schema == null) {
+ return pulsar().getConfig().isAllowAutoUpdateSchemaEnabled();
+ }
Review comment:
Maybe we could add the param `applied` for getting policies methods, such as topic policies. If the param `applied` is true, the method returns an applied value or returns a setting value in namespace level(if not set, the value is null).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui merged pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787511292
##########
File path: pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/Policies.java
##########
@@ -107,7 +107,7 @@
public SchemaCompatibilityStrategy schema_compatibility_strategy = SchemaCompatibilityStrategy.UNDEFINED;
@SuppressWarnings("checkstyle:MemberName")
- public Boolean is_allow_auto_update_schema = null;
+ public Boolean is_allow_auto_update_schema = true;
Review comment:
We can't set it to true because the broker level config might be false
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787523638
##########
File path: pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/Policies.java
##########
@@ -107,7 +107,7 @@
public SchemaCompatibilityStrategy schema_compatibility_strategy = SchemaCompatibilityStrategy.UNDEFINED;
@SuppressWarnings("checkstyle:MemberName")
- public Boolean is_allow_auto_update_schema = null;
+ public Boolean is_allow_auto_update_schema = true;
Review comment:
I will revert 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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787488680
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1630,7 +1630,7 @@ public void setSchemaCompatibilityStrategy(
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
- public boolean getIsAllowAutoUpdateSchema(
+ public Boolean getIsAllowAutoUpdateSchema(
Review comment:
default value in policies is null. beacuse
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1630,7 +1630,7 @@ public void setSchemaCompatibilityStrategy(
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
- public boolean getIsAllowAutoUpdateSchema(
+ public Boolean getIsAllowAutoUpdateSchema(
Review comment:
default value in policies is null. because
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
same
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] mattisonchao commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
mattisonchao commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787486218
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
Maybe we need to think about why the ``internalGetOffloadThreshold method returns null`` , because null is an incorrect result.
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1630,7 +1630,7 @@ public void setSchemaCompatibilityStrategy(
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
- public boolean getIsAllowAutoUpdateSchema(
+ public Boolean getIsAllowAutoUpdateSchema(
Review comment:
Maybe we need to think about why the ``internalGetIsAllowAutoUpdateSchema`` method returns null , because null is an incorrect result.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787507968
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
pulsar admin client will get internal server error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] mattisonchao commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
mattisonchao commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787530808
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
@gaozhangmin
I'm very confused, what does it mean to return null if an api needs to return a number.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] mattisonchao commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
mattisonchao commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787572469
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1630,7 +1630,7 @@ public void setSchemaCompatibilityStrategy(
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
- public boolean getIsAllowAutoUpdateSchema(
+ public Boolean getIsAllowAutoUpdateSchema(
Review comment:
In my opinion, we need to return a boolean when we define an api to return a boolean. If not, it is an exception state.
What do you think about 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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#issuecomment-1016301933
> I think that we may make a break change of client API. before we change: client throws an exception after we change: client raised an NPE
>
> Am I correct? cc @codelipenghui @mattisonchao
I think print null value by pulsar-admin client has no problem We don't need to make this change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] gaozhangmin commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787523419
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
We also need make a change 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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] github-actions[bot] commented on pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#issuecomment-1016153527
@gaozhangmin:Thanks for your contribution. For this PR, do we need to update docs?
(The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] mattisonchao commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
mattisonchao commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787486218
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
Maybe we need to think about why the ``internalGetOffloadThreshold`` method returns null, because null is an incorrect result.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] Shoothzj commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
Shoothzj commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r788237703
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
+1, people can use `pulsar-admin` not only in the terminal, but the code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#issuecomment-1018365314
@gaozhangmin Looks like https://github.com/apache/pulsar/pull/12786(have not released yet) introduced the problem, but from the stack you have provided, looks like it happens in 2.9.1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787505379
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
But this will break the PulsarAdmin?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] mattisonchao commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
mattisonchao commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787531758
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1630,7 +1630,7 @@ public void setSchemaCompatibilityStrategy(
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
- public boolean getIsAllowAutoUpdateSchema(
+ public Boolean getIsAllowAutoUpdateSchema(
Review comment:
@gaozhangmin
same to above, why return null if an api needs to return a boolean.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] mattisonchao commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
mattisonchao commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787608454
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1630,7 +1630,7 @@ public void setSchemaCompatibilityStrategy(
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
- public boolean getIsAllowAutoUpdateSchema(
+ public Boolean getIsAllowAutoUpdateSchema(
Review comment:
@gaozhangmin Ok, i see.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on a change in pull request #13831: NPE when get isAllowAutoUploadSchema
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #13831:
URL: https://github.com/apache/pulsar/pull/13831#discussion_r787791263
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -1489,7 +1489,7 @@ public void deleteCompactionThreshold(@PathParam("tenant") String tenant,
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
- public long getOffloadThreshold(@PathParam("tenant") String tenant,
+ public Long getOffloadThreshold(@PathParam("tenant") String tenant,
Review comment:
Can we try to return a non-null value to the client? Otherwise, we might introduce regression and compatibility issues after users upgrade to the server to a new version but the Admin is an old version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org