From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 68B7B42EF5C for ; Wed, 24 Jun 2020 01:13:37 +0300 (MSK) References: <409bc44b-2b6b-1d49-f8c7-82f979480b2f@tarantool.org> <9c56561d-554c-d6a9-3bf8-c942ee528073@tarantool.org> From: Vladislav Shpilevoy Message-ID: <8d6e87f2-10ba-90be-9aac-a8a7a2a3de8b@tarantool.org> Date: Wed, 24 Jun 2020 00:13:35 +0200 MIME-Version: 1.0 In-Reply-To: <9c56561d-554c-d6a9-3bf8-c942ee528073@tarantool.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH 3/8] txn: add TXN_WAIT_ACK flag List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko , Leonid Vasiliev , sergos@tarantool.org, gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org >>>>        stailq_foreach_entry(stmt, &txn->stmts, next) { >>>>            if (stmt->has_triggers) { >>>>                txn_init_triggers(txn); >>>>                rlist_splice(&txn->on_commit, &stmt->on_commit); >>>>            } >>>> +        is_sync = is_sync || stmt->space->def->opts.is_sync; >>> Seems like >>> "... || (stmt->space != NULL && stmt->space->def->opts.is_sync);" >>> can be moved here from "replication: make sync transactions wait quorum". >>> >>> LGTM. >> I don't think it is a good idea. At this commit stmt->space can't be >> NULL. This becomes possible only after Sergey P. starts using txns >> to write confirm and rollback entries, which don't relate to any >> space. > > Actually, stmt->space is NULL for NOPs. Force pushed to this commit: diff --git a/src/box/txn.c b/src/box/txn.c index 22591a365..edc1f5180 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -507,7 +507,8 @@ txn_journal_entry_new(struct txn *txn) if (stmt->row == NULL) continue; - is_sync = is_sync || stmt->space->def->opts.is_sync; + is_sync = is_sync || (stmt->space != NULL && + stmt->space->def->opts.is_sync); if (stmt->row->replica_id == 0) *local_row++ = stmt->row;