Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcSRY-00FQ3T-4n for pgsql-bugs@arkaria.postgresql.org; Sat, 02 Sep 2023 15:21:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qcSRW-008ZJ4-RQ for pgsql-bugs@arkaria.postgresql.org; Sat, 02 Sep 2023 15:21:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcSRW-008ZHV-I5 for pgsql-bugs@lists.postgresql.org; Sat, 02 Sep 2023 15:21:46 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qcSRQ-002Yfu-2Z for pgsql-bugs@lists.postgresql.org; Sat, 02 Sep 2023 15:21:43 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3a8614fe8c4so29061b6e.1 for ; Sat, 02 Sep 2023 08:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693668097; x=1694272897; darn=lists.postgresql.org; h=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=5IFFe/Jk6b8iLsAFfBhIvhZTNAg6Qfo9VV5/kMSCtiY=; b=LlgNaw/aZV+tAI99vVtjNLI2FDPYRuiab9XXRjtny+GwhM/15m8TBEb+IbhutjRKoo wnuDBu9bXNI5tMMqmgZBMjH45K5rH3n/R4q949kxoHRizy25aAQZGd51rIeNr9Oyll3h 9IHFuoko6IEDEUcCTzkl7PeUn/JUltfpJ0nzTdNlHG7ch+PCpWoxPXv3HNBh4mY3XjCg gagoCCxGymjwUPVEVFip4n5hveobCE06UCCpEOe+edgQkxZzbagR9MAnczPgYMFMjk0n Faz2pYZQpo9s64aYCHwUUpAykCDTTzHss1i1JOPEn2IB3DmWydOnSmcJLGRyxDfLcqNy x/cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693668097; x=1694272897; h=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=5IFFe/Jk6b8iLsAFfBhIvhZTNAg6Qfo9VV5/kMSCtiY=; b=DxU9TfZ2y3wAl/4WbnLER61+8yWFdOw9/cfrlVKDPfA51k40kvyvHV4mG/QbvfAU0z qR8HIIwnS6FPDgzoOav54rRvtRJ+299Gnu4rlzY3zTQfeDgRKJoAa8e3QP52NstcQuN/ acVxZewElx0epmj4xDqRUT6eGtWWSFcqEAoRhkVEvYHnfA/zv/E7aXeMyrTTipmOLQ6h er64U4Y11eWtB4E0bb59lIz11XyxT4diFLAmwuaPNuVdxtXniqHqF3KEAgPqi/93xTUf hAPs/V2Bon0rrYioGNbBbZdzMxvz2+6+4eNE/Yx/X/j8/T+S0sgPhGBFcAPAUjpU5poU P0EQ== X-Gm-Message-State: AOJu0YwvivJtzmSiCjTlwm7PtPUqzKu1v6Gk0McKGdaAuI7FwmnLrNF5 3ncYN24L2sc4uTbbqcWuUW/pWRspy58= X-Google-Smtp-Source: AGHT+IFEBBMkxEaJSZ12ipP6I2xdJyeSjRTM96hGYN5wq7H7ckS5zwqKDchekAfINNLKPehwUn80oQ== X-Received: by 2002:a05:6808:a8f:b0:3a7:64b4:81b0 with SMTP id q15-20020a0568080a8f00b003a764b481b0mr5499090oij.25.1693668097543; Sat, 02 Sep 2023 08:21:37 -0700 (PDT) Received: from nathanxps13 ([2600:1700:48f8:340f:9f1b:a645:fdde:4650]) by smtp.gmail.com with ESMTPSA id t8-20020a056808158800b003a76d7f596esm892442oiw.54.2023.09.02.08.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Sep 2023 08:21:36 -0700 (PDT) Date: Sat, 2 Sep 2023 08:21:34 -0700 From: Nathan Bossart To: Michael Paquier Cc: Andres Freund , Jacob Speidel , Will Mortensen , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17973: Reinit of pgstats entry for dropped DB can break autovacuum daemon Message-ID: <20230902152134.GA3320738@nathanxps13> References: <20230812004812.4yev47iili57u4hc@awork3.anarazel.de> <20230901025613.GB3097511@nathanxps13> <20230901152024.GA3175143@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Sep 02, 2023 at 09:08:22AM +0900, Michael Paquier wrote: > On Fri, Sep 01, 2023 at 08:20:24AM -0700, Nathan Bossart wrote: >> Something along those lines seems fine to me. FWIW this is what I had in >> my head: >> >> It is important that MyDatabaseId only be set once we are sure that the >> target database can no longer be concurrently dropped or renamed. Some >> code depends on this. For example, without this guarantee, >> pgstat_update_dbstats() could create entries for databases that were >> just dropped, which will lead to problems down the road. > > I'm mostly OK with this formulation as well, but without the second > sentence and adding as extra that pgstat_update_dbstats() could be > specifically called in the shutdown callback of the shared statistics. WFM -- Nathan Bossart Amazon Web Services: https://aws.amazon.com