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 1iowDJ-0005Zx-UM for pgsql-committers@arkaria.postgresql.org; Tue, 07 Jan 2020 21:16:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iowDI-0005wc-Nz for pgsql-committers@arkaria.postgresql.org; Tue, 07 Jan 2020 21:16:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iowDI-0005uT-AI for pgsql-committers@lists.postgresql.org; Tue, 07 Jan 2020 21:16:32 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iowDE-0004Pt-V1 for pgsql-committers@lists.postgresql.org; Tue, 07 Jan 2020 21:16:31 +0000 Received: by mail-qk1-x741.google.com with SMTP id r14so712012qke.13 for ; Tue, 07 Jan 2020 13:16:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=8L4q6hB/xg+pUuJHw58hHp/YtBeMBhpNTFnrixEBaSM=; b=Tz5Unu386oVZsH+f6LavHT2O9WK4JUGVHh+pUaLJSiHFmbwsasNHnBAexZLhUvCDVx sFiR8TBPds4zuXG4/wlnrgIQIDKB8at2VVdHINdhY0uUIxDbfdnVz/Ch6ueTVDWZyEBX NKAppUvapsSR9/Ag/WN+v5a8D+K5bWI+asiMFubyAdziWmqWlWI7663T6QwJ0dcH2BOg wsFl0dR/lOfOp9xwAaekpkSE9njem+r148AMnVTzAU/S0bh8os1jzsmc8hbMXgJawdee RbJ5hSkntTSPnTzzPBOkTGXE9L05q5LkDMWgSzaW+baqFVfdYy3A2rAeRVe6s18Mjhey 6WLA== 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:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=8L4q6hB/xg+pUuJHw58hHp/YtBeMBhpNTFnrixEBaSM=; b=XTTYRwox5+Yl6FPtCID7ZVh1NMj79sSSfGyLtt/sFU/XiG4e+FJiu6N5CyiiP1ikA+ +t0fbimeTQEEcVRZFsTEUmB/Ud4cxKl+VkUTNKq1rT/qjYENs7Wu62dMLbX4/prSIB6R TKFJFuawFLpaSj7pXaSbL37Xo5ie8zujB0/cp02N/kZEeuCl48Yxt0EBT40p09eTXpwf ZddVdCUzpRFoT6Lo8zQOlsOlbwNJJCE60jqh78w6ecmCXtOBUnpbOTtKcUSoMfVZNTCh S3f8duswj5q8UHxwm4DZ2hLbeXhLdh+InIQ/JVGo+i4SxICWTl4LET660AAB4kNZCrpt xZ3w== X-Gm-Message-State: APjAAAUCLgzMu+tIfw7/NcPJS+9ZAd/ARkD8Cw4fQEa/VgyFOO9IQgVv 7M4fXmStXNl3G7F1QzO7rjFfR9OPXjrvUKdD61/0tH6eO68Fc3jgHY935OQIY3dZZFISeh/8VVE 92hEXc/XLG1oYZAX8v1GQ98EEfc1j1RBz3oUPeRCza5UUnoWcgZRlyiSMQ+LRyoEX4AupJDEqt9 AbdqyaqTy/cWVHD0D/pM50 X-Google-Smtp-Source: APXvYqzJ9OUtjr9gk59YfWvwFiGeTO3Bq1I4TgU/zyj+8AiuDq9ae8QgghlP8cXgngD3xg/9t6SzsA== X-Received: by 2002:a37:8ac4:: with SMTP id m187mr1271790qkd.277.1578431787752; Tue, 07 Jan 2020 13:16:27 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id e3sm491229qtb.65.2020.01.07.13.16.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 13:16:27 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 2DD3B301DEF; Tue, 7 Jan 2020 18:16:24 -0300 (-03) Date: Tue, 7 Jan 2020 18:16:24 -0300 From: Alvaro Herrera To: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: pg_stat_activity: show NULL stmt start time for walsenders Message-ID: <20200107211624.GA18974@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Jan-07, Alvaro Herrera wrote: > pg_stat_activity: show NULL stmt start time for walsenders > > Returning a non-NULL time is pointless, sinc a walsender is not a > process that would be running normal transactions anyway, but the code > was unintentionally exposing the process start time intermittently, > which was not only bogus but it also confused monitoring systems looking > for idle transactions. Fix by avoiding all updates in walsenders. > > Backpatch to 11, where walsenders started appearing in pg_stat_activity. So I misidentified things; it's not commit be87b70b6117 (pg11) that put auxiliary processes in pg_stat_activity, but fc70a4b0df38 (pg10). So I applied it back to pg10 also. (I did verify that walsenders appear with a xact_time in pg_stat_activity in pg10 before this patch, and not afterwards.) We're still computing useless xact start timestamps in branches 9.4 - 9.6, but I don't think we care. (If we do care, then we probably also care about xact *stop* time ... but meh.) Thanks -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services