[Tarantool-patches] [PATCH 3/6] iproto: Add negotiation phase

lvasiliev lvasiliev at tarantool.org
Wed Mar 25 10:35:41 MSK 2020



On 24.03.2020 23:02, Konstantin Osipov wrote:
> * Leonid Vasiliev <lvasiliev at tarantool.org> [20/03/24 16:02]:
>> The negotiation phase has been added to IPROTO
>>
>> For possibility to have a custom parameters of session the negotiation
>> phase has been added. This is necessary to enable the transmission of
>> an error in different formats(depending on the choice of the client).
>>
>> @TarantoolBot document
>> Title: IPROTO: The negatiation phase
>> For backward compatibility of the data transmission format,
>> the negotiation phase has been added to IPROTO.
>> A new key (IPROTO_NEGOTIATION) has been added to IPROTO command codes.
>> NEGOTIATION BODY: CODE = 0x0E
>> +==========================+
>> |                          |
>> |  NEGOTIATION PARAMETERS  |
>> |                          |
>> +==========================+
>>             MP_MAP
>> Session negotiation parameters are a map with keys like ERROR_FORMAT_VERSION ...
>> The response is a map with all stated negotiation parameters.
>> So, for work with the new format of errors, it is necessary to perform the negotiation phase,
>> otherwise errors will be transmitted in the old format (by default).
> 
> Why not make it a key in IPROTO_AUTH, and require a separate
> round-trip?
Hi. Because it's not a part of AAA.
> 
> Why have it at all and not look at server version, which is part
> of the greeting already?
> 
The cause is backward compatibility.
For example: a client application may expect an error as a string 
(IPROTO_OK case) and instead of which it will receive an error as an 
“object”. A greeting is sent only from the server side to the client, 
but the server must know what format should be used to send errors (what 
format does the client expect).


More information about the Tarantool-patches mailing list