From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 7D3FB6F3C7; Fri, 26 Mar 2021 23:44:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7D3FB6F3C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616791499; bh=0q8b1HXcUGWf9mIku01tliew+1w6EpCPmuZOzceqlBI=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=E2bdIttNeHsH1VhSd1vM7Ix+F6DI3ZxCfPwX2YTBb+Vzf6pVJ4U2JJknxhcm6B6PT fBR6SHtTx9k06bqA8tSQMJnq41qN94xAENDq1hxw6y7mHMI8SduWnMG53oL1jZSY7h H3J1GR8gY2CY29GMoNxzFYy29qYoOa+lDWBWrorE= Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A7D5A6F3C7 for ; Fri, 26 Mar 2021 23:44:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A7D5A6F3C7 Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1lPtKD-0003kG-03; Fri, 26 Mar 2021 23:44:57 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <12bf66a77b755eaadc09665ede9fbcde0516a7a4.1616588119.git.sergepetrenko@tarantool.org> Message-ID: <2ab0844e-84b4-6701-15ab-652ab6f18075@tarantool.org> Date: Fri, 26 Mar 2021 21:44:56 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <12bf66a77b755eaadc09665ede9fbcde0516a7a4.1616588119.git.sergepetrenko@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32947A0146560F8BA709E798FFD99D1B1662182A05F5380850406F292F8FD52279598740313CF5E3AAF60ECA44C427B539E75293FC9A8AF64014 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE758E3775C3D7FDEE4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F5B2F26146BDF5648638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C5DD32608FC869F5D0ACF1934666A5E10B00A9626FE6B8D44A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7850F8B975A76562C9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C33B72D73EA5828B68117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF362DC704A2970D9DBA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B63F1125065D7CB36176E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249B372FE9A2E580EFC725E5C173C3A84C3EBF4D8D28E8B690335872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824AC8B6CDF511875BC4E8F7B195E1C978313B3FFF5A3E1FC1BD99D32A3E8D98C3BE X-C1DE0DAB: 0D63561A33F958A5C94103A573A5DD9DB7C30BE36183EB0755B26239ED6D656AD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342833AC5E8E9ACF1CB17030CBB9A114F98921C279A55DBE2D058DD5B6CBD9A6949CF8A61D4F4A1B481D7E09C32AA3244C42663FCCC9A6DF3DD116A9563EC74C736C24832127668422FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojapPp7P/VpAhBrj+WAoE1RA== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA31103CAFE7DA8A0CA5F8B2E54049EA16CAC54A9500AE01DFC9AF07784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 1/7] replication: fix a hang on final join retry X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for working on this! > diff --git a/src/box/applier.cc b/src/box/applier.cc > index 5a88a013e..326cf18d2 100644 > --- a/src/box/applier.cc > +++ b/src/box/applier.cc > @@ -566,9 +566,16 @@ applier_register(struct applier *applier) > row.type = IPROTO_REGISTER; > coio_write_xrow(coio, &row); > > - applier_set_state(applier, APPLIER_REGISTER); > + /* > + * Register may serve as a retry for final join. Set corresponding > + * states to unblock anyone who's waiting for final join to start or > + * end. > + */ > + applier_set_state(applier, was_anon ? APPLIER_REGISTER : > + APPLIER_FINAL_JOIN); > applier_wait_register(applier, 0); > - applier_set_state(applier, APPLIER_REGISTERED); > + applier_set_state(applier, was_anon ? APPLIER_REGISTERED : > + APPLIER_JOINED); > applier_set_state(applier, APPLIER_READY); Hm. I don't understand. Transition from anon to non-anon leads to re-creation of all appliers. It calls box_sync_replication() and creates new struct applier objects. How is it possible that during one life of a reader fiber it manages to see 2 states and is not terminated? Also could you please provide a test? Maybe it would be easier to see what is happening then.