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 1jRtK4-0004JZ-U3 for pgsql-committers@arkaria.postgresql.org; Fri, 24 Apr 2020 08:04:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jRtK3-0003de-SN for pgsql-committers@arkaria.postgresql.org; Fri, 24 Apr 2020 08:04:31 +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 1jRtK3-0003dW-KW for pgsql-committers@lists.postgresql.org; Fri, 24 Apr 2020 08:04:31 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jRtK1-0006F0-NX for pgsql-committers@lists.postgresql.org; Fri, 24 Apr 2020 08:04:31 +0000 Received: by mail-pf1-x441.google.com with SMTP id x15so4455014pfa.1 for ; Fri, 24 Apr 2020 01:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=FqqowQBqp8LHS++a5My22bxCNsiv0rJN8BGoxOnCMWw=; b=BO9+wfRCpR5Da4GC48p43gXMAzNQWhqRvblZN3qDoj1i8Vdjfyqse0MuS/5SoxaQkg 5ytoF3vpYJrQixt/XNUoWjbIWyE/q7CfBY/bghRtc4e//XXfUvEX7nCdj1nR83XWpTfJ rEVt2hu/Gt4WnwtQec+hEyJVD6UH52U+So2x6Zs0izJO/0YKM1/xzOnv/JIFjXhwFiCw pvmAhZUm0TrL5esdGxU/k+GMuSNZSiMkLeEEMh5/F4lhtjAa6ESPA0qpG+B16iOqf/y8 B97r61dMFU3sk4kszaIW9adw+jfoJkPThwsXQQCSwnnC3SZdhmbRPvhZa0erfx89TKIW oAtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=FqqowQBqp8LHS++a5My22bxCNsiv0rJN8BGoxOnCMWw=; b=m9ygu1mf9Q829pQhlpG3BkmC1cEPjPU2D9eCbVGlKJz7LHsSj7WmjqYf7V8ESgQZuz Yyyq7LDCiRX1IOuGq8MaY89N7u9bSG0LRAs/t8x7UEgbv+G26p6BaKK4OGpGLu2mq9LN ODekbZk+AETErUADbc5omNoTkks32sxl4WpptouuXEQYF5tFYewwPiGOtMmTWnFq1WJJ LxdaTmBTcbhB9MnaF9ttp3T6A0QhI66VR0aTuGdqEHn61vOXCGHi/CHbzxTFLJiXkbXO xjPUN0t4uWiV2hk8xIdjqOKNACZ0cuuS1G3HX/xLhHA743gnXaw9Pxx0ox5gIIVPAXSL jrNQ== X-Gm-Message-State: AGi0PubBk8n74OWdA5ER3YHSWt9axtyP0EtzYBn3HUIFDKaGa2TyJuMH 6Cv7Yy132Mc55wJgxJRoWgI= X-Google-Smtp-Source: APiQypIijEOLyqIhwKgcgwzoSq7+lOhav/xyLGYnwXE44qyqy5F1IImKoaAFM3asTgiAsjjJnOvxtw== X-Received: by 2002:a62:ed14:: with SMTP id u20mr8406154pfh.69.1587715467538; Fri, 24 Apr 2020 01:04:27 -0700 (PDT) Received: from localhost (ag027197.dynamic.ppp.asahi-net.or.jp. [157.107.27.197]) by smtp.gmail.com with ESMTPSA id a7sm5088179pfg.157.2020.04.24.01.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 01:04:27 -0700 (PDT) Date: Fri, 24 Apr 2020 17:04:24 +0900 (JST) Message-Id: <20200424.170424.1259936666957276954.horikyota.ntt@gmail.com> To: michael@paquier.xyz Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Skip WAL for new relfilenodes, under wal_level=minimal. From: Kyotaro Horiguchi In-Reply-To: <20200424072941.GQ33034@paquier.xyz> References: <20200424072941.GQ33034@paquier.xyz> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk At Fri, 24 Apr 2020 16:29:41 +0900, Michael Paquier wrote in > Hi Noah, > > On Sat, Apr 04, 2020 at 08:40:43PM +0000, Noah Misch wrote: > > Skip WAL for new relfilenodes, under wal_level=minimal. > > > > Until now, only selected bulk operations (e.g. COPY) did this. If a > > given relfilenode received both a WAL-skipping COPY and a WAL-logged > > operation (e.g. INSERT), recovery could lose tuples from the COPY. See > > src/backend/access/transam/README section "Skipping WAL for New > > RelFileNode" for the new coding rules. Maintainers of table access > > methods should examine that section. > > > > To maintain data durability, just before commit, we choose between an > > fsync of the relfilenode and copying its contents to WAL. A new GUC, > > wal_skip_threshold, guides that choice. If this change slows a workload > > that creates small, permanent relfilenodes under wal_level=minimal, try > > adjusting wal_skip_threshold. Users setting a timeout on COMMIT may > > need to adjust that timeout, and log_min_duration_statement analysis > > will reflect time consumption moving to COMMIT from commands like COPY. > > + /* > + * Records other than SWITCH_WAL must have content. We use an integer 0 to > + * follow the restriction. > + */ > This commit has added the following comment, but I guess you meant > XLOG_SWITCH instead? Oops, I'm the one to blame on it. Actually it is a mistake of XLOG_SWITCH. By the way, the "xlog-switch" in the following comment might be better to be XLOG_SWITCH. > /* All (non xlog-switch) records should contain data. */ There are several other occurances of xlog-switch. ragards. -- Kyotaro Horiguchi NTT Open Source Software Center