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 1reh54-00CsNY-DD for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Feb 2024 19:56:06 +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 1reh51-00GNoj-Oq for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Feb 2024 19:56:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1reh51-00GNob-BI for pgsql-hackers@lists.postgresql.org; Mon, 26 Feb 2024 19:56:03 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1reh4y-001Hak-1e for pgsql-hackers@postgresql.org; Mon, 26 Feb 2024 19:56:02 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1dbae7b8ff2so16169315ad.3 for ; Mon, 26 Feb 2024 11:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1708977360; x=1709582160; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=iDkkw+pIGclzGnc/D5IsmpLpdUcHGjU5KX7G9qlj8LQ=; b=QF3xU2EUg/OcC1sj7q7PMi7eqZm4yle6+PlspuEQqjWPYGZ8vCFaIKUXrLS6/aDNwA d9BAoPdY2lZkxRlZkkbRI9v3qrucA9525ymDtAneenDUB1pE0yM/57aVjwtKyqK3+u4j ii75jD4YcjmTvks4Qzv9wWPydi3MyRH/WHzfQIL9mZsAPd1fWDylaGrtAPJyoQG4A8An SsbVSiFpvt4Ikza+WEqZYeQMQ3c8Pzd/do3eWhFJ9tb4SEt0zXv7BcvajYlAgLnKCjYP d66VhbGwI66Yqzrr+J9sQQnc03KtGGYSCpy1MGXLwYa43XUjde69sdBu90jGg1/7PXFo GvsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708977360; x=1709582160; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iDkkw+pIGclzGnc/D5IsmpLpdUcHGjU5KX7G9qlj8LQ=; b=uIzZDziqvivlAt8Vm7xpWXYdYrC7o4FwP8XB57NZ43T/ykQejIZ6TYD+FeAHz7cxhH 3+nCE299h0wM2GwB1w4Jrwdm6NXykemkUynQ+yi2VtWNWMBImBoGpDGdZpGt9p7IvThQ +/WWsGKJ7E7pZVldMoJREWBCzkMyzcy88GpolNu3KRUtnQHT0fRf5cwiHIZ0FZsyQhRe X4KyHZDIAPgAVSQrScZ0vVKlOSpk1PjRsL2gGCUSNzWzJMCiCo7eVQ2FiMyA3RSbvBhx iuDmWuqaw2y+od7UWR6HFMgiUOrl8loMVl7LY0miDm7fYMvvrp7pS62dYsLWSi1Zlw+G Wv7A== X-Forwarded-Encrypted: i=1; AJvYcCXx4EjP4qndBN3h7AZEeVCY41TXvCBoXVaNGJ4zZaIv35bYkKybLc5ibg9bb44jHFbtJOYDMt0IOxYT+76SCRb/tPKD5q4NH23a9djQ X-Gm-Message-State: AOJu0YzIE3KJfALIjWMwH16hrrb7piGRuIc6fgthv+TwQEHnQSrtEDxh vuFmEYkDsCINwFg7mMd4+sM1anHoYRZphxDON485LHHTfVDvKBnwC+Ybf1zjMw== X-Google-Smtp-Source: AGHT+IECdmiJdTgBIv3bkEEjdanooE82fFOo5NJirXpNl9lhHAkebhJZZeaG9sZjM4rlSbE6EI/Ubw== X-Received: by 2002:a17:903:985:b0:1db:c6ff:6648 with SMTP id mb5-20020a170903098500b001dbc6ff6648mr8462907plb.10.1708977360330; Mon, 26 Feb 2024 11:56:00 -0800 (PST) Received: from [172.18.10.46] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id j21-20020a170902c3d500b001db5eb52911sm74545plj.89.2024.02.26.11.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 11:55:59 -0800 (PST) Message-ID: <0892cd00635c8bcd458de6d43d31cf61953da1b2.camel@j-davis.com> Subject: Re: Comments on Custom RMGRs From: Jeff Davis To: Danil Anisimow , Simon Riggs Cc: Andres Freund , PostgreSQL Hackers Date: Mon, 26 Feb 2024 11:55:58 -0800 In-Reply-To: References: <20220512034010.4oqa76pasrulkw32@alap3.anarazel.de> <20220512234207.pwwp6q33f72byet2@alap3.anarazel.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2024-02-26 at 23:29 +0700, Danil Anisimow wrote: > Hi, >=20 > The checkpoint hook looks very useful, especially for extensions that > have their own storage, like pg_stat_statements. > For example, we can keep work data in shared memory and save it only > during checkpoints. > When recovering, we need to read all the data from the disk and then > repeat the latest changes from the WAL. Let's pick this discussion back up, then. Where should the hook go? Does it need to be broken into phases like resource owners? What guidance can we provide to extension authors to use it correctly? Simon's right that these things don't need to be 100% answered for every hook we add; but I agree with Andres and Robert that this could benefit from some more discussion about the details. The proposal calls the hook right after CheckPointPredicate() and before CheckPointBuffers(). Is that the right place for the use case you have in mind with pg_stat_statements? Regards, Jeff Davis