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 1litrw-00064n-6S for pgsql-hackers@arkaria.postgresql.org; Tue, 18 May 2021 07:10:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1litru-0006me-V4 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 May 2021 07:10:18 +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 1litru-0006mV-Lq for pgsql-hackers@lists.postgresql.org; Tue, 18 May 2021 07:10:18 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1litrs-00045A-2d for pgsql-hackers@postgresql.org; Tue, 18 May 2021 07:10:18 +0000 Received: by mail-pg1-x52e.google.com with SMTP id l70so6373525pga.1 for ; Tue, 18 May 2021 00:10:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nWnCc5qE/PT+vC9hb/MhaQbCSu/jlYj209RWqMq3GU4=; b=opGPXh1pxHc4sG5JWNg40UZ1WT7aeSu0MHeCXC/GYOlG9uUgmUe8/TdXpI51fHpwIt l6BwRZ6FnQVwmGUSpPxLspTFmD92eATah0ZTA47QehZdT1G1VfhvLpTNkdhB0jaMiq/h gOro+AMVUBGxuShNcFQU0X1RttcLylNFLMuZR9g/v+P8+cLkDEu8KBxmAwNyAlSoQRdU yUv8p26LoZV78fP6dGp2ak4jY99OmosJDt1MLRgw3XwjMcH1oYGJ6Ff8ZHQHEn2FCmzZ kbvsMIEAKHuS2WLNhiQj2W4IfaFX4qk84F05yFu5q+uIAQvFDdeOgETg1tklfGQOap0d frjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nWnCc5qE/PT+vC9hb/MhaQbCSu/jlYj209RWqMq3GU4=; b=RMp6gXR9WM6y/trY68oQHdWKaQ4JEh/suU3Th2wVe9MeFIrPurwfpgea9cAL7p+1xU HkgwDHXz8EpMZnuMHCQ3QahScLbmpLrokklDCvHKjIGGbIKj5gsNzhBBe6KIhV/Say3a UQFUdtGU7k1HIVbBdCvi7II+gFgxl23aZNVsFAzQ9iLLUfJBa1HQUngTyeftZBMJ7dYU f7xIWPgIWBZg5ygvr+lQMhy7I3Daegyo8cCW/i/2LaG6Uts/85UjUC6lg0x3tDo5tbMX ii3jXKilnIBShF03O3VayFSCc2dwYe6Z8GfXwv5CnChZfubAxFCm1n/N1kCNOc30tLuy vWSg== X-Gm-Message-State: AOAM532rvb4kZtQSSZtqygnGPGYaOVsqEqkK+FAVLW57VENDuBHpdBff WiehVG8h/yTzkJuciPaa8UeG505AinGrluJUZDM= X-Google-Smtp-Source: ABdhPJyBqOWNFuWoex/3bjNN4Ci/FIia8Gar6iqvPsR+QGzp/laDqw4DdvX6Q+Zymfl9O7I7dpL8pX0qaWqno7upUaI= X-Received: by 2002:aa7:99da:0:b029:2de:4387:9e46 with SMTP id v26-20020aa799da0000b02902de43879e46mr2039222pfi.55.1621321814097; Tue, 18 May 2021 00:10:14 -0700 (PDT) MIME-Version: 1.0 References: <20210423204306.5osfpkt2ggaedyvy@alap3.anarazel.de> <20210424002921.pb3t7h6frupdqnkp@alap3.anarazel.de> In-Reply-To: From: Masahiko Sawada Date: Tue, 18 May 2021 16:09:37 +0900 Message-ID: Subject: Re: Testing autovacuum wraparound (including failsafe) To: Peter Geoghegan Cc: Andres Freund , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, May 18, 2021 at 2:46 PM Masahiko Sawada wrote: > > On Tue, May 18, 2021 at 2:42 PM Peter Geoghegan wrote: > > > > On Mon, May 17, 2021 at 10:29 PM Masahiko Sawada wrote: > > > +1 to fix this. Are you already working on fixing this? If not, I'll > > > post a patch. > > > > I posted a patch recently (last Thursday my time). Perhaps you can review it? > > Oh, I missed that the patch includes that fix. I'll review the patch. > I've reviewed the patch. Here is one comment: if (vacrel->num_index_scans == 0 && - vacrel->rel_pages <= FAILSAFE_MIN_PAGES) + vacrel->rel_pages <= FAILSAFE_EVERY_PAGES) return false; Since there is the condition "vacrel->num_index_scans == 0" we could enter the failsafe mode even if the table is less than 4GB, if we enter lazy_check_wraparound_failsafe() after executing more than one index scan. Whereas a vacuum on the table that is less than 4GB and has no index never enters the failsafe mode. I think we can remove this condition since I don't see the reason why we don't allow to enter the failsafe mode only when the first-time index scan in the case of such tables. What do you think? Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/