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 1pcbGJ-00074o-Co for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 00:14:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcbGI-0003FD-4p for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 00:14:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcbGH-0003F4-Rd for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 00:14:29 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcbGE-00031M-L4 for pgsql-hackers@postgresql.org; Thu, 16 Mar 2023 00:14:28 +0000 Received: by mail-io1-xd33.google.com with SMTP id o14so88388ioa.3 for ; Wed, 15 Mar 2023 17:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; t=1678925666; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xURE/4PPAesmMbZ78MEg6wC40orzcx0uvJndJS2C5zk=; b=RQD+QLHpClLxLLiks+5b2b0fmJEE+1UYyzYPqSiKu9A3AV0AQur/k8VhVlINzxhNYJ UDZSv/B0iCypQygilrqMvl7NCqLCHUcbhTofBJm68R0k/+kgv8HCHJWk56YBwcKW5oQq mnnB0tO/lQcU7Pmhc7s5wGz0jBeMdafU0E/YB/9EVv/xSThrNJht3BoZg+PFmGXxtky8 0/+PBEE08E/W/cc83uGIEJacsYK/5jHL9wOFpFloFgq2LWSqhERl2pWU+uOjKFTjGlG2 /x/osptNfG0ffK7q+J7kfMSHTzfbOF1Sg56Yy2APPoCNUf1utXaKHza1dm8IxnZdvCO7 8Ndw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678925666; h=in-reply-to:content-transfer-encoding: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=xURE/4PPAesmMbZ78MEg6wC40orzcx0uvJndJS2C5zk=; b=BpqMz0pma7L/RCmwI6apdyfYsIg7St7IONk3q3tcOpbCV2O4EBV1TyVmdysFIcwoXl KSuncLh8J1eHt2em0A7/Ho8I5dYnrj0+p/HS67v8I5q2/zHYUvBUOmLcJTBGwQCh8h1e TqId+0qiNkSHsDmZA3yTbEembDvBe41Sx06wd670Oz83VlH09rejV3CS2GjFimPDRG8o vVkW9xhW+V9mBLwMzJ2tIt+BvOisRvF+tP51nR+VbVe84keiQmyrUaFvaysM1Jri/OFD 37XltI307bRKvoGHV7pn6OyXZomCQlZnaj8/jYCm2tr9dMat7sLkRi0B4rCdNLM2AUJk GGUA== X-Gm-Message-State: AO0yUKVu7Pm5jfhvCdYgqt/7hwt3H8ZhXqllVzczDcfAyKV2u8uj9VGu B0RoSBEL8aiJyjWhaNw/M4I9Dw== X-Google-Smtp-Source: AK7set9fbVk4Pnu/SGJHx/okSw94D0uY7K7hppEYRtLi4vmjpXQKdc5T3iLGzLK33YFFFA/CmJZgng== X-Received: by 2002:a5d:8504:0:b0:716:cc63:cf38 with SMTP id q4-20020a5d8504000000b00716cc63cf38mr24616002ion.1.1678925665852; Wed, 15 Mar 2023 17:14:25 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id r1-20020a6bd901000000b007407cafe4desm885556ioc.21.2023.03.15.17.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 17:14:25 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 2FB9B800778; Wed, 15 Mar 2023 19:14:24 -0500 (CDT) Date: Wed, 15 Mar 2023 19:14:24 -0500 From: Justin Pryzby To: Melanie Plageman Cc: Bharath Rupireddy , Andres Freund , Tom Lane , Peter Geoghegan , pgsql-hackers@postgresql.org, Robert Haas , David Rowley Subject: Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode Message-ID: References: <20230111191842.5ywh7twkis42kxad@awork3.anarazel.de> <669645.1673471914@sss.pgh.pa.us> <20230111213905.4ljixbm2oyqzvzzx@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 14, 2023 at 08:56:58PM -0400, Melanie Plageman wrote: > On Sat, Mar 11, 2023 at 2:16 PM Justin Pryzby wrote: > > > @@ -586,6 +587,45 @@ GetAccessStrategy(BufferAccessStrategyType btype) > > > +BufferAccessStrategy > > > +GetAccessStrategyWithSize(BufferAccessStrategyType btype, int ring_size) > > > > Maybe it would make sense for GetAccessStrategy() to call > > GetAccessStrategyWithSize(). Or maybe not. > > You mean instead of having anyone call GetAccessStrategyWithSize()? > We would need to change the signature of GetAccessStrategy() then -- and > there are quite a few callers. I mean to avoid code duplication, GetAccessStrategy() could "Select ring size to use" and then call into GetAccessStrategyWithSize(). Maybe it's counter to your intent or otherwise not worth it to save 8 LOC. > > > +#vacuum_buffer_usage_limit = -1 # size of vacuum buffer access strategy ring. > > > + # -1 to use default, > > > + # 0 to disable vacuum buffer access strategy and use shared buffers > > > + # > 0 to specify size > > > > If I'm not wrong, there's still no documentation about "ring buffers" or > > postgres' "strategy". Which seems important to do for this patch, along > > with other documentation. > > Yes, it is. I have been thinking about where in the docs to add it (the > docs about buffer access strategies). Any ideas? This patch could add something to the vacuum manpage and to the appendix. And maybe references from the shared_buffers and pg_buffercache manpages. > > This patch should add support in vacuumdb.c. > > Oh, I had totally forgotten about vacuumdb. :) > > And maybe a comment about adding support there, since it's annoying > > when it the release notes one year say "support VACUUM (FOO)" and then > > one year later say "support vacuumdb --foo". > > I'm not sure I totally follow. Do you mean to add a comment to > ExecVacuum() saying to add support to vacuumdb when adding a new option > to vacuum? Yeah, like: /* Options added here should also be added to vacuumdb.c */ > In the past, did people forget to add support to vacuumdb for new vacuum > options or did they forget to document that they did that or did they > forgot to include that they did that in the release notes? The first. Maybe not often, it's not important whether it's in the original patch, but it's odd if the vacuumdb option isn't added until the following release, which then shows up as a separate "feature". -- Justin