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 1jk4jF-0002yd-Vr for pgsql-general@arkaria.postgresql.org; Sat, 13 Jun 2020 11:53:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jk4jE-0001P9-Ng for pgsql-general@arkaria.postgresql.org; Sat, 13 Jun 2020 11:53:40 +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 1jk4jE-0001P1-Aj for pgsql-general@lists.postgresql.org; Sat, 13 Jun 2020 11:53:40 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jk4j6-0003UU-LP for pgsql-general@lists.postgresql.org; Sat, 13 Jun 2020 11:53:39 +0000 Received: by mail-wr1-x442.google.com with SMTP id e1so12482052wrt.5 for ; Sat, 13 Jun 2020 04:53:32 -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=gXtnDF9LaAewXGjNdRbUupVjO1htr7Mrlr5lUEsv65A=; b=SLS7rAUMzZzAuBc2TjsovwGht8M2cETZVgyQ4IrbjG9CnqwPJqHqbhvFOqGqmpykup OK7Q3IXCTuNI7wWnjsKNYw2f/lQhbueG4zdbB/UUYk3jOz6MlEZf0t+pSB8gHrwYEESx RalHAHZ7a+2s3JI/HG760nPB3Ur4Avljn5bEK/K3zDlDVZP+ztCzYWrmwCfQeR0qc5eD jVfcJ4bex49yi1aeflBT7hHukBGdkzspfY50xb8gCgaineQs0+9NixDpatPBZgujr8/9 SlwDOomX/KVzZMni6BSJPoRh1DNBlsOZ6ouyqtkNrvVyWiR8UkveuScLRfTmMDySZRPT Ymuw== 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=gXtnDF9LaAewXGjNdRbUupVjO1htr7Mrlr5lUEsv65A=; b=bCuTkRVxh9yGDu181cDE+qACJ1W8MUUzMDPmFpzfcw9gTr4z2qT5pgIcpLczBLzRMw GZ8/M2uhwGI1rpV/uryM79aZgRzBStUlXhu8JoDGwnjVHxtTGrIOgLYVi2nJJqpyl371 mUbnvSpOn58pitL6Xs+x2BoW9Sej6wOW2508CHcUCtF96dqqk2dxxL6b+xiXJoew6BKN zmD9ADkjAUl5RDsue1WypBJNKoJv5GnEgdbs2TiGXimAm4gO91jLrm9rcaTn7ezUEAS9 aRkane+7K9BQ/9o3AqniWUkH47pHKHfWgPEjA9/BTiHkIdtQCJo26t3uwy5E3rqud8K3 c2/Q== X-Gm-Message-State: AOAM5332GboLl1yVm+pbPPUQuMEjqeQ28jFWlyZ6NRKMwUFaqJN6yPf4 kjjBccPkPRu9Nj4uJddi03iW6A== X-Google-Smtp-Source: ABdhPJyH1HDnebIYB/Acure2/4NILuX02BYk9FEvWCdRIkdm2zjN9M+cmWVz3nbPjBiZBa9FZvr/UQ== X-Received: by 2002:adf:bb4f:: with SMTP id x15mr18838033wrg.332.1592049210729; Sat, 13 Jun 2020 04:53:30 -0700 (PDT) Received: from dynamic-em2icneaiaj1tkxc6-pd01.res.v6.highway.a1.net (dynamic-em2icneaiaj1tkxc6-pd01.res.v6.highway.a1.net. [2001:871:60:338b:9312:a45a:5507:76c6]) by smtp.gmail.com with ESMTPSA id z6sm14408949wrh.79.2020.06.13.04.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jun 2020 04:53:30 -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: Sat, 13 Jun 2020 13:53:28 +0200 In-Reply-To: <20200613032453.GA8494@gate.oper.dinoex.org> References: <20200609023326.GA61487@gate.oper.dinoex.org> <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> 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 05:24 +0200, Peter wrote: > ! https://github.com/cybertec-postgresql/safe-backup > > Ah, thank You, very nice. > > I've never seen anybody coding bash - it is strongly shunned in the > Berkeley community. Strange, but then I don't move in these circles. > Some Questions: > 1. There are explicit error messages in loc-82 and -92 of pgpre.sh. > To where are these written? Standard error. It is up to the caller of the script to route that somewhere useful. > 2. The result data from pg_stop_backup() are stored into the living > database. But, according to the docs, they should be placed into > the completed backup. Do I have a misunderstanding here? Right, but these scripts don't know anything about that backup itself. They are designed to be called before and after the backup. In between, you back up the data directory however you think fit. It is the responsibility of the caller of the post-backup script to add the "backup_label" file to the backup. > 3. The most common error cause of a backup might be tape-side > malfunction. So far as I see, the way to handle this is currently, > to provide a timeout for pgpre.sh (which is problematic, because > we might as well have just reached end-of-tape and have to wait > until monday for the operator to change it). May I suggest to add > a switch to pgpost.sh, in order to volutarily fail out of the job? As said above, the backup itself is not the job of these scripts. > 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 specific to my scripts, PostgreSQL's non-exclusive backup can perform more than one concurrent backup successfully. I tried to keep things simple. > BTW: what does, in general, happen, if a backup_label file gets > accidentially swapped with one from a parallel, but slightly later > backup? Do I correctly assume that such mistake gets somehow detected, > as otherwise it would have just the same unwelcome effects > (i.e. silent data corruption) as no backup_label at all? If you have the wrong "backup_label", you end up with silent data corruption. That should not happen with my scripts, though. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com