On Wednesday, September 30, 2015 at 4:27:27 PM UTC-7, Feng Xiao wrote:
>
> On Wed, Sep 30, 2015 at 3:32 PM, SashiM <mail.t...@gmail.com <javascript:>
> > wrote:
>
>> Hi, 
>>   We have been using the v3.0.0-alpha-3 library, and notice that the wire 
>> format for serializing maps slightly changed in the v3.0.0-beta-1 version. 
>> But the code using  beta library is able to parse the messages serialized 
>> using the alpha version. So, no big issues there. We just have to be 
>> careful about using SerializeToString() for comparing two protobufs for 
>> equality (and use the MessageDifferencer instead).
>>
>> Could you confirm if the wire format change is limited to maps.
>>
> It might not be intentional but there could be two possible changes to 
> maps' wireformat: 1. whether 0 values are serialized, 2. the order of 
> serialized elements. Both will affect the serialized bytes. They should not 
> affect the actual value of the proto though. No matter which case it is all 
> parsers must be able to parse the serialized result and produce the same 
> parsed proto. I'm not aware of any other changes that could affect 
> serialized bytes.
>
> Note that comparing proto serialized bytes is fragile especially after the 
> introduction of maps because protobuf maps are unordered and the same 
> content can yield different bytes even within the same process.
>

Thanks. This is probably what happened in my case too. Based on a cursory 
check of the binary data, it appears that the ordering of fields changed 
between versions. 
 

>  
>
>> Also, will the code linked using alpha version be able to parse a string 
>> that was generated by the beta version (In case of old code parsing the new 
>> serialized strings). We are using C++, and using maps with proto2 format 
>> files. 
>>
>
>  
>
>>
>> Sashi.
>>
>> -- 
>> 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 <javascript:>.
>> To post to this group, send email to prot...@googlegroups.com 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to