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 1l51SM-0007Ux-5y for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jan 2021 07:11:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l51SK-0003Sn-Ti for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jan 2021 07:11: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 1l51SK-0003Se-Mw for pgsql-hackers@lists.postgresql.org; Thu, 28 Jan 2021 07:11:04 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l51SF-0007l0-Db for pgsql-hackers@postgresql.org; Thu, 28 Jan 2021 07:11:04 +0000 Received: by mail-pg1-x536.google.com with SMTP id o16so3697050pgg.5 for ; Wed, 27 Jan 2021 23:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=u2nKgQARevli7WTj5EmeAnWjBCEbDe9nXjKtQTDtS2Q=; b=aY520rQ/k3WZFGZKNr86suSOP75hbh4N4iLPMd+Riv7S9xl7adaIpTInivehbSPphB LuJbGKvlKm352xUIujT/LCrSDPtUoSw4ErlI2cv4qr0Euqae+XZMdCyRMGKiTP0cTZJG 6PpXAl3xzI34eQV4U65UYUWOrkKf3vdc30/PQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=u2nKgQARevli7WTj5EmeAnWjBCEbDe9nXjKtQTDtS2Q=; b=oyTYIfL9OGJInDdTJT5I2o0abTcy0GXmXUYptiJa29rHcQNha5Cn7jtzoIk4odlAPZ NG8rfFx0FrZQ9o98M9DhEBOVCf34zDPsZyuw/ce923gXYmTtfhs68AblJ1ypc4WWAMEk DzREvdZSDXAt6MTR26kF0kh0EIA8avRoLHqvcOLrXB90EZUJxwsWon6eppSsJ+gcbiDh HTVIl8cJEX74uEx3FHpLT5WnpfeQF/SX64JZblOVvZ2abYc8fFtqb7xOHqP9eumh9GOE i250AyIft2fAeW54eQG8Z5sRsPEzCFGpaCilIkMdNnHOvoUTDYhSDu8z8/F9pcihsfxd JNzA== X-Gm-Message-State: AOAM532LzLW1jxmppJP6yxwcMqBsh3IfVgxp0vY37fbZWIt2yeryHO7j QleIiUv+dx7SuS5+wukn6INJZQ== X-Google-Smtp-Source: ABdhPJzEXiAei4u7YDKGNFVyckQSebykZobgj79WhSaadniJqrbcbvAIA6IkofITpAr2g4C4iucqyw== X-Received: by 2002:a63:7402:: with SMTP id p2mr15220079pgc.101.1611817856458; Wed, 27 Jan 2021 23:10:56 -0800 (PST) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id n3sm4676043pfq.19.2021.01.27.23.10.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jan 2021 23:10:55 -0800 (PST) Date: Wed, 27 Jan 2021 23:10:53 -0800 From: Noah Misch To: Kyotaro Horiguchi Cc: pgsql-hackers@postgresql.org, andres@anarazel.de Subject: Re: Wrong usage of RelationNeedsWAL Message-ID: <20210128071053.GB2575106@rfd.leadboat.com> References: <20210121.180211.1817909680822521903.horikyota.ntt@gmail.com> <20210121092336.GB2008067@rfd.leadboat.com> <20210127104848.GA2508213@rfd.leadboat.com> <20210128.120627.428085297656501787.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210128.120627.428085297656501787.horikyota.ntt@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jan 28, 2021 at 12:06:27PM +0900, Kyotaro Horiguchi wrote: > At Wed, 27 Jan 2021 02:48:48 -0800, Noah Misch wrote in > > On Thu, Jan 21, 2021 at 01:23:36AM -0800, Noah Misch wrote: > > > On Thu, Jan 21, 2021 at 06:02:11PM +0900, Kyotaro Horiguchi wrote: > > > > Perhaps I'm missing something, but the patch doesn't pass the v5-0001 > > > > test with wal_level=minimal? > > > > > > Correct. The case we must avoid is letting an old snapshot read an > > > early-pruned page without error. v5-0001 expects "ERROR: snapshot too old". > > > The patch suspends early pruning, so that error is not applicable. > I studied the sto feature further and concluded that the checker side > is fine that it always follow the chages of page-LSN. > > So what we can do for the issue is setting seemingly correct page LSN > at pruning or refrain from early-pruning while we are skipping > WAL. The reason I took the former is I thought that the latter might > be a problem since early-pruning would be postponed by a long-running > wal-skipping transaction. Yes, that's an accurate summary. > So the patch looks fine to me. The commit message mekes sense. > > However, is it ok that the existing tests (modules/snapshot_too_old) > fails when wal_level=minimal? That would not be okay, but I'm not seeing that. How did your setup differ from the following? [nm@rfd 6:1 2021-01-27T23:06:33 postgresql 0]$ cat /nmscratch/minimal.conf log_statement = all wal_level = minimal max_wal_senders = 0 log_line_prefix = '%m [%p %l %x] %q%a ' [nm@rfd 6:1 2021-01-27T23:06:38 postgresql 0]$ make -C src/test/modules/snapshot_too_old check TEMP_CONFIG=/nmscratch/minimal.conf ============== creating temporary instance ============== ============== initializing database system ============== ============== starting postmaster ============== running on port 58080 with PID 2603099 ============== creating database "isolation_regression" ============== CREATE DATABASE ALTER DATABASE ============== running regression test queries ============== test sto_using_cursor ... ok 30168 ms test sto_using_select ... ok 24197 ms test sto_using_hash_index ... ok 6089 ms ============== shutting down postmaster ============== ============== removing temporary instance ============== ===================== All 3 tests passed. =====================