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 1nRaD3-00061r-Kv for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Mar 2022 13:49:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nRaD2-00020Q-EM for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Mar 2022 13:49:04 +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 1nRaD1-00020H-PE for pgsql-hackers@lists.postgresql.org; Tue, 08 Mar 2022 13:49:04 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nRaCx-0006lO-DI for pgsql-hackers@postgresql.org; Tue, 08 Mar 2022 13:49:03 +0000 Received: by mail-wr1-x432.google.com with SMTP id r10so28674840wrp.3 for ; Tue, 08 Mar 2022 05:48:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=nP/Dkoxj7Xzo7bs+8qhT9KPWgmuWGBSP9DxZnXoBj2M=; b=IddK9ZX9p8kz41gdXiIvzDJA4DAFEvfDTSeAW3DRn46i0HT2lJeqZpPQlfePgaCoNk ktF/PczyBbjQiQRS3K/R3vJv0HNbn5uJuCu05Tq9KSRCcsd6rSPb8XmH9s9z96j5vpn7 Fg2u5DTVT9QjZRZGMDKTJXBX0/oySznPbxcRt1LUO4Y3XBCl+8sn0XFAgTdlck3fMPrH ZYhpwvlhuvz2maoGOOwq7m0zp1JViGg/xhPrSgZsZ91IrElrKSp9MFZ7ECcq+KQoH7ju chB2KPRsCzAjP/NndzBD1bvuEO9EoINtt6xOjMob+INz7cFJdGGqdKJ/L8xCCRSvVmXe iFUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=nP/Dkoxj7Xzo7bs+8qhT9KPWgmuWGBSP9DxZnXoBj2M=; b=m0Bkvsi8wMymHOmOgg+xoyAHGxsMzSo70kqU3mt1YrM5riSDd9lxdV5euryHlC+kE+ l8tlpIqUUGKldKDi6RYxzHZ+0UJPlN/C+GEA56yQCueU9D/nLAO8F7Wwh0Sqsvo+ZOHY nT2q8JGO90GVUQnn470Cx3y1jVewenvVvuSTiT0Ij5PCdGGlJkEwmkrrMFYM/X5bohts PbBNdP1MKDhiYH7Lm+GXQnq53c79dgzaW7bW1KGWIAgQF+SPNVZnYik/lB9FuGDkR8uE MiE1fRglMCgkiZ6Hv8UcVFhK9MF57yvWp+5+y/jWNsG7l2hp2W21bKwrKfZ9SVz7s8P/ Zwrg== X-Gm-Message-State: AOAM533m70MJnjkbIJZcl9BPBurNCuRgZym8rstttAMFViNLkTkdE8Rg MqBvp7dbByX3hTWVFFaH0Pbt3YjkoauVXeYk7LbDXflncRUyiiKjum8YMiHkxUSZoAsBnyJ0NBZ SukrBL0IckpVjVUyeoc0W872zuJ1ggvpCjQTY3obvH47CnXaENkdnCXpOVX5f1Vrl7aLd44Lk9r sk4rJMnP/Svos7EpgXxiDUzwFatyisgceKpv8r X-Google-Smtp-Source: ABdhPJwg17DSDvwLtRqe6gMdX+p/AGImdHOD1kv6eHwbX4aVxJPP+Kblij3LJeIEflvPZuE2ag2ytg== X-Received: by 2002:a05:6000:2a8:b0:1f1:f958:46f2 with SMTP id l8-20020a05600002a800b001f1f95846f2mr7310187wry.536.1646747338053; Tue, 08 Mar 2022 05:48:58 -0800 (PST) Received: from [10.137.0.18] (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id b15-20020adfc74f000000b001e888b871a0sm14207069wrh.87.2022.03.08.05.48.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 05:48:57 -0800 (PST) Message-ID: <1392587c-c56a-2816-e3cf-4202a216a3be@enterprisedb.com> Date: Tue, 8 Mar 2022 14:48:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: WIP: WAL prefetch (another approach) Content-Language: en-US To: Thomas Munro , Ashutosh Sharma Cc: Daniel Gustafsson , Stephen Frost , Alvaro Herrera , Andres Freund , David Steele , Dmitry Dolgov <9erthalion6@gmail.com>, Jakub Wartak , Tom Lane , Tomas Vondra , pgsql-hackers References: <773932.1619022622@sss.pgh.pa.us> <5B6070FF-5869-4A84-88BC-2D04EDCDB858@yesql.se> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/8/22 06:15, Thomas Munro wrote: > On Wed, Dec 29, 2021 at 5:29 PM Thomas Munro wrote: >> https://github.com/macdice/postgres/tree/recovery-prefetch-ii > > Here's a rebase. This mostly involved moving hunks over to the new > xlogrecovery.c file. One thing that seemed a little strange to me > with the new layout is that xlogreader is now a global variable. I > followed that pattern and made xlogprefetcher a global variable too, > for now. > > There is one functional change: now I block readahead at records that > might change the timeline ID. This removes the need to think about > scenarios where "replay TLI" and "read TLI" might differ. I don't > know of a concrete problem in that area with the previous version, but > the recent introduction of the variable(s) "replayTLI" and associated > comments in master made me realise I hadn't analysed the hazards here > enough. Since timelines are tricky things and timeline changes are > extremely infrequent, it seemed better to simplify matters by putting > up a big road block there. > > I'm now starting to think about committing this soon. +1. I don't have the capacity/hardware to do more testing at the moment, but all of this looks reasonable. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company