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 D5CCE6BD2D; Tue, 13 Apr 2021 16:09:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D5CCE6BD2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618319376; bh=Rm06IWlxki/mOtgSz9Aq7ouKDJwfwVdJ0vWBK9MeiG0=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=UjTct3zZ0w3A72u4fLmGReb0k0kHt4Fd7YTxTXoC/qXzZwtsJkTUN58hr2YcrKEoO LV/xOFNJqnlNMslWhxgxrfA6LRwp3/Uar5JR+Su0JYlPj6eZ/x78U7nO9oZi9ApxlN TFphdTTgOyLkaQS0RzvKvCLXfsXbTI/CWqX8I/mM= Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6DE066BD29 for ; Tue, 13 Apr 2021 16:09:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6DE066BD29 Received: by mail-lj1-f182.google.com with SMTP id r22so8562214ljc.5 for ; Tue, 13 Apr 2021 06:09:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DtEm/KIuOTB0Lr703o/iNBCmOh7P0Blwjad7NllFM+U=; b=bxccWA5sewnM3YinV3Yf+xfSMmebhMFOlaIChsl6vwLcbpMT8KPxc3W4feQMtMwmqO 6xyR/Lx/sMbPvlwrhjV2D8pUbjxvmPjT8Vgw5uSk9UVWcVKC5mWRsuIUGpsxBPAAEkFi fhsT8kfBrbN0tg8DV7bCVeyZHryLimzsSJ9j/K/d/gNYyayijt1jlV3zUsvjbAMyMG+M r/LYmOLGS1rosiokkbQZpcImDKxFqp0QaNTLkf67TfZAO9K0Gizu1gcFFyK4dsNtN0kx ZckxQrh0zvyQMUm26KM3YZwxSL1XeTsglHAP6sP+ZEbsQ/I4LjgDVHB5AKNs6mKGzuGt aKOA== X-Gm-Message-State: AOAM5322Pb3pXCgrm91oNNw9hC17YL4NDAdJou5g4tn25/zv8yhDWqvE PkOrHK+6mjSHFFjabqU+wq6KITWGuN4= X-Google-Smtp-Source: ABdhPJxxOKZDbXOQVdg0Xnq9sLBE2emaFn4e1CLz6gxYXYy6LtW0eqwvZoLvEN5jiu3k9EX2KEgMfA== X-Received: by 2002:a2e:9099:: with SMTP id l25mr4377268ljg.206.1618319373944; Tue, 13 Apr 2021 06:09:33 -0700 (PDT) Received: from grain.localdomain ([5.18.199.94]) by smtp.gmail.com with ESMTPSA id o16sm3330169lfu.228.2021.04.13.06.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 06:09:32 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id A0675560162; Tue, 13 Apr 2021 16:09:31 +0300 (MSK) Date: Tue, 13 Apr 2021 16:09:31 +0300 To: Serge Petrenko Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org Message-ID: References: <0d29b025b7213b5c9596715d849b4b371e1fef32.1618256019.git.sergepetrenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0d29b025b7213b5c9596715d849b4b371e1fef32.1618256019.git.sergepetrenko@tarantool.org> User-Agent: Mutt/2.0.5 (2021-01-21) Subject: Re: [Tarantool-patches] [PATCH v2 1/9] wal: enrich row's meta information with sync replication flags 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: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Mon, Apr 12, 2021 at 10:40:14PM +0300, Serge Petrenko wrote: > @@ -996,7 +996,13 @@ wal_assign_lsn(struct vclock *vclock_diff, struct vclock *base, > first_glob_row = row; > } > (*row)->tsn = tsn == 0 ? (*start)->lsn : tsn; > - (*row)->is_commit = row == end - 1; > + if (row < end - 1) > + continue; These two lines ^^ Serge, why we need `continue` here at all? Why can't we simply drop the above `if` saving a branch? > + /* Tx meta is stored in the last tx row. */ > + if (row == end - 1) { > + (*row)->opt_flags = entry->opt_flags; > + (*row)->is_commit = true; > + } IOW, I mean (*row)->tsn = tsn == 0 ? (*start)->lsn : tsn; (*row)->is_commit = row == end - 1; if (row == end - 1) { // Save meta }