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 E9FF26EC5F; Tue, 20 Apr 2021 20:38:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E9FF26EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618940297; bh=L6EddxZM569qF0s7HCq/5zYVWtRyutvW8348oCvvSvQ=; 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=fB61IptU2Dz2/Vc6vTBU4z6PmXK1Ci6mlgz/epBz/JgXaGo8r/V0EEzA3e8uGAjRo xZt2T3MKrd+9F43dMHo0BLfOHnjdXb6whwq4c6A/IJpB8dyb65NbLzVT720MZua09z uOqo/ByDoe0hL3v4DFuSt2rWyNbVIRrArIoF6f+I= 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 60C3A6EC5F for ; Tue, 20 Apr 2021 20:38:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 60C3A6EC5F Received: by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1lYuKE-000840-RL; Tue, 20 Apr 2021 20:38:15 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: Message-ID: <44f6cb10-ed92-49ed-e4de-783b7a698e42@tarantool.org> Date: Tue, 20 Apr 2021 20:38:14 +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: 4F1203BC0FB41BD92FFCB8E6708E7480B1C8842CE613979723F2FB4628545A35182A05F538085040AC1B71238C8A3760A68449F607BE89E9879E2763D6B408115E89BEAA39A4D0E4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D8156D3FCB551F18EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E31772672C957B658638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B23AD2084406F68FA5B0B7B052C7F4D8B23EADAC849D614696D2E47CDBA5A96583C09775C1D3CA48CFFF021744A2531FDDCC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C921661749BA6B97735C8FBEF6EAD8577B08941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3BE90F13D913F449135872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8183A4AFAF3EA6BDC44C234C8B12C006B7AFF72C0625B3DFE84DB8C89DD94D788F5101A2C1C1B705A3CB1881A6453793CE9C32612AADDFBE061C61BE10805914D3804EBA3D8E7E5B87ABF8C51168CD8EBDB63AF70AF8205D7DCDC48ACC2A39D04F89CDFB48F4795C241BDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34BDCC71B3781C9C95B664AECA3EA64A071BB2F8BD3CE78B3F0BF8553D9FB6058A7A900F7833B563F01D7E09C32AA3244C8EA6148D2D8DB896147347D61ADDF9C624AF4FAF06DA24FDFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojlPRl29Bx4WGIwJOBECkdJQ== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A44644423D65D3A39D8CD080E10636EEDB6DE054621235E2F77C424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 14/12] txn: make NOPs fully asynchronous 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" When a transaction consists of NOPs solely, it shouldn't wait for other synchronous transactions to finish. It might get committed right away. Such transactions may appear when applier filters out synchronous rows from an outdated instance, and appending such transactions to the limbo could lead to ER_UNCOMMITTED_FOREIGN_SYNC_TXNS  error, which we tried to avoid in the first place when replaced tx rows with NOPs. Follow-up #5445 ---  src/box/txn.c | 14 +++++++++++---  1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/box/txn.c b/src/box/txn.c index a71ccadd0..8be102666 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -601,6 +601,11 @@ txn_journal_entry_new(struct txn *txn)      struct xrow_header **remote_row = req->rows;      struct xrow_header **local_row = req->rows + txn->n_applier_rows;      bool is_sync = false; +    /* +     * A transaction which consists of NOPs solely should pass through the +     * limbo without waiting. Even when the limbo is not empty. +     */ +    bool is_fully_nop = true;      stailq_foreach_entry(stmt, &txn->stmts, next) {          if (stmt->has_triggers) { @@ -612,8 +617,11 @@ txn_journal_entry_new(struct txn *txn)          if (stmt->row == NULL)              continue; -        is_sync = is_sync || (stmt->space != NULL && -                      stmt->space->def->opts.is_sync); +        if (stmt->row->type != IPROTO_NOP) { +            is_fully_nop = false; +            is_sync = is_sync || (stmt->space != NULL && + stmt->space->def->opts.is_sync); +        }          if (stmt->row->replica_id == 0)              *local_row++ = stmt->row; @@ -627,7 +635,7 @@ txn_journal_entry_new(struct txn *txn)       * space can't be synchronous. So if there is at least one       * synchronous space, the transaction is not local.       */ -    if (!txn_has_flag(txn, TXN_FORCE_ASYNC)) { +    if (!txn_has_flag(txn, TXN_FORCE_ASYNC) && !is_fully_nop) {          if (is_sync) {              txn_set_flags(txn, TXN_WAIT_SYNC | TXN_WAIT_ACK);          } else if (!txn_limbo_is_empty(&txn_limbo)) { -- 2.24.3 (Apple Git-128)