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 3AA966EC6F; Fri, 26 Feb 2021 11:41:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3AA966EC6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614328905; bh=Ai3rtPInLs0GaN7SbVIi8h/gWSBTnrqLUO/lx1UPxiE=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uiOamCN5nLvH0lxEgLF6lahYG5c65AbtNS7M7TuojDQl6+3dMmsS/6L9kQsJ2O5PF 7jEbqr+2doXyAH8IdIjpf2cORqYIov2+Id4on37zvxOHb/o7Gw4UkhSUADe9TGROX2 9vK4cNWQ55+t3EaQmXT2sl2x66VrXuM3kx7nh9oQ= Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 222F56EC6F for ; Fri, 26 Feb 2021 11:41:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 222F56EC6F Received: by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1lFYgw-0002Ya-Mg; Fri, 26 Feb 2021 11:41:43 +0300 Date: Fri, 26 Feb 2021 08:41:36 +0000 To: Serge Petrenko Message-ID: <20210226084136.h7jtkw3jlysv6atj@tarantool.org> References: <20210212112541.27561-1-sergepetrenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210212112541.27561-1-sergepetrenko@tarantool.org> User-Agent: NeoMutt/20170113 (1.7.2) X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD975C3EC174F5669228C980786C9DBA186ED94931C77F7596E182A05F538085040A01597F0A6DFA192FC0B856335980EBB66320E383D455CD6C9E5D280B532BEBF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AC4684DF4EC4B256EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AB1265E79AFCDEF58638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95CDDE882590F889B1C49562E8B840A9866A9554B53841B5D69A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE77FFCE1C639F4728C9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3A367EA73E0D98AAD117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF92AF71FE74A2456CBA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6FB809350A470D56D76E601842F6C81A1F004C90652538430CDED94BCBF13EF3B93EC92FD9297F6718AA50765F790063745CB11FDFECF9830A7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89F08401973E8A7E3E9156CCFE7AF13BCA4B5C8C57E37DE458B4C7702A67D5C3316FA3894348FB808DBAF038BB36E94EA6B574AF45C6390F7469DAA53EE0834AAEE X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46DF3FFF754868DC88C355D89D7DBCDD132 X-C1DE0DAB: 0D63561A33F958A5D837878AD0740757BC71BA39BC440466A51CD1EBAF773589D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75968C9853642EB7C3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3482189E76C6218D8F369F94CEC6F12FE22B6224EABFE331D02F1A6560B1EDCADE12EC572F69D85FF01D7E09C32AA3244C550E6826B57B9A183F9EEAFE334472767C0C08F7987826B9927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj8mqzvzJVEn2TKwTkUrmJlA== X-Mailru-Sender: 05EB39F83D09414F9B5D7F52D7CDFDD2587D7D6DD2F506A5A7CF441BF4E60A02479CADF0E6545EC4CA16B95394F0DD5CE99530A0C0F27B5268329DCED823713783C0E760C018FF54112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] relay: yield explicitly every N sent rows 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: Kirill Yukhin via Tarantool-patches Reply-To: Kirill Yukhin Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hello, On 12 фев 14:25, Serge Petrenko via Tarantool-patches wrote: > While sending a WAL, relay only yields in `coio_write_xrow`, once it > sees the socket isn't ready for writes. > It may happen that the socket is always ready for a long period of time, > and relay doesn't yield at all while recovering a whole .xlog file. This > may take well more than a minute. > During this period of time, relay doesn't read replica's ACKs due to > relay reader fiber not being scheduled, and once the reader is finally > live it times out immediately, causing the replica to reconnect. > > The problem is amplified by the fact that replica waits for > replication_timeout to pass prior to reconnecting, which lets master > pile up even more ready WALs, and effectively making it impossible for > the replica to sync. > > To fix the problem let's yield explicitly in relay_send_row every > WAL_ROWS_PER_YIELD rows. The same is already done in local recovery, and > serves the same purpose: to not block the event loop for too long. > > Closes #5762 > --- > No test provided as the fix is quite obvious but rather hard to test > automatically. > https://github.com/tarantool/tarantool/issues/5762 > https://github.com/tarantool/tarantool/tree/sp/gh-5762-relay-yield I've checked your patch into 2.6, 2.6 and master. -- Regards, Kirill Yukhin