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/08 14:38:29 UTC
[GitHub] [pulsar] codelipenghui opened a new issue, #18825: [Bug] Upload BYTES schema but got NULL schema type
codelipenghui opened a new issue, #18825:
URL: https://github.com/apache/pulsar/issues/18825
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Version
Latest master
### Minimal reproduce step
root@stg-billing-broker-0:/pulsar# cat schema.txt
{
"type": "BYTES",
"schema": "",
"properties": {}
}
root@stg-billing-broker-0:/pulsar# ./bin/pulsar-admin schemas upload persistent://public/default/asher-test -f schema.txt
root@stg-billing-broker-0:/pulsar# ./bin/pulsar-admin schemas get persistent://public/default/asher-test
{
"version": 4,
"schemaInfo": {
"name": "asher-test",
"schema": "",
"type": "NONE",
"properties": {}
}
}
### What did you expect to see?
To keep consistent with the client side.
I think we should prevent the BYTES schema uploading
It's need to have discussion under the mailing list since it will change the existing behavior
### What did you see instead?
No
### Anything else?
No
### Are you willing to submit a PR?
- [ ] 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-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] labuladong commented on issue #18825: [Bug] Upload BYTES schema but got NULL schema type
Posted by GitBox <gi...@apache.org>.
labuladong commented on issue #18825:
URL: https://github.com/apache/pulsar/issues/18825#issuecomment-1344973594
mail list:
https://lists.apache.org/thread/672zmptfblwjmrf9z8336mk12r7csngf
--
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 issue #18825: [Bug] Upload BYTES schema but got NULL schema type
Posted by GitBox <gi...@apache.org>.
labuladong commented on issue #18825:
URL: https://github.com/apache/pulsar/issues/18825#issuecomment-1344132429
I think there are two solutions:
1. Forbid users to upload the `BYTES` schema. This is the easiest way, don't need to change much code. (recommended)
I tried Java client `Producer<byte[]> producer = client.newProducer(Schema.BYTES)`, this producer won't auto-create a `BYTES` schema. If we allow users to upload a `BYTES` schema, that may cause inconsistency.
2. Add a `BYTES` type schema, that needs to add `BYTES` type to proto file:
https://github.com/apache/pulsar/blob/90f67587e31cc0cfb27773f85f18d607c9c5c324/pulsar-broker/src/main/proto/SchemaRegistryFormat.proto#L25-L48
And `client.newProducer(Schema.BYTES)` should also create `BYTES` type schema in schema factory.
--
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 closed issue #18825: [Bug] Upload BYTES schema but got NULL schema type
Posted by GitBox <gi...@apache.org>.
congbobo184 closed issue #18825: [Bug] Upload BYTES schema but got NULL schema type
URL: https://github.com/apache/pulsar/issues/18825
--
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 issue #18825: [Bug] Upload BYTES schema but got NULL schema type
Posted by GitBox <gi...@apache.org>.
labuladong commented on issue #18825:
URL: https://github.com/apache/pulsar/issues/18825#issuecomment-1343765749
Assign to me please
--
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 issue #18825: [Bug] Upload BYTES schema but got NULL schema type
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #18825:
URL: https://github.com/apache/pulsar/issues/18825#issuecomment-1343904881
Thanks @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] labuladong commented on issue #18825: [Bug] Upload BYTES schema but got NULL schema type
Posted by GitBox <gi...@apache.org>.
labuladong commented on issue #18825:
URL: https://github.com/apache/pulsar/issues/18825#issuecomment-1344132153
The root cause is `BYTES` is a negative enum:
https://github.com/apache/pulsar/blob/90f67587e31cc0cfb27773f85f18d607c9c5c324/pulsar-client-api/src/main/java/org/apache/pulsar/common/schema/SchemaType.java#L146-L155
Then `convertFromDomainType` convert `BYTES` to `NONE`
https://github.com/apache/pulsar/blob/90f67587e31cc0cfb27773f85f18d607c9c5c324/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java#L592-L598
--
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