Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ilLcX-0001ch-OL for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Dec 2019 23:35:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ilLbX-0004Q8-Gf for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Dec 2019 23:34:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ilLbX-0004Q1-3m for pgsql-hackers@lists.postgresql.org; Sat, 28 Dec 2019 23:34:43 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ilLbS-0006sB-E6 for pgsql-hackers@postgresql.org; Sat, 28 Dec 2019 23:34:42 +0000 Received: by mail-wm1-x344.google.com with SMTP id p17so11435037wmb.0 for ; Sat, 28 Dec 2019 15:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3DTSG9Xdxf3JMhy+xwJ199TOqG/fZ6oIT5TvcdWvdhI=; b=yGUguiY7Izt9Q5+EDfmXtzkyO/fOMvbKY6BQ56Ft8clQWGaKLfLwxetpN6Dr2NXWIM pOsHIEc1rjbLfowApubqp7L4u42LMbLLz6KdhZwz2SiMUvaDkhLXpXTWsgpQfAxfktRQ 8LRb/iyAU+rK1KMPoxUbZ2ia41NX7cK5/boK9jSDstKXo0p0fpDT82DNmo8xfStjQ7PS VcQXpjTBsVJZZh5bfHDFz2rx7Bp+sGm3gHFxbJ7g3PQOAbN9T4EUt9bf5gzvILkMpnaP WZeyBqXR88Q1RgunGEANPFjm13BEK8vNOedd1ZOBhx3iUEfxM/V/P4z/c8vn97Ort0f+ gqpw== 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; bh=3DTSG9Xdxf3JMhy+xwJ199TOqG/fZ6oIT5TvcdWvdhI=; b=l1htyNeyuaMrPqa+Pb5yrBVJ8bqR0JKZmJV/B9RBGhZxZ92g7XgugumZyxbnDvZ7ba ntefcOEphgoOJDjR2OKVZQEGijcE5JVNuVgTgsuXkKVoXdIumlJKVpHl7Fe4JtQ6RDvT PPKS4vdbnLa0l/f0748x5ribc6T1QUrSds1HoSkOyccT+BAcUAfbnUSHv0npdSwWe9et 1hkHLNKDY4evutMYhhJB1uRk9NYcvYmnIEK0nfbJyAGtqFg2kC1k1LAyvp4MI2v93R/l O2QU9au53PrNE4IP0pcpm8bj6JNBwCdgFff1za/JW31y4e+kZCIevfwCKpObYRBkanLu ETVw== X-Gm-Message-State: APjAAAX9aQj+NmCJsHo7pn+h4OLrMYyaK+qdlT61P8vBD6FxkXsDzM5/ b79lIsxXEhcCPQNDEbJAED691Q== X-Google-Smtp-Source: APXvYqxOLbp7CDEIYkaT64Ju3Dse105cU6sX4L9YuBBWuWgqCbrsX5iW52sscwnHfvMKDN0uHrz1gA== X-Received: by 2002:a1c:3dd5:: with SMTP id k204mr25455230wma.92.1577576075520; Sat, 28 Dec 2019 15:34:35 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id z3sm39766858wrs.94.2019.12.28.15.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2019 15:34:34 -0800 (PST) Date: Sun, 29 Dec 2019 00:34:33 +0100 From: Tomas Vondra To: Alvaro Herrera Cc: Kyotaro Horiguchi , craig@2ndquadrant.com, pgsql-hackers@postgresql.org Subject: Re: xact_start for walsender & logical decoding not updated Message-ID: <20191228233433.gi3er4mvdghia64v@development> References: <20191213.150124.69303805839083319.horikyota.ntt@gmail.com> <20191227194618.GA30125@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20191227194618.GA30125@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Dec 27, 2019 at 04:46:18PM -0300, Alvaro Herrera wrote: >On 2019-Dec-13, Kyotaro Horiguchi wrote: > >> At Fri, 13 Dec 2019 13:05:41 +0800, Craig Ringer wrote in >> > On Wed, 11 Dec 2019 at 02:08, Alvaro Herrera >> > wrote: >> > >> > > On 2019-Dec-10, Tomas Vondra wrote: >> > > >> > > > On Tue, Dec 10, 2019 at 09:42:17AM +0900, Kyotaro Horiguchi wrote: >> > > > > At Tue, 10 Dec 2019 00:44:09 +0100, Tomas Vondra < >> > > tomas.vondra@2ndquadrant.com> wrote in >> > > >> > > > > I'm not sure how much xact_start for walsender is useful and we really >> > > > > is not running a statement there. Also autovac launcher starts >> > > > > transaction without a valid statement timestamp perhaps for the same >> > > > > reason. >> > > > >> > > > Maybe, but then maybe we should change it so that we don't report any >> > > > timestamps for such processes. >> > > >> > > Yeah, I think we should to that. >> > Agreed. Don't report a transaction start timestamp at all if we're not in a >> > read/write txn in the walsender, which we should never be when using a >> > historic snapshot. >> > >> > It's not interesting or relevant. > >This patch changes xact.c to avoid updating transaction start timestamps >for walsenders (maybe more commentary is desirable). I think logical >decoding is just a special form of walsender and thus it would also be >updated by this patch, unless I misunderstood what Tomas explained. > It's true walsender should not be doing any read-write transactions or executing statements (well, maybe a decoding plugin could, but using historic snapshot). So I agree not leaving xact_start for walsender processes seems OK. >> > Reporting the commit timestamp of the current or last-processed xact would >> > likely just be confusing. I'd rather see that in pg_stat_replication if >> > we're going to show it, that way we can label it usefully. >> >> Sounds reasonable. > >Developers interested in this feature can submit a patch, as usual :-) > ;-) regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services