Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSkv5-0007Nj-O1 for pgsql-general@arkaria.postgresql.org; Thu, 07 Nov 2019 16:46:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSkv4-0008AR-2o for pgsql-general@arkaria.postgresql.org; Thu, 07 Nov 2019 16:46:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSkv3-0008AK-Hp for pgsql-general@lists.postgresql.org; Thu, 07 Nov 2019 16:46:01 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iSkuA-0005R3-Ps for pgsql-general@lists.postgresql.org; Thu, 07 Nov 2019 16:46:00 +0000 Received: by mail-wr1-x444.google.com with SMTP id n1so3772235wra.10 for ; Thu, 07 Nov 2019 08:45:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=oV8k2YUXdCsqE4nJr7SgCum19QGxPyYB+e70GzeieSA=; b=HN/TrPgP1ybWDvfHWswA9CKngLcPp76gtX2HA59IhRXvJLEtsDtvAb3wgvEAuw2+Kq qlt8wdQsblhNl/r0HGKGJumNVTZqNDkgnrki7NjFGLJmGo4bo4PhhF0TDwBXYhaiuK7W j+qesqLYg+xG2Qw0J8fvney9asjJE0ToOah0gKgZVJeTtQbUmfG5sZvu9t0evb3+ubvC kHv+nwzMNaBXJlZOHpxO1UUk6O5k6A6tFeiAgHzkDPthVhs0dTbNhY0UYUnTj/BN/IRW 10ZuKv2aNnh2OAWpXfIfl3NZoPOoY4xS0Ne9zxkItyznECt3Ywq9FQCBtTjjI+m3qMYS v4uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=oV8k2YUXdCsqE4nJr7SgCum19QGxPyYB+e70GzeieSA=; b=dAURU8Brrwy3L5E+e99za5uuoMytSMwNyiStiS9ak46W7ZOZRudAl5gG75VPlafsYZ n000eAxGJjx40aCx51ws/y2Ws4vkZSqdrGN4JAvuwntsKYbc4NkHDcg+tO8szSV6prJR n8CMyb9pU5fFb6k7/eq55H2/ybzTbrV0oQ/h1t8CT87qgbQ7RgV/1MF2Tr5aMQ+Zwsix Kv9uqUD/EeHq/cU2xvPhz1zPUwpybrJpfGZ/gW+V44XnYhmkk/MwsJ0YA19WqLsGpXBi RzgQX2BlLLlMQDVy9Ju8zYuLgDldJ4Liz2DwdbJxo1AqH45pM2ofB/XinehEuPFrle/C 7leg== X-Gm-Message-State: APjAAAVgUms6UOZKu4g8zPaooSLVHXKHbrazFAX6Ubz7jyU6LDVwKdWr wC5vkrAbe4Hdz9Tqm9cXwPO2iQ== X-Google-Smtp-Source: APXvYqz0QY6xTSd+K5+xZDPRR9tKJLq4slTaGKNB26C8BVSFVkqT+wiuvkuYTKuLOSgePif0WNM2xg== X-Received: by 2002:a5d:6104:: with SMTP id v4mr3715661wrt.36.1573145105134; Thu, 07 Nov 2019 08:45:05 -0800 (PST) Received: from localhost.localdomain ([213.208.157.38]) by smtp.gmail.com with ESMTPSA id z189sm3172625wmc.25.2019.11.07.08.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 08:45:04 -0800 (PST) Message-ID: Subject: Re: broken backup trail in case of quickly patroni switchback and forth From: Laurenz Albe To: "Zwettler Markus (OIZ)" , "pgsql-general@lists.postgresql.org" Date: Thu, 07 Nov 2019 17:45:03 +0100 In-Reply-To: <0613f7e85acf4972837408cfc6260387@zuerich.ch> References: <0613f7e85acf4972837408cfc6260387@zuerich.ch> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2019-11-07 at 13:52 +0000, Zwettler Markus (OIZ) wrote: > we are using Patroni for management of our Postgres standby databases. > > we take our (wal) backups on the primary side based on intervals and thresholds. > our archived wal's are written to a local wal directory first and moved to tape afterwards. > > we got a case where Patroni switched back and forth sides quickly, e.g.: > 12:00h: primary - standby > 12:05h: standby - primary > 12:10h: primary - standby > > we realised that we will not have a wal backup of those wal's generated between 12:05h and 12:10h in this scenario. > > how can we make sure that the whole wal sequence trail will be backuped? any idea? You'll have to archive WAL from both machines. Then you have everything you should need. Make sure "recovery_target_timeline = 'latest'" so that recovery will follow the timeline jumps. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com