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 E4C266FC8F; Fri, 16 Apr 2021 02:20:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E4C266FC8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618528821; bh=I/mf63g+JNFPdPs9J8HIK3OwGUQEaZ5lC1aFdgb3tfE=; 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=UJXtsTNWngQSt0HdhyWpf9ITeXs5VJIuLqHXB8ueKIuAxLkQRoVZbn4J4nDJMxbZV Uq7PT607sWklX9yf5rtr8tkI4n2vel7LTp1oTr+2yrLHFQRx7ommyYdpYfDGYRJBhS /DywE8KiEpGmkVcvBr+RMlY/CLet4f1P3C7d3fn4= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 E2D756FC8F for ; Fri, 16 Apr 2021 02:20:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E2D756FC8F Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1lXBHW-0004qH-8t; Fri, 16 Apr 2021 02:20:18 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <63f4e63825172aaad50b910ed7c0431246380d45.1618409665.git.sergepetrenko@tarantool.org> Message-ID: Date: Fri, 16 Apr 2021 01:20:17 +0200 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: <63f4e63825172aaad50b910ed7c0431246380d45.1618409665.git.sergepetrenko@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E74807BAE725B9AE625DE765B0E193B5B7687182A05F53808504049BB4F30C47CABD03CB0D32D11465239A25DB7D4DC2C360ED97764482E701C4C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7648F5E4671A60CF6EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063765D69633A07E2F0F8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2C26BCCE458665CD3C600FB9978B6A6313C8827A907CBE77DD2E47CDBA5A96583C09775C1D3CA48CF62968DCAA3E4B45B117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE759A2DA0C93DFCD719FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE772C7F6EAAB0B2D3AD32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C0FD819E82F1CB4899CD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C34B08FA16E56A400835872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4AD6C30AE2B5E62355B836777F6DC600DF1 X-C1DE0DAB: 0D63561A33F958A5DF5A40EA6C2F8716A476FED3CFAE8D9CD459C7245A4CB17ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34505665BFD4C7070547010AC42AFA7ACF1332E47A8717174B8B25A612EB90B7673FEAF614F64095891D7E09C32AA3244C976335720989E10E3E968B545F4504CCBBA718C7E6A9E042FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj3S6P1v0GIqRvKNYdbu1FGw== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA311059CF4178EA370880AF7EA50BE5B160739A07AE5EE9D80F1F07784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v3 04/10] box: make clear_synchro_queue() write a PROMOTE entry instead of CONFIRM + ROLLBACK 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for working on this! See 2 comments below. > diff --git a/src/box/box.cc b/src/box/box.cc > index 70b325180..9adb6ba46 100644 > --- a/src/box/box.cc > +++ b/src/box/box.cc > @@ -1556,7 +1556,19 @@ box_clear_synchro_queue(bool try_wait) > "new synchronous transactions appeared"); > rc = -1; > } else { > - txn_limbo_force_empty(&txn_limbo, wait_lsn); > + /* > + * Term parameter is unused now, We'll pass > + * box_raft()->term there later. > + */ > + txn_limbo_write_promote(&txn_limbo, wait_lsn, 0); > + struct synchro_request req = { > + .type = 0, /* unused */ > + .replica_id = 0, /* unused */ > + .origin_id = instance_id, > + .lsn = wait_lsn, > + .term = 0, /* unused */ 1. Aren't the unused fields nullified anyway according to the standard? > + }; > + txn_limbo_read_promote(&txn_limbo, &req); > assert(txn_limbo_is_empty(&txn_limbo)); > } > } > diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c > index d29722ef7..bfe0ad302 100644 > --- a/src/box/txn_limbo.c > +++ b/src/box/txn_limbo.c > @@ -464,6 +470,32 @@ txn_limbo_read_rollback(struct txn_limbo *limbo, int64_t lsn) > box_update_ro_summary(); > } > > +void > +txn_limbo_write_promote(struct txn_limbo *limbo, int64_t lsn, uint64_t term) > +{ > + limbo->confirmed_lsn = lsn; > + /* > + * We make sure that promote is only written once everything this > + * instance has may be confirmed. > + */ > + struct txn_limbo_entry *e = txn_limbo_last_synchro_entry(limbo); > + assert(e == NULL || e->lsn <= lsn); > + (void) e; > + txn_limbo_write_synchro(limbo, IPROTO_PROMOTE, lsn, term); > + limbo->is_in_rollback = false; 2. How is it possible that there was a rollback in progress at the same time?