visortelle opened a new issue, #19385: URL: https://github.com/apache/pulsar/issues/19385
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar. ### Motivation The current implementation checks only for changing a root message name. https://github.com/apache/pulsar/blob/34c18704ce759922ce45820321af44b382a28e10/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/ProtobufNativeSchemaCompatibilityCheck.java#L67-L72 It's definitely not enough. For example, these schemas won't be compatible due to the changed field type: ```proto message Person { int32 age = 1; string name = 2; } ``` ```proto message Person { int64 age = 1; string name = 2; ``` Of course, it's the simplest case. There are many more of them. ### Solution - Display in Pulsar docs that schema-compatibility-related policies don't work for `PROTOBUF_NATIVE` schema type. 👎 - Implement it in Java on your own. 👍 Probably take [buf.build](https://buf.build/) rules is a good point to start. https://github.com/bufbuild/buf/blob/8b53bf721f3e21eedc3aef3eb0730fdf56d38064/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/bufbreakingcheck.go#L338 ### Alternatives - Wait for a miracle 🪄 from Protobuf maintainers. - Wait for a contribution from Apache Pulsar contributors. ### Anything else? I understand why it has been implemented this way. By quick googling, I didn't find any ready-to-use JVM-based Protobuf compatibility checkers. In comparison, Avro has the `org.apache.avro.SchemaValidator` package. ### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
