[erlang-questions] 19.x <-> 18.x wire protocol incompatibility ?

Sverker Eriksson sverker.eriksson@REDACTED
Wed Oct 12 19:54:53 CEST 2016


This is a bug. ei_connect_xinit() should do that masking for you.


The idea was to introduce larger creation values in a stepwise
protocol compatible way.  OTP 19 should understand and forward
ERL_NEW_PID_EXT's but never create them. And then in some future
major release start using large creation values encoded
with ERL_NEW_PID_EXT.

 From the release notes of 19.0:

OTP-13488    Application(s): erl_interface, erts, jinterface

                Handle terms (pids,ports and refs) from nodes with a
                'creation' value larger than 3. This is a preparation
                of the distribution protocol to allow OTP 19 nodes to
                correctly communicate with future nodes (20 or higher).
                The 'creation' value differentiates different
                incarnations of the same node (name).


/Sverker, Erlang/OTP


On 10/12/2016 07:11 PM, Alexandre Snarskii wrote:
> Hi!
>
> Got into interesting 'does not work' situation while connecting newly
> deployed c-node (compiled with otp 19.0 libraries) with older 18.3
> erlang node: nodes were unable to communicate with messages
>
> 2016-10-12 18:43:28.404 [warning] emulator '<erlang node name>' got a
>    corrupted external term from '<c-node name>' on distribution channel ...
>
> logged on erlang side.
>
> After some research, root cause was isolated: C-node was initialized using
> ei_connect_xinit with random() % 16 for its creation id. In 18.x, Pid of
> C-node was encoded as ERL_PID_EXT and used only two lower bits of creation id.
> However, in 19.x there is a new Pid wire presentation, ERL_NEW_PID_EXT, which
> encodes all 32 bits of creation id. Worse yet, this presentation is
> automatically selected for encoding any Pid with creation id > 3, and,
> as this presentation is not known by older 18.x nodes, this leads to
> connection drop.
>
> Solution: if you expect your C-nodes to communicate with pre-19.x erlang
> nodes, you may use only values 0..3 for creation id. In my case I just
> replaced random() % 16 with random() % 4.
>   
> Question: may be it makes sense to document this wire protocol incompatibility
> somewhere ?
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list