apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.55k stars 3.97k forks source link

增加协议不修改已有协议的值 #460

Open Redfriday opened 6 years ago

Redfriday commented 6 years ago

目前brpc增加了thrift Protocol,但是这个Protocol是插入在Protocol num中间了,改变了以前协议的num值,可能会让使用动态库的场景向前兼容失效。一般我们会把动态库的更新和可执行程序(服务)的更新分开,这样如果协议enum值改了,我们只更新了程序或者只更新了brpc库,都会导致.h和.so里的enum值对不上,而在这样的情况下,保证.so和程序同时更新又很困难。

jamesge commented 6 years ago

协议这个具体case是可以解决的。但是so这种模式就是要求ABI兼容,恐怕是难以做到的。

jamesge commented 6 years ago

协议的enum值会影响解析顺序,解析顺序是重要的。

On Wed, Aug 22, 2018 at 4:49 PM Redfriday notifications@github.com wrote:

为什么不选择直接在后面增加协议,保持以前协议的enum值不变?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brpc/brpc/issues/460#issuecomment-414960331, or mute the thread https://github.com/notifications/unsubscribe-auth/AGQyh6Q3TRFolNhcyH02m-ej9kI2ncjyks5uTRsugaJpZM4WHLxM .