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 1jfVcJ-0008MH-3Y for pgsql-general@arkaria.postgresql.org; Sun, 31 May 2020 21:35: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 1jfVcH-0001sD-Vf for pgsql-general@arkaria.postgresql.org; Sun, 31 May 2020 21:35:37 +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 1jfVcH-0001s5-LY for pgsql-general@lists.postgresql.org; Sun, 31 May 2020 21:35:37 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jfVcF-0003gs-2d for pgsql-general@postgresql.org; Sun, 31 May 2020 21:35:37 +0000 Received: by mail-ed1-x544.google.com with SMTP id g9so5809691edr.8 for ; Sun, 31 May 2020 14:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XW4Z3k558TAsEb3LxJ0e/chZPPmSkdvsB5+xvNKaVwY=; b=evWFFAfIWYR0MDc+YnyfAMqMICINR7dYpp5CK3pp8S2QfIStJn48//AZlEe5jm1wlG 8CExAgJWuH2BOsyOJNIS6goMPRIL38ISD78U0cPYSO2uQtcTtEPCqUaaTUpqS+rcdYRO 4rho1orjQX6CYKXfEM90BSLayy3J5tX8s4RiJ0gXQ5U8cRVID4nb1gb3yKTYCBMtI7Q5 n8Zlz7IDb6KHv9DvFr49k3N1wLQbMIetAZlXygK8QeJMeoGbX621MbIyMgU5DUvcfWZQ uLPANgxB8rChBZ2J/5NKHLIh3pEWu+vwnTcfiIctORLwuxlqgw65o82SR7/0UaVmNLOZ 3vyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XW4Z3k558TAsEb3LxJ0e/chZPPmSkdvsB5+xvNKaVwY=; b=RtCC2X61fuvVfshtQU1sCG9WyfC70wsLhF+SJBQVfCSFBqSXhpvVBR4FLdqmYxisgu YHsfan8lIutJZOPW8AO797EwkgjwCI8F6Zi6pme2gEADTrfoSvU7WjR9CWsG29U2jLzK YFvvOBepctiMFLFM60p8aCFbOw8Ia6As0OeZX3nvXhCqNnR+vYoIkUicRSS/s4Y64eAx LtA/ixwTHiasYdrGGORaTupBN5ibhkUNp/67mf3pz64AQB5KYBshTaJLA86YFVKbSnqJ GOjs+6acxaN+55Q9jqvXuDE++LPt6IUT8VCFODOpuiHUuAgpIEO/z8kr7KtJfD+ZqJ4/ 5Lzw== X-Gm-Message-State: AOAM530vb2Sx6iE16O59L70Ywkk0YwXWFcMaGsssNg9WqgFkyLcI2I6z Q4++iuR6DdLNEyBpOJwF0ig= X-Google-Smtp-Source: ABdhPJytfgAEUUpIeBEaynt6+L/THjxBfCJcaglOmkR5FH49ki7j9OXanUhhGA9v6BgVtLGryaVgrQ== X-Received: by 2002:a05:6402:1d96:: with SMTP id dk22mr804303edb.258.1590960934210; Sun, 31 May 2020 14:35:34 -0700 (PDT) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id mh14sm3170520ejb.116.2020.05.31.14.35.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 May 2020 14:35:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated From: =?utf-8?Q?Paul_F=C3=B6rster?= X-Priority: 3 In-Reply-To: <69FF4F48E6FE4A63A2EBD820C5B2B3A3@dell2> Date: Sun, 31 May 2020 23:35:33 +0200 Cc: pgsql-general Content-Transfer-Encoding: quoted-printable Message-Id: References: <26EC9619620649D1B55C9C95811E4ADB@dell2> <69FF4F48E6FE4A63A2EBD820C5B2B3A3@dell2> To: Andrus X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Andrus, > On 31. May, 2020, at 22:56, Andrus wrote: > wal files are not archieved. IMHO a bad decision. They should be. Now you're in the situation where = you see why. > I have tried to re-initiate replica serveral times in low-use time but = this error occurs again. remove the whole replica's PGDATA/* and do a pg_basebackup again. But = before that, make sure wal_keep_segments in big enough on the master = and, just as much important, do a vacuumdb -a (takes much space during = the process) and use archiving! > If named replication slot is used commands like > vacuumdb --all --full > will cause main server crash due to disk space limit. pg_wal directory = will occupy free disk space. After that main server stops. if you have disk constraints you will run into trouble sooner or later = anyway. Make sure, you have enough disk space. There's no way around = that anyway. > I tried using wal_keep_segments =3D180 > Will setting wal_keep_segments to higher value allw replication start = after pg_basebackup ? it depends. If you start the replica immediately and don't wait for = hours or days, you should be good to go. But that depends on different = factors, for example, how many WAL files are written during the = pg_basebackup and pg_ctl start of the replica. If more than 180 WALs = have gone by on the master because it is really busy, then you're = probably lost again. Point being, you'll have to launch the replica = before WALs are expired! Again: Make sure you have enough disk space, use archiving and use a = replication slot. Cheers, Paul=