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 1pUgRw-0006nu-KZ for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Feb 2023 04:09:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pUgRu-0007Ab-Bo for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Feb 2023 04:09:46 +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 1pUgRt-00076i-VJ for pgsql-hackers@lists.postgresql.org; Wed, 22 Feb 2023 04:09:46 +0000 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pUgRp-00060T-Hs for pgsql-hackers@postgresql.org; Wed, 22 Feb 2023 04:09:45 +0000 Received: by mail-io1-xd2d.google.com with SMTP id f14so291692iow.5 for ; Tue, 21 Feb 2023 20:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=i3MB+8W0KHCIfQglRE0Fg70BebE34gSzQqP74xOqR8U=; b=XybrKxKrIlqWxsuKSshOvZE6n66njg9+OChHZ0Eb/hAdE58LYmL9VEtIjyTIr0xpKe PySTrpldcnhtWZ5OkKux3+P702w/cAlOsMyITp9jsYW/6pziZpCsg/oNJUHrWGk4WJlj WgbIltbIgAx+WcVC0VBBvf9vbCtmjqMgB6bSy5S0oJttS5OgcVnflSfiDXpbblZu53tK 6n11jfU4BxybiB5daFt+sT3RaH260T5ZMCvN5VWjyQtdtFOowuRRj6DLrH1fx7+6iKou /LSiEaYAGk0K++PnT/fS/G4m1ACwL1+syQ7i/Wr9+henhyFOQKh/bOIisAm1E3qlL++s S62A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i3MB+8W0KHCIfQglRE0Fg70BebE34gSzQqP74xOqR8U=; b=a2U/jnbPiwhZeXHrqjSJQNjyoOIBef9Hn70s5nC1bT5v3PUHgLl4PZvW2Op1xwZrIb 462S+KqrBwxTvEqGaPXpFvxHr3U/Qg7Owwb9nuBZkRMS/xEBEJDpBJc9IIVEFX5RTAxp J7e5+RACvbz7BKtdo0KUFWyG5QPbwZHL277SW1yb8QY1X7jhFZXhDCR/4QWtzcg76HS0 /tfbQonywkpOwnl1xJtrPKv3+L9hYSI6cBfj0xHDrtpOi//i+oxb96WQeXd7qmVUi675 xEI8UKjzSrMLFnJtlD7bDlSfSM4WCp51cx4J454KJcyLz/i7WSCMvUI1K9rhMimIiNru wVQA== X-Gm-Message-State: AO0yUKWg0SWJdgvILBdmaApSt/f3Btx4TZHpkpkwwi+0pIdun6CzwYf4 IKB3O/tPW94eXgn+gmuBMlJ+vg== X-Google-Smtp-Source: AK7set+GC8cMBVZkeS6dLziJvBlWMcBKXGH1NmejkgtvW61aa0GJu7urRLBbPwiWZlcnGEGqLpqgXA== X-Received: by 2002:a6b:fd06:0:b0:74c:82ae:7326 with SMTP id c6-20020a6bfd06000000b0074c82ae7326mr3172625ioi.2.1677038979438; Tue, 21 Feb 2023 20:09:39 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id a17-20020a02ac11000000b003c4eb5cb22csm897221jao.134.2023.02.21.20.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 20:09:38 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id A67EC800CA7; Tue, 21 Feb 2023 22:09:37 -0600 (CST) Date: Tue, 21 Feb 2023 22:09:37 -0600 From: Justin Pryzby To: Andres Freund Cc: Kyotaro Horiguchi , melanieplageman@gmail.com, vignesh21@gmail.com, lukas@fittl.com, alvherre@alvh.no-ip.org, magnus@hagander.net, pgsql-hackers@postgresql.org, thomas.munro@gmail.com, m.sakrejda@gmail.com Subject: Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?) Message-ID: <20230222040937.GR1653@telsasoft.com> References: <20230124.172203.448918351330829200.horikyota.ntt@gmail.com> <20230124223512.xqp7tjgqvzqokaxq@awork3.anarazel.de> <20230125.165617.724951472557617342.horikyota.ntt@gmail.com> <20230208063814.boyh5ibydbfuo2uk@awork3.anarazel.de> <20230209050319.chyyup4vtq4jzobq@awork3.anarazel.de> <20230211182437.ype5tk3awen2htvw@awork3.anarazel.de> <20230222015035.GQ1653@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230222015035.GQ1653@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Feb 21, 2023 at 07:50:35PM -0600, Justin Pryzby wrote: > On Sat, Feb 11, 2023 at 10:24:37AM -0800, Andres Freund wrote: > > On 2023-02-08 21:03:19 -0800, Andres Freund wrote: > > > Pushed the first (and biggest) commit. More tomorrow. > > > > Just pushed the actual pg_stat_io view, the splitting of the tablespace test, > > and the pg_stat_io tests. > > pg_stat_io says: > > * Some BackendTypes do not currently perform any IO in certain > * IOContexts, and, while it may not be inherently incorrect for them to > * do so, excluding those rows from the view makes the view easier to use. > > if (bktype == B_AUTOVAC_LAUNCHER && io_context == IOCONTEXT_VACUUM) > return false; > > if ((bktype == B_AUTOVAC_WORKER || bktype == B_AUTOVAC_LAUNCHER) && > io_context == IOCONTEXT_BULKWRITE) > return false; > > What about these combinations? Aren't these also "can't happen" ? > > relation | bulkread | autovacuum worker > relation | bulkread | autovacuum launcher > relation | vacuum | startup Nevermind - at least these are possible. (gdb) p MyBackendType $1 = B_AUTOVAC_WORKER (gdb) p io_object $2 = IOOBJECT_RELATION (gdb) p io_context $3 = IOCONTEXT_BULKREAD (gdb) p io_op $4 = IOOP_EVICT (gdb) bt ... #9 0x0000557b2f6097a3 in ReadBufferExtended (reln=0x7ff5ccee36b8, forkNum=forkNum@entry=MAIN_FORKNUM, blockNum=blockNum@entry=16, mode=mode@entry=RBM_NORMAL, strategy=0x557b305fb568) at ../src/include/utils/rel.h:573 #10 0x0000557b2f3057c0 in heapgetpage (sscan=sscan@entry=0x557b305fb158, block=block@entry=16) at ../src/backend/access/heap/heapam.c:405 #11 0x0000557b2f305d6c in heapgettup_pagemode (scan=scan@entry=0x557b305fb158, dir=dir@entry=ForwardScanDirection, nkeys=0, key=0x0) at ../src/backend/access/heap/heapam.c:885 #12 0x0000557b2f306956 in heap_getnext (sscan=sscan@entry=0x557b305fb158, direction=direction@entry=ForwardScanDirection) at ../src/backend/access/heap/heapam.c:1122 #13 0x0000557b2f59be0c in do_autovacuum () at ../src/backend/postmaster/autovacuum.c:2061 #14 0x0000557b2f59ccf7 in AutoVacWorkerMain (argc=argc@entry=0, argv=argv@entry=0x0) at ../src/backend/postmaster/autovacuum.c:1716 #15 0x0000557b2f59cdd8 in StartAutoVacWorker () at ../src/backend/postmaster/autovacuum.c:1494 #16 0x0000557b2f5a561a in StartAutovacuumWorker () at ../src/backend/postmaster/postmaster.c:5481 #17 0x0000557b2f5a5a39 in process_pm_pmsignal () at ../src/backend/postmaster/postmaster.c:5192 #18 0x0000557b2f5a5d7e in ServerLoop () at ../src/backend/postmaster/postmaster.c:1770 #19 0x0000557b2f5a73da in PostmasterMain (argc=9, argv=) at ../src/backend/postmaster/postmaster.c:1463 #20 0x0000557b2f4dfc39 in main (argc=9, argv=0x557b30568f50) at ../src/backend/main/main.c:200 -- Justin