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/12/20 07:45:42 UTC

[GitHub] [pulsar] labuladong opened a new pull request, #18995: [fix][broker] forbid uploading BYTES schema with admin API

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

   <!--
   ### Contribution Checklist
     
     - PR title format should be *[type][component] summary*. For details, see *[Guideline - Pulsar PR Naming Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*. 
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   -->
   
   <!-- Either this PR fixes an issue, -->
   
   Fixes [#18825](https://github.com/apache/pulsar/issues/18825)
   
   ### Motivation
   
   Admin API can upload `BYTES` schema and store a `NONE` schema in the schema registry, which is inconsistent with the client side. After discussion, we decided to forbid users from uploading `BYTES` schema.
   
   Mail list: https://lists.apache.org/thread/672zmptfblwjmrf9z8336mk12r7csngf
   
   ### Modifications
   
   Add a check to reject `BYTES` schema upload.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [x] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. Please attach the local preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR description, or else your PR might not get merged. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] codelipenghui commented on a diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on code in PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#discussion_r1054358129


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaTest.java:
##########
@@ -185,6 +185,16 @@ private <T> void testSchemaInfoApi(Schema<T> schema,
 
     }
 
+    @Test
+    public void testCreateBytesSchema() {
+        // forbid admin api creating BYTES schema to be consistent with client side
+        try {
+            testSchemaInfoApi(Schema.BYTES, "schematest/test/test-BYTES");

Review Comment:
   Please add `fail()` here. Otherwise, the test will get passed if the bytes schema is uploaded.



-- 
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] labuladong commented on pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
labuladong commented on PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#issuecomment-1365684592

   PTAL @codelipenghui @congbobo184 


-- 
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] labuladong commented on pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
labuladong commented on PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#issuecomment-1366415981

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

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


[GitHub] [pulsar] codecov-commenter commented on pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#issuecomment-1361057226

   # [Codecov](https://codecov.io/gh/apache/pulsar/pull/18995?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18995](https://codecov.io/gh/apache/pulsar/pull/18995?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b6ce7a3) into [master](https://codecov.io/gh/apache/pulsar/commit/feb3cb4d7a484a284e06474713870609b220abfc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (feb3cb4) will **decrease** coverage by `9.57%`.
   > The diff coverage is `5.26%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/pulsar/pull/18995/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/pulsar/pull/18995?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18995      +/-   ##
   ============================================
   - Coverage     46.35%   36.78%   -9.58%     
   + Complexity     8939     1962    -6977     
   ============================================
     Files           597      209     -388     
     Lines         56858    14433   -42425     
     Branches       5905     1574    -4331     
   ============================================
   - Hits          26357     5309   -21048     
   + Misses        27616     8547   -19069     
   + Partials       2885      577    -2308     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | unittests | `36.78% <5.26%> (-9.58%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/18995?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...va/org/apache/pulsar/client/impl/ConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVySW1wbC5qYXZh) | `15.09% <0.00%> (+<0.01%)` | :arrow_up: |
   | [...he/pulsar/client/impl/MultiTopicsConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL011bHRpVG9waWNzQ29uc3VtZXJJbXBsLmphdmE=) | `22.80% <0.00%> (+0.01%)` | :arrow_up: |
   | [...ache/pulsar/client/impl/ZeroQueueConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL1plcm9RdWV1ZUNvbnN1bWVySW1wbC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...va/org/apache/pulsar/client/impl/ConsumerBase.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVyQmFzZS5qYXZh) | `21.51% <6.66%> (-0.42%)` | :arrow_down: |
   | [.../pulsar/client/impl/BatchMessageContainerImpl.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0JhdGNoTWVzc2FnZUNvbnRhaW5lckltcGwuamF2YQ==) | `55.95% <0.00%> (-1.02%)` | :arrow_down: |
   | [.../java/org/apache/pulsar/client/impl/ClientCnx.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NsaWVudENueC5qYXZh) | `29.97% <0.00%> (ø)` | |
   | [...a/org/apache/pulsar/client/impl/TableViewImpl.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL1RhYmxlVmlld0ltcGwuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [.../pulsar/broker/admin/impl/SchemasResourceBase.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9hZG1pbi9pbXBsL1NjaGVtYXNSZXNvdXJjZUJhc2UuamF2YQ==) | | |
   | [...rg/apache/pulsar/broker/delayed/bucket/Bucket.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9CdWNrZXQuamF2YQ==) | | |
   | [.../pulsar/broker/service/BrokerServiceException.java](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL0Jyb2tlclNlcnZpY2VFeGNlcHRpb24uamF2YQ==) | | |
   | ... and [388 more](https://codecov.io/gh/apache/pulsar/pull/18995/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   


-- 
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] Denovo1998 commented on a diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:
##########
@@ -114,6 +114,10 @@ public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
     }
 
     public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
+        if (SchemaType.BYTES.name().equals(payload.getType())) {
+            return CompletableFuture.failedFuture(new RestException(Response.Status.NOT_ACCEPTABLE,
+                    "Do not upload a BYTES schema, because it's the default schema type"));
+        }

Review Comment:
   @michaeljmarshall I think you can delete all the current schemas of the topic. At this time, it's schema defaults to bytes.



-- 
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] congbobo184 commented on a diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:
##########
@@ -114,6 +114,10 @@ public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
     }
 
     public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
