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 1jtCoJ-0007Rv-5S for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2020 16:20:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtCoI-0003Pc-1o for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2020 16:20:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtCoH-0003PV-RG for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2020 16:20:37 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jtCoF-0000NG-DN for pgsql-hackers@postgresql.org; Wed, 08 Jul 2020 16:20:36 +0000 Received: by mail-qk1-x743.google.com with SMTP id e11so42133171qkm.3 for ; Wed, 08 Jul 2020 09:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=0vTVcU2nj7QgFBuSQZdZU5RwjmkS970GlPGSF+BMOqc=; b=dz1JDtBGmYDu9ogrzLlCoTYwDoXaDpILo7g7tZCNxzu+TFPJRx+iZ5XAoV2UQNMDLp ddesbrbSdc5/BRkgIqvMSPAC1BcEWPx2FpB0E9G8s8UvEDl1CjQYgwgK/WV/h5tq2Jf8 yQagaMMBkEvGi7yywrjSMvg9V0yE1Lh6dLF7mULjESHldh9GAGDx2Ujg2ztVoZdvYFGh Aqyo2Kr8V8Hbr5lsmS1nPXWJzV134Pm9teZOs4M2qHEMDLcHvBqpFmOnbHvP1cyRe/eA ylOebYiOGqBkvSa3JEEPKNr5KJ/jZjvuEYUnO8QmrlRVerToOTVLRYw+KU2oci942i02 7Xyg== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=0vTVcU2nj7QgFBuSQZdZU5RwjmkS970GlPGSF+BMOqc=; b=YDqWHFGv6QhLgehsnkfjzLSMONf4p5JPBfEr+Q+WvMUSgxUWgodmJTK+ubCq3wdGbr z4CQqLADxtnK+3PCcSALmKBuPxDXO8rPbF2tMSc1Pg/gyTm30IStG/0Bou7m5ZuKhMmF OXhpxkHpQAv9TRBR6uQRWDGqqF1qtEP8cTqdLccgNP41tPVGrs/573iR0cYohXSoaT0Q UZD7txxcpVEtcdxqKL+7Tlg7FW37TNQGdsQuzEPupgin3zgPoaVVnHM3AZWI0DIrpzf0 8RrtFIrgyZa2a4+9Eh4QBhudb2F8noV/sUzteKcp/CxPKI8Bh30nAUO5tpEaurM6Aquc MMhQ== X-Gm-Message-State: AOAM5307UwNvp3OPwFGXyJHH1A0bFOt0M1zXlyXVaVRVd7IueP4R1uqt t8LFvE/U+2/yw6orq5gLwSyV7/WLpq4= X-Google-Smtp-Source: ABdhPJzQEvG+EJuPNWKw8KCsR/E+5bmNui77nB+th1b3y5b2vzrGekdh242PaZ2ymKRfq/sOKjO+mQ== X-Received: by 2002:a05:620a:120b:: with SMTP id u11mr56567996qkj.243.1594225234260; Wed, 08 Jul 2020 09:20:34 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id t65sm264698qkf.119.2020.07.08.09.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 09:20:33 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D050E2A3A04; Wed, 8 Jul 2020 12:20:31 -0400 (-04) Date: Wed, 8 Jul 2020 12:20:31 -0400 From: Alvaro Herrera To: Fujii Masao Cc: pgsql-hackers@postgresql.org Subject: Re: max_slot_wal_keep_size and wal_keep_segments Message-ID: <20200708162031.GA1716@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6e4f9605-97f3-7eba-f989-4ae41d637d2f@oss.nttdata.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Jul-09, Fujii Masao wrote: > I attached the patch that renames wal_keep_segments to wal_keep_size. Looks good in a quick once-over. Just two small wording comments: > > Independently of max_wal_size, > - + 1 most recent WAL files are > + most recent megabytes > + WAL files plus one WAL file are > kept at all times. Also, if WAL archiving is used, old segments can not be > removed or recycled until they are archived. If WAL archiving cannot keep up > with the pace that WAL is generated, or if archive_command This reads a little strange to me. Maybe "the N most recent megabytes plus ..." > /* determine how many segments slots can be kept by slots ... */ > - keepSegs = XLogMBVarToSegs(max_slot_wal_keep_size_mb, wal_segment_size); > - /* ... and override by wal_keep_segments as needed */ > - keepSegs = Max(keepSegs, wal_keep_segments); > + slotKeepSegs = XLogMBVarToSegs(max_slot_wal_keep_size_mb, wal_segment_size); > + /* ... and override by wal_keep_size as needed */ > + keepSegs = XLogMBVarToSegs(wal_keep_size_mb, wal_segment_size); Since you change the way these two variables are used, I would not say "override" in the above comment, nor keep the ellipses; perhaps just change them to "determine how many segments can be kept by slots" and "ditto for wal_keep_size". -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services