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 1hLakI-0002cX-J8 for pgsql-committers@arkaria.postgresql.org; Tue, 30 Apr 2019 21:57:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLakG-0005qV-Qo for pgsql-committers@arkaria.postgresql.org; Tue, 30 Apr 2019 21:57:00 +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 1hLakG-0005om-Fd for pgsql-committers@lists.postgresql.org; Tue, 30 Apr 2019 21:57:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLakE-0002sh-75 for pgsql-committers@lists.postgresql.org; Tue, 30 Apr 2019 21:56:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3ULul0q027246; Tue, 30 Apr 2019 17:56:47 -0400 From: Tom Lane To: Julien Rouhaud cc: Tomas Vondra , Magnus Hagander , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Track block level checksum failures in pg_stat_database In-reply-to: References: <20190430163328.zd4rrlnbvgaqlcdz@development> Comments: In-reply-to Julien Rouhaud message dated "Tue, 30 Apr 2019 23:41:55 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27244.1556661407.1@sss.pgh.pa.us> Date: Tue, 30 Apr 2019 17:56:47 -0400 Message-ID: <27245.1556661407@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Julien Rouhaud writes: > On Tue, Apr 30, 2019 at 6:33 PM Tomas Vondra > wrote: >> It seems this commit forgot to add PgStat_MsgChecksumFailure to the >> PgStat_Msg union. > Oops, indeed. That's embarrassing. Trivial fix attached if that helps. Seems like this exposes a generic weakness in the way pgstat.c is coded. I'm inclined to adjust the switch logic in PgstatCollectorMain along the lines of - pgstat_recv_inquiry((PgStat_MsgInquiry *) &msg, len); + pgstat_recv_inquiry(&msg.msg_inquiry, len); so that you *couldn't* forget to extend the union, as long as you followed the existing code's style. regards, tom lane