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 44D1C6EC55; Thu, 17 Jun 2021 09:55:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 44D1C6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623912918; bh=4gNDBRQh//CeWDBflK2iTmMP5dwk4ZUWpQMmzoabXUw=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=zFlEMmyBp66YBx7llWC5ogQDovVDuLR6RaaPETi4eXLuHmzXdY7gniBf4dE7NqEyl 69l1o/0htzoQ2ovOk2sV/xP7Hqpd6bf8SVmLf21DGqek0Dj/09Yteae+2l6yltMUV+ AiHigGGQ0TE7tECzQU06MrrYNRLKphmITgS/1UbM= Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 F23D06EC55 for ; Thu, 17 Jun 2021 09:55:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F23D06EC55 Received: by mail-lf1-f53.google.com with SMTP id j2so8625655lfg.9 for ; Wed, 16 Jun 2021 23:55:16 -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=C1ZmU7qe23fDVz7CTNEfZu276goRQsn/7eVgMGzgm1w=; b=Zi1F6F5IpJamispBDJ1/L09dAmllyHK1gi9HRU8IIIRkHCWo2zZcZJAVy4XfeRpaPX lDZJ7HagPKxwqZnGDozuOQszotHg3wx2c1qoU/9xen3y3tXL4dIhglOJxQJFC4zWy3Ix yAwDUvqThLWKTS9xrPsPIiVcaAAVUubUSA8lW1/Txiuihad1EWAapYkvv851hzSYRaxz KYRvCnVqP0jtKr3qV0zvwSG9bPCGJnhXK3r0KvYDCQ5+tdRFXEYFaHqXD9IYBb/HDBwM hGoG/dBNXle4xN/OkRNSwm+hAktlu0nU4xGqRuCQv6BXjpf5TPiPZvNIR1ZZ2Jw//UeZ B8hw== X-Gm-Message-State: AOAM531qrchAKacMW71bhmdL05mu1HSdTafvEU9NDwiR7azD8c5ez3Yt 7zWRtZQgdm1wMNVMGy1bUjYCKnjeZnU= X-Google-Smtp-Source: ABdhPJwGqn0rYvl4LgfzWoXSTx4idAwqN7tqzVP3Ob/j7oX9FWadA1Aua9DHEOByh908gAKkzI6CYg== X-Received: by 2002:a05:6512:ac9:: with SMTP id n9mr2796731lfu.235.1623912915612; Wed, 16 Jun 2021 23:55:15 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id o14sm478770lfg.34.2021.06.16.23.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 23:55:14 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 291D55A002A; Thu, 17 Jun 2021 09:55:14 +0300 (MSK) Date: Thu, 17 Jun 2021 09:55:14 +0300 To: Serge Petrenko Message-ID: References: <20210607155519.109626-1-gorcunov@gmail.com> <20210607155519.109626-3-gorcunov@gmail.com> <73be2a27-dacf-c750-7bb6-da777b9c2f5a@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73be2a27-dacf-c750-7bb6-da777b9c2f5a@tarantool.org> User-Agent: Mutt/2.0.7 (2021-05-04) Subject: Re: [Tarantool-patches] [PATCH v8 2/2] relay: provide information about downstream lag 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 Cc: Vladislav Shpilevoy , tml Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Tue, Jun 15, 2021 at 01:03:59PM +0300, Serge Petrenko wrote: > > > > In other words this is a lag in seconds between the main node writes > > data to own WAL and the replica `n` get this data replicated to own > > WAL journal. > > This is not true. You describe `upstream.lag` in this paragraph. > Downstream lag is the time difference between the WAL write on master > side and the receipt of an ack (confirmation of a WAL write on replica) > for this transaction. Also on master side. No. The upstream.lag is calulated as applier_read_tx_row ... applier->lag = ev_now(loop()) - row->tm; IOW it is a time between data is written to txn initiator to WAL and the packet _received_ by replica, and there is no guarantee that the packet will be *replicated* at all. In turn for downstream we compute time delta when data is already writtent to a replica's WAL. Cyrill