+        if (SchemaType.BYTES.name().equals(payload.getType())) {
+            return CompletableFuture.failedFuture(new RestException(Response.Status.NOT_ACCEPTABLE,
+                    "Do not upload a BYTES schema, because it's the default schema type"));
+        }

Review Comment:
   BYTES schema doesn't need to upload, when to create producer or consumer with bytes schema, the broker will not check the schema compatibility check



-- 
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 diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
mattisonchao commented on code in PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#discussion_r1058001023


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:
##########
@@ -114,6 +114,10 @@ public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
     }
 
     public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
+        if (SchemaType.BYTES.name().equals(payload.getType())) {
+            throw new RestException(Response.Status.NOT_ACCEPTABLE,

Review Comment:
   Please return failed future to avoid additional` try-catch` when invoke this method.



-- 
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] congbobo184 merged pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
congbobo184 merged PR #18995:
URL: https://github.com/apache/pulsar/pull/18995


-- 
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] labuladong commented on a diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
labuladong commented on code in PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#discussion_r1055445675


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaTest.java:
##########
@@ -185,6 +185,16 @@ private <T> void testSchemaInfoApi(Schema<T> schema,
 
     }
 
+    @Test
+    public void testCreateBytesSchema() {
+        // forbid admin api creating BYTES schema to be consistent with client side
+        try {
+            testSchemaInfoApi(Schema.BYTES, "schematest/test/test-BYTES");

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

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


[GitHub] [pulsar] labuladong commented on pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
labuladong commented on PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#issuecomment-1362830917

   Oh there is another test case fail... Let me fix it.


-- 
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] michaeljmarshall commented on a diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:
##########
@@ -114,6 +114,10 @@ public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
     }
 
     public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
+        if (SchemaType.BYTES.name().equals(payload.getType())) {
+            return CompletableFuture.failedFuture(new RestException(Response.Status.NOT_ACCEPTABLE,
+                    "Do not upload a BYTES schema, because it's the default schema type"));
+        }

Review Comment:
   How does this work if the schema is not currently bytes and someone wants to change it to bytes?
   
   cc @mattisonchao @codelipenghui @congbobo184 @labuladong 



-- 
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] michaeljmarshall commented on a diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:
##########
@@ -114,6 +114,10 @@ public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
     }
 
     public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
+        if (SchemaType.BYTES.name().equals(payload.getType())) {
+            return CompletableFuture.failedFuture(new RestException(Response.Status.NOT_ACCEPTABLE,
+                    "Do not upload a BYTES schema, because it's the default schema type"));
+        }

Review Comment:
   How does this work if the schema is not currently bytes and someone wants to change it to bytes?



-- 
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] cbornet commented on pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

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

   This is a breaking change.
   It broke the Flink SQL Connector : https://github.com/streamnative/flink/issues/270


-- 
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] Technoboy- closed pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
Technoboy- closed pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API
URL: https://github.com/apache/pulsar/pull/18995


-- 
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 diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on code in PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#discussion_r1058010954


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:
##########
@@ -114,6 +114,10 @@ public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
     }
 
     public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
+        if (SchemaType.BYTES.name().equals(payload.getType())) {
+            throw new RestException(Response.Status.NOT_ACCEPTABLE,

Review Comment:
   Ah. Good catch!
   
   +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] labuladong commented on a diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

Posted by GitBox <gi...@apache.org>.
labuladong commented on code in PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#discussion_r1058022210


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:
##########
@@ -114,6 +114,10 @@ public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
     }
 
     public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
+        if (SchemaType.BYTES.name().equals(payload.getType())) {
+            throw new RestException(Response.Status.NOT_ACCEPTABLE,

Review Comment:
   Oh, understand, 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-unsubscribe@pulsar.apache.org

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