[tarantool-patches] Re: [PATCH 7/8] netbox: remove schema_version from requests

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue May 8 20:24:31 MSK 2018



On 08/05/2018 19:06, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [18/04/16 21:44]:
> 
>> Schema_version was used in netbox to update local box-like
>> schema. The box-like schema makes able to access spaces and
>> indexes via connection object.
>>
>> It was updated each time, when a response from a server is
>> received with a schema version non-equal to the local value.
>>
>> But there was no reason why a schema version is needed in a
>> request. It leads to ER_WRONG_SCHEMA_VERSION error sometimes,
>> but netbox on this error just resends the same request again. The
>> same behaviour can be reached with just no sending any schema
>> version to a server.
> 
> As far as I can see you removed all checks for schema_version and
> never re-fetch the schema after a connection is established,
> despite what you write in the comment.
> 
> Please explain how you ever check that schema has changed when
> performing a request.

As I already explained you in Telegram, this check, even before
my commit, was done inside netbox state machine.

Look at the iproto_sm - this function on each response decodes the former
and checks schema version. You may think it is called only once from
iproto_schema_sm, that is called from iproto_auth_sm, but it is wrong.

Iproto_sm is just one state of the state machine. The machine can returns
into it again and again like this:

protocol_sm -> iproto_auth_sm -> iproto_schema_sm -> iproto_sm
-> iproto_sm ->
-> iproto_sm ->
...
-> iproto_sm ->
-> iproto_schema_sm ->
-> iproto_sm ->
...

These steps are executed inside the worker fiber.





More information about the Tarantool-patches mailing list