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 1jklfV-0004rd-40 for pgsql-general@arkaria.postgresql.org; Mon, 15 Jun 2020 09:44:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jklfS-00050W-J0 for pgsql-general@arkaria.postgresql.org; Mon, 15 Jun 2020 09:44:38 +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 1jklfS-00050O-BD for pgsql-general@lists.postgresql.org; Mon, 15 Jun 2020 09:44:38 +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 1jklfP-00077u-Qw for pgsql-general@lists.postgresql.org; Mon, 15 Jun 2020 09:44:37 +0000 Received: by mail-ed1-x544.google.com with SMTP id m21so10993755eds.13 for ; Mon, 15 Jun 2020 02:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=DlnuYbgHAVgYGG4/YwNqJrp7mPs0ncFSFtH1RvlPkOw=; b=E/8fS7u5bDuYM+qLg1K7RyCnMiV6ZH8M+aOfLKFSBT+K4X79XDjdxvwGICMsgR+PDM 3+V1sF9daAjGpAWJxAV06SDmk6ckUM0w5vLcLO2WXl/40aeSJ3rFHsAPt+40yVAEquKf AlrvJlaQTlMJxqKDXW8pv5beePGoWUpGadBQ0vVuvY31cQGL33cDFNTYFr8bJw2JOcL2 74SZNGvrUFMHPj7UgsF+ucz8cEC3Ww46Z9kcO1uaD0XmbuuKNk1g10AM/gbgYii8TcXf GZyn6xtDJUZODgu3kMEu1qMs+nDkdw9Pp0PITcf4lZz2uLGC1AbpUhyGfG2S4Yr/Q4sn eTBQ== 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:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=DlnuYbgHAVgYGG4/YwNqJrp7mPs0ncFSFtH1RvlPkOw=; b=K5fdQqxK37Ig9vJ6thzvA/0g7Oah0GeZBZTH/Wop+9u1p+iIeAEfLhpBcVuxptjrOq MbJfNiBIYAdyoXhe6tZriRiZ3LYNIjEGVyRc41eW56VL8q5lypzYUf4sVqUw0VdA5TD0 ytprYdrfweEGq6nZPUgcrPpcM4as3g+MRgB+Wm7UQzIyl2j/axdNupTzjCUICTWmYEsH nuYnUtbhAtnu+HapaNZe1lMQsbKSJXY/xOM47WHMLZUleo+uOeh5B3otnpp/mYKloIq1 yDccHiv38xOuipasf/j2mxc5jMXWj45lVe5rJGb01cFRPUXXeUoKC1ytpJ69oKw0Xp32 f1sw== X-Gm-Message-State: AOAM530NphVk/Kn+ZQ3GEDfbs3Xach/Zy0qxPe7uq4YT1qyJSmU4aYYY 4aI+tziXd8CXoQ8h67+FYf5myA== X-Google-Smtp-Source: ABdhPJxC/8nHwrrINyaoaPdUXnndFpdxP0XPhalIpa/VDVyBP+0wUYosmU1/Kvih2GGe4TJ7YcHfxQ== X-Received: by 2002:a05:6402:1c87:: with SMTP id cy7mr23676383edb.354.1592214274841; Mon, 15 Jun 2020 02:44:34 -0700 (PDT) Received: from localhost.localdomain (217-149-168-120.nat.highway.telekom.at. [217.149.168.120]) by smtp.gmail.com with ESMTPSA id bs1sm8036861edb.43.2020.06.15.02.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 02:44:34 -0700 (PDT) Message-ID: Subject: Re: Something else about Redo Logs disappearing From: Laurenz Albe To: Peter Cc: Magnus Hagander , Stephen Frost , Adrian Klaver , pgsql-general Date: Mon, 15 Jun 2020 11:44:33 +0200 In-Reply-To: <20200613174816.GA842@gate.oper.dinoex.org> References: <20200609175521.GA96231@gate.oper.dinoex.org> <20200609194248.GL6680@tamriel.snowman.net> <20200610074608.GA29949@gate.oper.dinoex.org> <20200610123222.GV6680@tamriel.snowman.net> <20200611173032.GA93488@gate.oper.dinoex.org> <20200613032453.GA8494@gate.oper.dinoex.org> <20200613174816.GA842@gate.oper.dinoex.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-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 Sat, 2020-06-13 at 19:48 +0200, Peter wrote: > ! > 4. If, by misconfiguration and/or operator error, the backup system > ! > happens to start a second backup. in parallel to the first, > ! > then do I correctly assume, both backups will be rendered > ! > inconsistent while this may not be visible to the operator; and > ! > the earlier backup would be flagged as apparently successful while > ! > carrying the wrong (later) label? > ! > ! If you are using my scripts and start a second backup while the first > ! one is still running, the first backup will be interrupted. > > This is not what I am asking. It appears correct to me, that, on > the database, the first backup will be interrupted. But on the > tape side, this might go unnoticed, and on completion it will > successfully receive the termination code from the *SECOND* > backup - which means that on tape we will have a seemingly > successful backup, which > 1. is corrupted, and > 2. carries a wrong label. That will only happen if the backup that uses my scripts does the wrong thing. An example: - Backup #1 calls "pgpre.sh" - Backup #1 starts copying files - Backup #2 calls "pgpre.sh". This will cancel the first backup. - Backup #1 completes copying files. - Backup #1 calls "pgpost.sh". It will receive an error. So it has to invalidate the backup. - Backup #2 completes copying files. - Backup #2 calls "pgpost.sh". It gets a "backup_label" file and completes the backup. So the only way that something can go wrong would be if backup #1 somehow does *not* invalidate the backup. > ! This is specific to my scripts, PostgreSQL's non-exclusive backup > ! can perform more than one concurrent backup successfully. > ! I tried to keep things simple. > > I understand. But the operator may not know that and/or accidentially > start a second backup while one is still running. And this will then > result in ... > > ! If you have the wrong "backup_label", you end up with silent data corruption. > > ... this. Of course, if you do arbitrary nonsense like restoring a backup without "backup_label", you will get arbitrary data corruption. It is a fundamental principle that, apart from "backup_label", there is no way to tell a backup from a crashed data directory. Any backup/recovery software must refuse to use a backup that lacks that file. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com