Compatibility error on adding sub message type in existing proto file

236 views
Skip to first unread message

Komal Kamble

unread,
Nov 2, 2022, 10:03:35 AM11/2/22
to Protocol Buffers
Hello ProtocolBufferSupport team,

If I have a proto file with multiple sub-message types defined and If I want to add more sub-message types in the same file I am getting BACKWARD and FORWARD compatibility errors.

I am using com.github.os72:protoc-jar-maven-plugin:3.11.4 plugin in java module to compile proto files and kafka-protobuf-provider:6.1.6 for ProtobufSchema object. 

The query is getting compatibility errors is it correct behavior or not?

I didn't find any documentation in protocol-buffer user guide regarding adding more sub-message types in the existing proto file. 

Could you please help me to understand the standard behavior of the protocol buffer? 



Adam Cozzette

unread,
Nov 2, 2022, 2:11:41 PM11/2/22
to Komal Kamble, Protocol Buffers
Adding more message types to the proto file is fine and has no compatibility issues. Can you say more about the error you're getting?

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/8373c01f-8e61-4469-80e5-82a859035f2dn%40googlegroups.com.

Komal Kamble

unread,
Dec 1, 2022, 7:21:28 AM12/1/22
to Adam Cozzette, Protocol Buffers

Hello Adam Cozzette,
We are getting Found incompatibility change error of type MESSAGE_REMOVED.


On 02-Nov-2022, at 11:41 PM, Adam Cozzette <acoz...@google.com> wrote:



Adam Cozzette

unread,
Dec 4, 2022, 9:35:50 AM12/4/22
to Komal Kamble, Protocol Buffers
I don't think we maintain any code that returns that kind of error. Do you know where that error is coming from? Is it from some external protobuf compatibility checker?

Robert Yokota

unread,
Dec 4, 2022, 12:41:18 PM12/4/22
to Adam Cozzette, Komal Kamble, Protocol Buffers
Hi,

I believe this is coming from the Confluent compatibility checker.  (I work for Confluent.)

A forward compatibility check is just a backward compatibility check with the arguments reversed.  Since removing a message is not backward compatible, adding a message is not forward compatible.

Hope that helps,
Robert

Komal Kamble

unread,
Feb 3, 2023, 11:50:07 AM2/3/23
to Robert Yokota, Adam Cozzette, Protocol Buffers
Hello Robert,

Could you please elaborate on reason of having check for message_removed? 
Adding new message doesn’t mean compatibility is lost. 

Sent from my iPhone

On 04-Dec-2022, at 9:41 AM, Robert Yokota <rayo...@gmail.com> wrote:



Robert Yokota

unread,
Feb 4, 2023, 1:57:29 PM2/4/23
to Komal Kamble, Adam Cozzette, Protocol Buffers
Hi Komal,

Forward compatibility is broken as older consumers won't understand the new message.

Regards,
Robert

Marc Gravell

unread,
Feb 4, 2023, 6:24:27 PM2/4/23
to Robert Yokota, Komal Kamble, Adam Cozzette, Protocol Buffers
That is ... contextual, though; an unexpected sub-message can still, depending on the implementation, be round-tripped and potentially even inspected via reflection. It won't usually *break* code, just like adding any new field. It really depends how strict you're being in you'd definitions of compatibility.

Reply all
Reply to author
Forward
0 new messages