Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZjr1-0001e2-Tl for pgsql-hackers@arkaria.postgresql.org; Fri, 15 May 2020 23:34:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jZjr0-0007oH-4M for pgsql-hackers@arkaria.postgresql.org; Fri, 15 May 2020 23:34:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZjqz-0007kl-Tm for pgsql-hackers@lists.postgresql.org; Fri, 15 May 2020 23:34:57 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jZjqw-0001kH-Mg for pgsql-hackers@lists.postgresql.org; Fri, 15 May 2020 23:34:57 +0000 Received: by mail-qt1-x842.google.com with SMTP id p12so3465272qtn.13 for ; Fri, 15 May 2020 16:34:54 -0700 (PDT) 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:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=2Q2NnTKtD1OMki9ibPGXzULUe1m+VCIPHRUQ4VvCyao=; b=v1qhTD57YaRpQZVz+aSh5MNUb9Wn4Qjw41xyfFllk0n8pEWQQ125lon5ud229iH1XF bzA1TQl+eJieqnxwcFSEyWdgmSlC1fVJdXGVpK39kuSuKT6nK0ccNazRiP5ufQLCghQn Qlpt345xnM9EL30rkxEEAyipq1TUn+az5TzB3tfODCjNuzOjVwQKOp/oCJSMrYuOtubq eWSUQWM88ql0cP9jeKOAu4AHsiHdIj9gqv0zAYymDIIgF5x+Y/tm2n4+Z5OaqhJjrVND ufXLsQOD/4Z6Cp2siZY2tuhdmISPsJcURVXrhXz6HC6he8dK7Nq4rxxw/Ap3aD2bEHn7 AUOg== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=2Q2NnTKtD1OMki9ibPGXzULUe1m+VCIPHRUQ4VvCyao=; b=o3cAnbAfkGV1yyrD7AFWrWMAy40xD1cqv7FXM47RDRqdZsiKOk8S5o4ClMUU62U4or 0Oe7X3JPQI/yhCAERRO4FrB5ZsZve3c2JTsdgMGpC2QWzUWb5pDrDhe9DDvredKgC0HS 67HZu2usmpPRcEFp6rT61twI6sEOSeCuyH8cBaJoFogNfUlDmMp3++qFQpJeCy0siC/v TAIkJoEYs6pg8BYAGdiARzdj+DqyDnWcaXenLm8elXI1DcmUr/hRjuU2rMroEWEDdpSb J88/1LbFj4QaMzI/5c1QSkmEg9t6e27Ui3Q3G63ayXsWAp6daH+p0VZcXVgPv8xgUBxx 217g== X-Gm-Message-State: AOAM53319glvGLP/YKo+Cme0pk4iYX6iJjX3aFyN+/9A4HFcPp3v1xpx XCrwqUESnx7O5arw3Zwbw6CY9w== X-Google-Smtp-Source: ABdhPJw/Vj/yYzSmSOoWQKOXRSSsPJJohnuzXED3EHrH3LPqV7+JERFT7S2akuv4W7hhjUCxYYFZYQ== X-Received: by 2002:ac8:4741:: with SMTP id k1mr6202240qtp.250.1589585692954; Fri, 15 May 2020 16:34:52 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id x24sm3381180qth.57.2020.05.15.16.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 16:34:52 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id E63963006AF; Fri, 15 May 2020 19:34:46 -0400 (-04) Date: Fri, 15 May 2020 19:34:46 -0400 From: Alvaro Herrera To: Michael Paquier Cc: Postgres hackers , Thomas Munro Subject: Re: pg_stat_wal_receiver and flushedUpto/writtenUpto Message-ID: <20200515233446.GA334@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200515230539.GC212736@paquier.xyz> 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-May-16, Michael Paquier wrote: > On Fri, May 15, 2020 at 01:43:11PM -0400, Alvaro Herrera wrote: > > Why do you put the column at the end? I would put written_lsn before > > flushed_lsn. > > Fine by me. I was thinking yesterday about putting the written > position after the flushed one, and finished with something that maps > with the structure. IIRC the only reason to put the written LSN where it is is so that it's below the mutex, to indicate it's not protected by it. Conceptually, the written LSN is "before" the flushed LSN, which is why I propose to put it ahead of it. > > Since this requires a catversion bump, I think it'd be best to do it > > before beta1 next week. > > Yes. What do you think of the attached? Yeah, that seems good (I didn't verify the boilerplate in pg_stat_get_wal_receiver or pg_proc.dat). I propose + Last write-ahead log location already received and written to + disk, but not flushed. This should not be used for data + integrity checks. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services