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 1phpnr-0003XO-Mn for pgsql-admin@arkaria.postgresql.org; Thu, 30 Mar 2023 10:46:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1phpms-0000QJ-K6 for pgsql-admin@arkaria.postgresql.org; Thu, 30 Mar 2023 10:45:46 +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 1phpms-0000N2-4k for pgsql-admin@lists.postgresql.org; Thu, 30 Mar 2023 10:45:46 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1phpmp-0001fp-A8 for pgsql-admin@lists.postgresql.org; Thu, 30 Mar 2023 10:45:45 +0000 Received: by mail-wr1-x436.google.com with SMTP id d17so18560347wrb.11 for ; Thu, 30 Mar 2023 03:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; t=1680173141; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=bP7cC/scVfdsMgVbQQNnTGAYyWzz0EvZUx81V9spcy0=; b=P/MkxIqs+IsPssyDlcUqjbI9xnQ37mf0ICQcwdDk29eo/1NXapQauAuJGq1xd0lnyK E/M3LmyEKfjZwqTnECh+C0ITh7sbVYQQ07v0VyEPcKGpb/sYwbZYrWfOz43HWd4E1r8q R81Yn+8Rz7Wa5oUm8kuTYz5ofxoYx5Z6jZjMkwaLnw7EaWK0Qr55ZfBnEBNEbge5qR8F Tg9ahE5rDvJfC7T9+KZVTxt0N+X2ybnlfZEBeHMjeWn3z7OmJjqMchZIIJty7TIHuTMh gNTYBE7L7W2fxluUhbn9lT1j7J872VgpAtqsq3UnoS+VDwnw3kfcj0zGVHYhSorDYP++ 9VXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680173141; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bP7cC/scVfdsMgVbQQNnTGAYyWzz0EvZUx81V9spcy0=; b=SGnFoozrv04DUzD9f6j1MUvdngN8bnUKC6AlHQOlL92pZ74GDT+reY2o82ilqP4+P6 ucwKDo+HQaUTKTk5PNsQOAf2kxVQ4ObnTb9dMyWuIdfukqUVEJKPLIBf7XkvrhA05ZZi 9faogDD3MCCALT5qkO2B9cCqtm4+slG0UQPSQbH3OB7fw18rLos1obgZgO/e+2s11ZQH Nk+OSvV421uRD+G9V+yJz1D4KQwHpZwLaaN45a2kv7EDuVMla9PdOvm+1uN2lmqsPzwJ NetrQ66MGdOsQ7ihz1JfWdssLw/8iv9XwXvPbsPfltk7aqLjYYqA4f555ZELHZeFYKQt Fp9Q== X-Gm-Message-State: AAQBX9cIRVeGNmPjQkEZ3NjXhnPr1i9JuzVkekBNCNVNjJupG4b0Pu1Z 0S8gRrNidAz5B4LQlYIRrnDcnw== X-Google-Smtp-Source: AKy350Y1RAma7+uQAjdOsOUwY18QHrdB1KLafwD32jP3bRAH1Ar79w68s7IW1kYajG6g21twV4Y2RA== X-Received: by 2002:adf:f089:0:b0:2cf:e849:e13c with SMTP id n9-20020adff089000000b002cfe849e13cmr18070429wro.61.1680173140820; Thu, 30 Mar 2023 03:45:40 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:821f:317c:73ea:d43e:a6d5]) by smtp.gmail.com with ESMTPSA id b7-20020a5d4b87000000b002cfe0ab1246sm32541188wrt.20.2023.03.30.03.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 03:45:40 -0700 (PDT) Message-ID: <99815bc4cd2622115ea417f6f1e3ceebf8a5247e.camel@cybertec.at> Subject: Re: pg15 and VM snapshots with pg_backup_start From: Laurenz Albe To: oernii+pg@axonpro.sk, pgsql-admin@lists.postgresql.org Date: Thu, 30 Mar 2023 12:45:39 +0200 In-Reply-To: <1bd4e56c-f6ad-f711-255a-4432b5f20a62@axonpro.sk> References: <1bd4e56c-f6ad-f711-255a-4432b5f20a62@axonpro.sk> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2023-03-30 at 11:50 +0200, oernii+pg@axonpro.sk wrote: > Hi, we run a lot of PG14 and lower. We do VM snapshots, which we backup. > Before the snapshot we run a quiesce script which also runs pg_start_back= up(). > After a few seconds the snapshot if finished and we call pg_stop_backup. > This is working file for us, but pg15 removed this function and replaced = it > with pg_backup_start(), which however requires the session to be open, ot= herwise we get: > =C2=A0=C2=A0=C2=A0 WARNING:=C2=A0 aborting backup due to backend exiting = before pg_backup_stop was called >=20 > For pg15 do I need to keep the session open, will the snapshot contain un= corruped data? If the snapshot is atomic, that is, represents a state that the file system= had at sume point in time, PostgreSQL can always use it for recovery. Otherwise, you cannot use this backup, because you only get "backup_label" = from "pg_backup_stop()", and without "backup_label", you cannot recover the back= up. In the latter case, you may find this useful: https://github.com/cybertec-postgresql/safe-backup Yours, Laurenz Albe