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 03CF27030D; Mon, 13 Sep 2021 11:50:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 03CF27030D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1631523010; bh=sXLnBkK+2zYR5V6PcXZnECsGGhNeYpR43JTWIhA9lDA=; 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=NJRA7tQxNcYFleLDy8Y2JXJC20vfx+zAoxTOMRynWCMxUgKN07hX1Yw/CluT182YU ewBIxE3bZe8Tv4kTNzbIiHSK8rOsY3LEyP04BDg/Tq9JsCE5P6UX5GV0PeyxZLdHqW kxo1OOHm6lQSJCi3HQBrE/rIyrMnZJtU5XmAjnrY= Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 BEDD57030D for ; Mon, 13 Sep 2021 11:50:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BEDD57030D Received: by smtp54.i.mail.ru with esmtpa (envelope-from ) id 1mPhfD-0007PA-Va; Mon, 13 Sep 2021 11:50:08 +0300 To: Cyrill Gorcunov , tml Cc: Vladislav Shpilevoy References: <20210910152910.607398-1-gorcunov@gmail.com> <20210910152910.607398-2-gorcunov@gmail.com> Message-ID: Date: Mon, 13 Sep 2021 11:50:07 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210910152910.607398-2-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD91AE02D33A9C88A2F7B0FCECE251A4B9EABD2FC9AA46919D800894C459B0CD1B90AC7B460B6F072F7D1F355B24F09AE55B1297A869713209A821D67526267DAEF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74C265300876DF183C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7ACA11F7F2395C8CCEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F28F63755EB7C5B2078BBE6A6A820F1365CC7F00164DA146DAFE8445B8C89999728AA50765F790063735D2385A5E2B3AC3389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC85DBE5CE84B47B0E4117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637EC3198ECE464ADAEEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A51A926C09F00117B582BDA514690ADA54AD538149DE486BA3D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3451BBE684D17D7221E83B597F2BC2966249E3CBBD71FE8361DB2BE00F24E313A4E2DFAC0F80F04B4F1D7E09C32AA3244C29E371A7C02E8354548099E891698966E3D93501275E802FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojEltUM+pNOWNjyFPQUs8dXw== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A446E2A1F11F3BEA95E2BEBB8E8F7522D7AA544DE49371E5A235424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v14 1/6] qsync: track confirmed lsn number on reads 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: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 10.09.2021 18:29, Cyrill Gorcunov пишет: > We will use this lsn for requests validation > in next patches for sake of split-brain detection. > > Part-of #6036 > > Signed-off-by: Cyrill Gorcunov > --- > src/box/txn_limbo.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c > index 70447caaf..cca2ce493 100644 > --- a/src/box/txn_limbo.c > +++ b/src/box/txn_limbo.c > @@ -437,6 +437,13 @@ txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn) > assert(e->txn->signature >= 0); > txn_complete_success(e->txn); > } > + > + /* > + * We use confirmed lsn number to verify requests and > + * reject ones coming from split-brain cluster configurations, > + * so update it even if there were no entries to process. > + */ > + limbo->confirmed_lsn = lsn; > } > > /** I guess there'll be problems on master with this approach. Say, a pair of CONFIRM requests is written, with lsns N and N+1. So you first enter write_confirm(N), then write_confirm(N+1). Now both fibers issuing the requests yield waiting for the write to happen, and confirmed_lsn is N+1. Once the first CONFIRM (N) is written, you reset confirmed_lsn to N right in read_confirm. So until the second CONFIRM (N+1) is written, there's a window when confirmed_lsn is N, but it should be N+1. I think read_confirm should set confirmed_lsn on replica only. On master this task is performed by write_confirm. You may split read_confirm in two parts: set confirmed lsn (used only on replica) and apply_confirm (everything read_confirm did before your patch) -- Serge Petrenko