From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 45ADF24194 for ; Tue, 8 May 2018 13:24:35 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kLebAivFgNRd for ; Tue, 8 May 2018 13:24:35 -0400 (EDT) Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 013802087C for ; Tue, 8 May 2018 13:24:34 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 7/8] netbox: remove schema_version from requests References: <20180508160629.GB20248@atlas> From: Vladislav Shpilevoy Message-ID: Date: Tue, 8 May 2018 20:24:31 +0300 MIME-Version: 1.0 In-Reply-To: <20180508160629.GB20248@atlas> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, Konstantin Osipov On 08/05/2018 19:06, Konstantin Osipov wrote: > * Vladislav Shpilevoy [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.