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 1jdtIL-0007dn-5V for pgsql-docs@arkaria.postgresql.org; Wed, 27 May 2020 10:28:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jdtIK-0007jb-40 for pgsql-docs@arkaria.postgresql.org; Wed, 27 May 2020 10:28:20 +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 1jdtIJ-0007jT-Ub for pgsql-docs@lists.postgresql.org; Wed, 27 May 2020 10:28:19 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jdtIF-0001e1-TR for pgsql-docs@lists.postgresql.org; Wed, 27 May 2020 10:28:19 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 75E5A21C6AA4 for ; Wed, 27 May 2020 13:28:15 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.1.38] (unknown [46.188.123.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 5284D21C2760 for ; Wed, 27 May 2020 13:28:15 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1590575295; bh=VACLo4VKEt4vUU4LnEUwS/KIewYdCMph1FBrDgTy7uk=; h=Subject:To:References:From:Date:In-Reply-To; b=M6gdZ+cXa4q5ot1rsMW1FIkpw2lXfj3Ovtm25ML1O1CrMU9sseg+hfxFYtoArSUmr aXIicYdksprpxOuZztynioDPEKVaZMbjvHAmhipaRlb2yCReh1UozzqAFdmfM3lAGy UlVfwdW81AWWR3F+Vo5uSnOZVBAobb+W0CC+o5aA= Subject: Re: max_wal_size To: pgsql-docs@lists.postgresql.org References: <7020bbeb-cde5-b203-9803-2facd964688b@postgrespro.ru> <5d9bf1bd-d322-ba24-ce89-fa6029eb6615@a-kretschmer.de> From: Egor Rogov Message-ID: Date: Wed, 27 May 2020 13:28:14 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <5d9bf1bd-d322-ba24-ce89-fa6029eb6615@a-kretschmer.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 27.05.2020 13:16, Andreas Kretschmer wrote: > > Am 27.05.20 um 12:11 schrieb Pavel Luzanov: >> Hello, >> >> About parameter max_wal_size the documentation >> >> says: "Maximum size to let the WAL grow to between automatic WAL >> checkpoints." >> Is it correct? >> >> The size between automatic WAL checkpoints or the size of all WAL >> files in the pg_wal directory? > > size between checkpoints, size of all wal's can be higher, see > wal_keep_segments. > It is clear that total size can be higher due to wal_keep_segments, replications slots, archive_command etc. But does max_wal_size relate to the (a) two subsequent checkpoints (as you may read the wording in the docs) or (b) to the past completed checkpoint AND the current yet-uncompleted checkpoint (which together may be up to TWO checkpoint intervals)? If I read CalculateCheckpointSegments() in xlog.c correctly, the answer is (b), and hence the documentation is misleading. Regards, Egor.