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 1nUq30-0007Yi-E6 for pgsql-general@arkaria.postgresql.org; Thu, 17 Mar 2022 13:20:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nUq2z-0005H6-9d for pgsql-general@arkaria.postgresql.org; Thu, 17 Mar 2022 13:20:09 +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 1nUq2y-0005Gi-Rn for pgsql-general@lists.postgresql.org; Thu, 17 Mar 2022 13:20:08 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nUq2v-0000HC-ID for pgsql-general@lists.postgresql.org; Thu, 17 Mar 2022 13:20:07 +0000 Received: by mail-ej1-x62a.google.com with SMTP id pv16so10776292ejb.0 for ; Thu, 17 Mar 2022 06:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=otctlo/MoB8AH37MH8fGtVSPHVpk7FLmB1d9d6ThTE4=; b=EPdSVYsFvhnSmb6ixH0ayHqvQrLbsEv3VF6/+DLeeMqhJs8mWqRaF0donAt8BvG/jt pmMUd7yyVBVnFofGpnTV8oxE4B0gUmo0RaUQHa+DsUxtbToQneblLVcFxBlQmD5VbFIv itsoZXbhdqKp74VeVFzLzt06YQ7qEC2Ugv6gza+dQDzK7ZNWgktrwo2wuVlxap/yJnlt ASROlyzw83/lHZXPj1ecMDRCo2eswDP7w86Q785NkgqL45HahHbFrMwRHxKZJaPdaN5C geA8/sOYe86rv8BZzT5rNYytzViDqMZUw3pj0Z7cPyETcSUWqXFDmGHKfisZPkc3yZd8 gxKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=otctlo/MoB8AH37MH8fGtVSPHVpk7FLmB1d9d6ThTE4=; b=aJ2Eu6nEBDZC/TLqYT7eC2hsiRykLhR3m9SGwoL94UDSu5IUPSzV0CAfOkPwD4GKKc q9zeU0M1lZBRO+unZvXOST75vNkcwooSOneARk/tarsD85D8T6MPhj2WXasBDDC345Fk Q5TuGNDs9q727j5UrSWySppNrQfUFQGB8iBZ9KddQZNrY8hd958b6ab/DE/ccGVO3Or/ MqTyVsitjMBLKthYlVjQFjOnLgu9fVG+MAjDHTx1rwq2VQSkqJcmR7i56kdI+fbM/ynq ulvzBzxNQ3clCctEmX0sTyPQ2dDN9TJjmB/kdVl2ptN/IEdzk14QU52pMgMNQqizmSdq nPmw== X-Gm-Message-State: AOAM530VT5MIye8IuggGvT4JuN+kPE2dDLTunsSFKIV46LsVbhuLori6 ZL046o1ylLyokIe8omsytwjmBA== X-Google-Smtp-Source: ABdhPJymQX0BNs+i7Sux6NJtnJuM5sLWwOa40b+ZAATLoR1kufhSgIhSCBJSSF2Q7FQQBui6eUfrMw== X-Received: by 2002:a17:907:1624:b0:6db:8caa:d71 with SMTP id hb36-20020a170907162400b006db8caa0d71mr4402056ejc.723.1647523195358; Thu, 17 Mar 2022 06:19:55 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:1baf:527e:4d24:76aa:18b2]) by smtp.gmail.com with ESMTPSA id b9-20020a1709063ca900b006cea15612cbsm2414456ejh.176.2022.03.17.06.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 06:19:53 -0700 (PDT) Message-ID: <311862d1f3cf8aa637d25f95a3434eb43bb4d35f.camel@cybertec.at> Subject: Re: Query on WAL Optimization and Streaming Replication From: Laurenz Albe To: "Shukla, Pranjal" , "pgsql-general@lists.postgresql.org" Date: Thu, 17 Mar 2022 14:19:52 +0100 In-Reply-To: <69E6DB22-F46D-4798-B47E-A69C5B52FA56@akamai.com> References: <69E6DB22-F46D-4798-B47E-A69C5B52FA56@akamai.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-3.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2022-03-17 at 12:36 +0000, Shukla, Pranjal wrote: > uring upgrades of our application, we generally shutdown all Secondary servers > which are getting stream replicated from Primary Servers. This is to maintain > a copy of database on other servers should > we wish to revert (of course we take DB Backups too before starting the activity). > After the application upgrade is done, when we start the secondary, often the > replication is broken, and we need to > again setup using pg_basebackup. How do we ensure that secondary is able to > resume the replication without the need of base back up again? There are three ways: 1. have a WAL archive and configure "restore_command" on the standby 2. set "wal_keep_size" on the primary high enough 3. use a replication slot Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com