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 1rZg9z-005pLW-Sv for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Feb 2024 23:56:28 +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 1rZg9y-00EJnF-L1 for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Feb 2024 23:56:26 +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 1rZg9y-00EJmD-76 for pgsql-hackers@lists.postgresql.org; Mon, 12 Feb 2024 23:56:26 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rZg9v-006tJf-CV for pgsql-hackers@lists.postgresql.org; Mon, 12 Feb 2024 23:56:25 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1d958e0d73dso26155465ad.1 for ; Mon, 12 Feb 2024 15:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1707782181; x=1708386981; darn=lists.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=klBbuhqn4DSpYdXxp4A7F+JnMSwVI08zm5XbIwv6ogg=; b=pgaTvpjMK+4Jd4E0UHkmjWAnpX0PxjQgNN48uVwCAgWusZrlO3SqXGjvqRU8oZi5ye p/s2fPKLKdL5xjPfd7tQi73R64HDyT7BlUkTiE+iscwgs1me5PQPI1006fQeRhP1LoKh i8JEM269eZrKnQHtrpfjxRbpaSCin+jRMn4aEWKjRqSXb4NOgx8ExiM9A1NxQDjqGS1k U1OWPlXzdlFclsZAGtlKRdTQoJdkD1iKVQ4trjvi98CY6U74nuaPAhKVlu0DT6GGmuz1 KdVSSzwp49OgU8THTt6C8LXU5M/EiKxYgJ8DDHx7iOthTbVLbAeqr/VT6VNK+NHiT5bm izJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707782181; x=1708386981; 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=klBbuhqn4DSpYdXxp4A7F+JnMSwVI08zm5XbIwv6ogg=; b=p78PbWncgYmJ4gxBkMkJRaX4l3nmkIXi1Hi43uPnKNgxd4E3l2geF6h15WoYT9hiIn VhQohuXYXxRz/MFYQFtBVJVpYbWwx/e5ATNIPbKvxe2Ht8uqdXmJSlVbaxTpeagtMGqu iZzJdJP25/aeUSpYGm4wtOTPQjVxR8Fa3zZdZbXmQj9bEEvjlfKRUinVzFchz1DKNaj2 Rp1Rl0hslUMNJW+Ujs0z+0YaQKRbykwETgndq3IwOL9oiTLrr0W0Nj61jcIGfEbCfKsi lOcP/4mjY+mfhYm+lqSRd7F9ORS2UEwhlS86/LOZv0rVMeaPwsRVy2D9E9/zmZ9OQeo9 r01Q== X-Forwarded-Encrypted: i=1; AJvYcCWtx6uYEb9/w18Dmu5yg3JFGAAIkuDpr+0wDIi6Z1eIvJJIUdfPDlz89KJZOLeIoqbig2mohe0qQl598i3IjEO++ez+b4waOHtFjUtD3zY9X9GX X-Gm-Message-State: AOJu0YxFE8euJk745eamUPvSr9vVP9E7rJpXuXK4EzLGTj+BFZLsgB0/ UCLOoAXKysu8FWIsxLrK7NIm0ucBvp3M4IYW+zcbW+dYKHPM0BxwXEVtFPPj0A== X-Google-Smtp-Source: AGHT+IFIXRemwjLZkHodyKsQ6E2PexRJNZDiEjpNlsehHNQFVtwTkD28B/QEwUn80j26qSVJiozBxA== X-Received: by 2002:a17:902:9890:b0:1d5:6d76:997a with SMTP id s16-20020a170902989000b001d56d76997amr1023526plp.28.1707782181013; Mon, 12 Feb 2024 15:56:21 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWPu0pD0qjmmhwOmut30lrD4W4HFqU67T54/TkjO0gB8+m1SprYtNa0qG31tElgYIiCKXF3Pvhs/axfN32o6kl4/dXPNwbo6f3oe5oPFejbdW3Yn1Bb7aO8yoqviKQHVYETP7Ro2SPvERVJWwJ7vOWChY3DUYEXrGHHtgJfZchfgXnAw6wZycnjXsnTO3S3dkseMVFUFQaKR6LeVlbn6ng4sAww43IMrW20sVpf05fwHlUtxZVcQ+tMMPMn0qOCj8Q0D/ef2tBGisl45Ms= Received: from [172.18.10.46] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id h4-20020a170902748400b001da2fdd4cdesm882620pll.36.2024.02.12.15.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 15:56:20 -0800 (PST) Message-ID: Subject: Re: Improve WALRead() to suck data directly from WAL buffers when possible From: Jeff Davis To: Bharath Rupireddy , Alvaro Herrera Cc: Andres Freund , Dilip Kumar , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org, Nathan Bossart , Masahiko Sawada Date: Mon, 12 Feb 2024 15:56:19 -0800 In-Reply-To: References: <202401301731.o3cthlcry4ve@alvherre.pgsql> 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-12 at 11:33 -0800, Jeff Davis wrote: > For 0002 & 0003, I'd like more clarity on how they will actually be > used by an extension. In patch 0002, I'm concerned about calling WaitXLogInsertionsToFinish(). It loops through all the locks, but doesn't have any early return path or advance any state. So if it's repeatedly called with the same or similar values it seems like it would be doing a lot of extra work. I'm not sure of the best fix. We could add something to LogwrtResult to track a new LSN that represents the highest known point where all inserters are finished (in other words, the latest return value of WaitXLogInsertionsToFinish()). That seems invasive, though. Regards, Jeff Davis