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 1q0I6O-0000Rx-T1 for pgsql-hackers@arkaria.postgresql.org; Sat, 20 May 2023 08:38:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q0I6L-0006qJ-Ug for pgsql-hackers@arkaria.postgresql.org; Sat, 20 May 2023 08:38:09 +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 1q0I6L-0006qA-J4 for pgsql-hackers@lists.postgresql.org; Sat, 20 May 2023 08:38:09 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q0I6E-000tUU-EC for pgsql-hackers@postgresql.org; Sat, 20 May 2023 08:38:08 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f4ad71b00eso25474725e9.2 for ; Sat, 20 May 2023 01:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684571881; x=1687163881; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fXrShUZ3FoGC+SMcrXeYi7TKgtQ/w61KfmkiZZoPDjA=; b=UaWXcSGKFvW/u8YIf6zuhTo03efE2Je5o2WhlmMd/gLyV+fpsHDtcf+CJTbFnnWcUf nrtiYphK1g9cZhBNRgsw5eq0XUlGJ72CnvgOfcv3bIqdUms6rpBKV2IDqwAT99TIidG1 93xpdxvjUgT5Ev9vw/zl/bXFte8mlYvvM3qzH6Mw3WGHkjqZe73NbWMftFxi/n8cvxmB 10pAd1HPJxtYoMV1o7DLSR9OlSs4hCAeXl71zlGtmW0Im/vgx2RTGGHrUaFayQhjeEWK 6q9RXckam+m3i8hg7D0oYCZjtIedysv7RQtN0Ra+iCDI688pw7fJxrQpZhsVEq8EoY2H rVBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684571881; x=1687163881; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fXrShUZ3FoGC+SMcrXeYi7TKgtQ/w61KfmkiZZoPDjA=; b=EAvMAPjMVzGcB5JA2QVZqDtjohOhURtmZ2kA5pqbrzLPUXKMjqNo1m3Q6D4RW0Jrm/ rHqr3OfaCPrxsnkSG71n8AxVrZgdDIs7ycRa8TjKHYh81wcYowQUMlSHtMqqR3Rb3b5h WbiDPSlXTxTIg1F9AcT6VKDDU3u++d/V5zHwlRQxLgpYe9g/xDMDoBfXGVAmg2zp+rFZ uGFI+g3xwoE8MUhy7w/KaoakufmfgqWdkXlllS37dmUj4guc+ObglS0H0hJAwVjnhS/K zuPpT4IFYiayoZY1TBZskLrPwqfP06mANfoUyJbgjiFBmSAfgdbCiLMktz3czo6mZvWn zyEg== X-Gm-Message-State: AC+VfDy72BC+b4/8sD4VG5FPR3Z4oI9a8LcImFhcxkzcmogs+pyM5bG/ fjrWR9ZgwOjlyMf7VgbtU9M= X-Google-Smtp-Source: ACHHUZ61d54DpBH3qhmTvXSHwliT94teRcP8DumiB/3xiXrI0BqrEqw4P4sOFIMvHAe921x96GjdbQ== X-Received: by 2002:adf:fc44:0:b0:307:a075:2709 with SMTP id e4-20020adffc44000000b00307a0752709mr2896053wrs.68.1684571880885; Sat, 20 May 2023 01:38:00 -0700 (PDT) Received: from [192.168.12.60] ([54.239.6.189]) by smtp.gmail.com with ESMTPSA id m7-20020a5d56c7000000b0030630120e56sm1288934wrw.57.2023.05.20.01.38.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 May 2023 01:38:00 -0700 (PDT) Message-ID: <384324d0-c605-be69-650a-ccf0a88dcee8@gmail.com> Date: Sat, 20 May 2023 10:37:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: PG 16 draft release notes ready To: Bruce Momjian Cc: PostgreSQL-development References: <890b2035-7bd0-c243-de7c-84809b35ffb0@gmail.com> Content-Language: en-US From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 5/19/23 2:29 PM, Bruce Momjian wrote: > On Fri, May 19, 2023 at 09:49:18AM +0200, Drouvot, Bertrand wrote: >> Thanks! >> >> " >> This adds the function pg_log_standby_snapshot(). TEXT?: >> " >> >> My proposal: >> >> This adds the function pg_log_standby_snapshot() to log details of the current snapshot >> to WAL. If the primary is idle, the slot creation on a standby can take a while. >> This function can be used on the primary to speed up the logical slot creation on >> the standby. > > Yes, I got this concept from the commit message, but I am unclear on > what is actually happening so I can clearly explain it. Slot creation > on the standby needs a snapshot, and that is only created when there is > activity, or happens periodically, and this forces it to happen, or > something? And what snapshot is this? The current session's? > It's the snapshot of running transactions (aka the xl_running_xacts WAL record) that is used during the logical slot creation to determine if the logical decoding find a consistent state to start with. On a primary this WAL record is being emitted during the logical slot creation, but on a standby we can't write WAL records (so we are waiting for the primary to emit it). Outside of logical slot creation, this WAL record is also emitted during checkpoint or periodically by the bgwriter. What about? This adds the function pg_log_standby_snapshot() to emit the WAL record that contains the list of running transactions. If the primary is idle, the logical slot creation on a standby can take a while (waiting for this WAL record to be replayed to determine if the logical decoding find a consistent state to start with). In that case, this new function can be used on the primary to speed up the logical slot creation on the standby. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com