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 89555278BE for ; Fri, 20 Jul 2018 10:15:22 -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 yc6AOtlcEx1w for ; Fri, 20 Jul 2018 10:15:22 -0400 (EDT) Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) (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 BFB3320FC9 for ; Fri, 20 Jul 2018 10:15:21 -0400 (EDT) Received: from [185.6.245.156] (port=40767 helo=msk-wire-v_shpilevoy-v.shpilevoy.mail.msk) by smtp16.mail.ru with esmtpa (envelope-from ) id 1fgWBj-0006FF-VD for tarantool-patches@freelists.org; Fri, 20 Jul 2018 17:15:20 +0300 Subject: [tarantool-patches] Re: [PATCH 2/3] Complete module reload References: <80d76a63-7435-4148-e0ce-37ed2daee19b@tarantool.org> <7c9af9eb-7fe9-e07c-2589-56fc192e6614@tarantool.org> <8a41845e-5662-b908-b58a-41a7073710f9@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Fri, 20 Jul 2018 17:15:19 +0300 MIME-Version: 1.0 In-Reply-To: <8a41845e-5662-b908-b58a-41a7073710f9@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit 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 Thanks for the fixes! See 2 comments below. On 20/07/2018 14:34, Alex Khatskevich wrote: > here is a full diff: > > commit cd3740a45322458cde10e67f8018bc4787f443aa > Author: AKhatskevich > Date:   Sat Jun 9 17:23:40 2018 +0300 > >     Complete module reload > >     In case one need to upgrade vshard to a new version, this commit >     improves reload mechanism to allow to do that for a wider variety of >     possible changes (between two versions). > >     Changes: >      * introduce cfg option `connection_outdate_delay` >      * improve reload mechanism >      * add `util.async_task` method, which runs a function after a >        delay >      * delete replicaset:rebind_connections method as it is replaced >        with `rebind_replicasets` which updates all replicasets at once > >     Reload mechanism: >      * reload all vshard modules >      * create new `replicaset` and `replica` objects >      * reuse old netbox connections in new replica objects if >        possible >      * update router/storage.internal table >      * after a `connection_outdate_delay` disable old instances of >        `replicaset` and `replica` objects > >     Reload works for modules: >      * vshard.router >      * vshard.storage > >     Here is a module reload algorithm: >      * old vshard is working >      * delete old vshard src >      * install new vshard >      * call: package.loaded['vshard.router'] = nil >      * call: old_router = vshard.router -- Save working router copy. >      * call: vshard.router = require('vshard.router') >      * if require fails: continue using old_router >      * if require succeeds: use vshard.router > >     In case reload process fails, old router/storage module, replicaset and >     replica objects continue working properly. If reload succeeds, all old >     objects would be deprecated. > >     Extra changes: >      * introduce MODULE_INTERNALS which stores name of the module >        internal data in the global namespace > >     Part of #112 > > diff --git a/test/router/reload.result b/test/router/reload.result > index 47f3c2e..71f82b2 100644 > --- a/test/router/reload.result > +++ b/test/router/reload.result > @@ -174,6 +174,132 @@ vshard.router.module_version() >  check_reloaded() >  --- >  ... > +-- > +-- Outdate old replicaset and replica objets. 1. Typo: objets. Please, check the spelling in a text editor before sending the patch. > diff --git a/vshard/replicaset.lua b/vshard/replicaset.lua > index 99f59aa..f6e971b 100644 > --- a/vshard/replicaset.lua > +++ b/vshard/replicaset.lua > @@ -21,6 +21,7 @@ >  --                                  requests to the replica>, >  --             net_sequential_fail =  --                                    requests to the replica>, > +--             outdated = nil/true, 2. In scope of the point 11 of the previous review I asked you to rename it to 'is_outdated', since it is a flag. >  --          } >  --      }, >  --      master = ,