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 9AEAC6EC5F; Mon, 19 Apr 2021 12:31:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9AEAC6EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618824684; bh=x31P/SKDzCKOjjLS7/dJwLRHpJDvAsdDrmIHAl3AlQg=; 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=G+tYSznreGdx49McBXrNh/aLLm5nfmhQAIMQ0Ch1OdvyFkfIgPERA4oEjmd7vaTU1 4+ShrNo3e+wf44kzLpFZwIjjLYhTUqJHFXWcFbVKPsl5VD8L7J8imR8KbRnQyTH3kr pangL7t2DOP1wqKuXnBiQRxK89ES8aCDtImiY7Gk= Received: from smtp17.mail.ru (smtp17.mail.ru [94.100.176.154]) (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 F32F26EC5F for ; Mon, 19 Apr 2021 12:31:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F32F26EC5F Received: by smtp17.mail.ru with esmtpa (envelope-from ) id 1lYQFW-0000yJ-48; Mon, 19 Apr 2021 12:31:22 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: Message-ID: <5a41ce31-dd82-dd0a-f13b-6a428e1a1964@tarantool.org> Date: Mon, 19 Apr 2021 12:31:21 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480D608FE24BC85426BB1B55F651FED8C70182A05F5380850407937B6213A1F58F8D4F836B6CF7311DCBD5CCC35B820592C52ED3EFDA5C4F3E7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AC4684DF4EC4B256EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B8CD1D12629438CE8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2CC1F8B6B13230FAB3C66AF1DF1D60F90BDFBBEFFF4125B51D2E47CDBA5A96583C09775C1D3CA48CFED8438A78DFE0A9E117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7D9442B0B5983000E8941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD2691661749BA6B977357C6FCE95544A9834D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE36A1CB4668A9CA5FA040F9FF01DFDA4A8C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B569F1129A2C6445075ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5C88FE525D83565861801AB56752513247F1BD159C094AAD7D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348B532EA2091F4FF69AB86D44F211C31355268DDC8BE680D350192643B77B0CB268F023AC86AE00171D7E09C32AA3244CC395F5C512D5DE82B8D99D323FE8FABC3C6EB905E3A8056BFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojocJA+pXcDum/vkRuung88g== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8EC21FD7D8A27E50A0CC15A68645022A4BD411FAB3972F6B3424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 07/12] raft: filter rows based on known peer terms 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" 18.04.2021 18:44, Vladislav Shpilevoy пишет: > I accidentally updated curl submodule (forgot to update the > submodules before doing my amendments), we need to revert it back. Yep. Fixed. > >> diff --git a/src/box/applier.cc b/src/box/applier.cc >> index 61d53fdec..b0e8fbba7 100644 >> --- a/src/box/applier.cc >> +++ b/src/box/applier.cc >> @@ -967,6 +967,59 @@ apply_final_join_tx(struct stailq *rows) >> return rc; >> } >> >> +/* > Also I forgot to make it /** instead of /*. Thanks! Fixed as well. Incremental diff's below. > >> + * When elections are enabled we must filter out synchronous rows coming >> + * from an instance that fell behind the current leader. This includes >> + * both synchronous tx rows and rows for txs following unconfirmed >> + * synchronous transactions. >> + * The rows are replaced with NOPs to preserve the vclock consistency. >> + */ I've also fixed the issue we discussed verbally, about filtering by row->replica_id rather than by applier->instance_id. This is important because once new leader is elected, it may be outdated until it sends us its promote request. But there may be valid rows from the previous leader that we need to accept. Old leader is not outdated until we receive the new leader's promote, so we have to apply its rows. ================================================ diff --git a/src/box/applier.cc b/src/box/applier.cc index b0e8fbba7..dc05c91d3 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -967,7 +967,7 @@ apply_final_join_tx(struct stailq *rows)         return rc;  } -/* +/**   * When elections are enabled we must filter out synchronous rows coming   * from an instance that fell behind the current leader. This includes   * both synchronous tx rows and rows for txs following unconfirmed @@ -975,7 +975,7 @@ apply_final_join_tx(struct stailq *rows)   * The rows are replaced with NOPs to preserve the vclock consistency.   */  static void -applier_synchro_filter_tx(struct applier *applier, struct stailq *rows) +applier_synchro_filter_tx(struct stailq *rows)  {         /*          * XXX: in case raft is disabled, synchronous replication still works @@ -985,15 +985,18 @@ applier_synchro_filter_tx(struct applier *applier, struct stailq *rows)          */         if (!raft_is_enabled(box_raft()))                 return; -       if (!txn_limbo_is_replica_outdated(&txn_limbo, applier->instance_id)) +       struct xrow_header *row; +       /* +        * It  may happen that we receive the instance's rows via some third +        * node, so cannot check for applier->instance_id here. +        */ +       row = &stailq_first_entry(rows, struct applier_tx_row, next)->row; +       if (!txn_limbo_is_replica_outdated(&txn_limbo, row->replica_id))                 return; -       struct xrow_header *row; -       row = &stailq_last_entry(rows, struct applier_tx_row, next)->row; -       if (row->wait_sync) +       if (stailq_last_entry(rows, struct applier_tx_row, next)->row.wait_sync)                 goto nopify; -       row = &stailq_first_entry(rows, struct applier_tx_row, next)->row;         /*          * Not waiting for sync and not a synchro request - this make it already          * NOP or an asynchronous transaction not depending on any synchronous @@ -1079,7 +1082,7 @@ applier_apply_tx(struct applier *applier, struct stailq *rows)                         }                 }         } -       applier_synchro_filter_tx(applier, rows); +       applier_synchro_filter_tx(rows);         if (unlikely(iproto_type_is_synchro_request(first_row->type))) {                 /*                  * Synchro messages are not transactions, in terms diff --git a/third_party/curl b/third_party/curl index 12af024bc..3266b35bb 160000 --- a/third_party/curl +++ b/third_party/curl @@ -1 +1 @@ -Subproject commit 12af024bc85606b14ffc415413a7e86e6bbee7eb +Subproject commit 3266b35bbe21c68dea0dc7ccd991eb028e6d360c -- Serge Petrenko