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 DF0BC207DC for ; Wed, 27 Jun 2018 15:50:09 -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 mBVUTHpwj7CY for ; Wed, 27 Jun 2018 15:50:09 -0400 (EDT) Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (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 93ADE1FAB3 for ; Wed, 27 Jun 2018 15:50:09 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 2/2] Fix discovery/reconfigure race References: <7790cb4a-ff5e-99bf-03bc-996fea379185@tarantool.org> From: Alex Khatskevich Message-ID: <8fce9646-0b30-1d67-3552-72a525836f5c@tarantool.org> Date: Wed, 27 Jun 2018 22:50:01 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US 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: Vladislav Shpilevoy , tarantool-patches@freelists.org >>   ... >> +-- >> +-- Check route_map is not filled with old replica objects after >> +-- reconfigure. >> +-- >> +-- Simulate long `callro`. >> +vshard.router.internal.errinj.ERRINJ_LONG_DISCOVERY = true; >> +--- >> +... >> +while not vshard.router.internal.errinj.ERRINJ_LONG_DISCOVERY == >> 'waiting' do > > 1. Why 'not value == needed_value'? Why not 'value ~= needed_value'? > And how > does it work? I checked this thing in Lua and got these results: > > Please, investigate why your test passes even without this cycle again. Priorities... Fixed. Test was passing because it always passes on the new implementation, and fails only on old implementation and  this cycle makes the probability of failure 100% in this case. After your finding, I have returned the old implementation and made sure that it really fails. > >> +    vshard.router.discovery_wakeup() >> +    fiber.sleep(0.02) >> +end; >> +--- >> +... >> +vshard.router.cfg(cfg); >> +--- >> +... >> +route_map = vshard.router.internal.route_map >> +for bucket_id, _ in pairs(route_map) do >> +    route_map[bucket_id] = nil >> +end; > > 2. Why not just 'vshard.router.internal.route_map = {}' ? Fixed