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 1pxU8l-0008WV-HE for pgsql-novice@arkaria.postgresql.org; Fri, 12 May 2023 14:53:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pxU8j-0001DP-V9 for pgsql-novice@arkaria.postgresql.org; Fri, 12 May 2023 14:53:01 +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 1pxU8j-00016y-IO for pgsql-novice@lists.postgresql.org; Fri, 12 May 2023 14:53:01 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pxU8g-001wro-UW for pgsql-novice@postgresql.org; Fri, 12 May 2023 14:53:00 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-50c8d87c775so13605324a12.3 for ; Fri, 12 May 2023 07:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1683903177; x=1686495177; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=cd1pMXGwJZCTUqL5kjAfDKmlKPKZonW4wpVthipl+vs=; b=bsA0gS+GGrUpY6xAtwpjKPaKk0VLME9A8z5IkHjNQx1N6sAxm/XNTUhi/V4piJUmpc Pk1kfPcQP16u/9ZEfXRYX0MNWyj4il7EKu7IxYsWSvLNnwJISkkZDO7qgDY+fk613h/D cVVEEXM+ikSB053/Y/XYP6QJXiF2mbqLSNBfRZMF53w7aghQx5/8g4uKCNky6Y8WSo6S 2j8DsMRkPxxCkXsKzNFgNtd4IL8AE3/t6k0kOD5LYCyRoa3yC+KH02xxYp/BNOWo4Ey1 sI62QqaHUqbfFDIUhbfBLIh8q07XaD48FOj7T6DVnkbzUwoWuxQABpAdlOUYvbMfi84h Z3hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683903177; x=1686495177; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cd1pMXGwJZCTUqL5kjAfDKmlKPKZonW4wpVthipl+vs=; b=GhVz/glQYyEBSv7qJjhAwID/h6TYkAO7OsBFNxcu7SatTioTDf8g6K1Sm8JViOHH45 mPUr3WZgCBVAkfY0gaEkyiYHTS7cTyBQ51T1fdWAG4SHz70AVGzMAzD2deNCy20/XmZq HlEp/s0Jc+v014bGuZo+QF+SnB5EQGSyf02NghKZeRNnQ7L2TRhSDdBEwTuIhQ6w9Wda Kg8HLOycU2SYm0bDsTkYEMRMRvwlbv3zTEqxxkZmQ53iZ+pG0eHOKEzcOAB6PaEaDE1u JSCyQup31CyKb2veynJJNcgo+sp2eYJNc2yJomq7h4QDcP0qbGXZP49jq4tGg4gzp5II GsqA== X-Gm-Message-State: AC+VfDwQiTvY7TT+5La+HOR+Tp+SQVIDbjjiEPN10g4idFbUYPrcvafY rKTLCfRwe1+IxtB1M1nteZPPm+PZsEpjrBCIfYY= X-Google-Smtp-Source: ACHHUZ7DEq07ImKkSkT1dClOg9/kk9rSozQ1YVsxxB0XNJERYIYU6mhQTDjIAloaSMhMHsT/JH8dTw== X-Received: by 2002:a17:907:928b:b0:966:2123:e0c3 with SMTP id bw11-20020a170907928b00b009662123e0c3mr18773746ejc.15.1683903177236; Fri, 12 May 2023 07:52:57 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:b82d:e9a1:d9a6:3623:e9da]) by smtp.gmail.com with ESMTPSA id mm10-20020a170906cc4a00b00960005e09a3sm5557476ejb.61.2023.05.12.07.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 07:52:57 -0700 (PDT) Message-ID: Subject: Re: recovery.conf and archive_cleanup_command From: Laurenz Albe To: Yang Steve Cc: Rita , pgsql-novice@postgresql.org Date: Fri, 12 May 2023 16:52:56 +0200 In-Reply-To: References: 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 Fri, 2023-05-12 at 23:45 +1000, Yang Steve wrote: > Laurenz Albe =E4=BA=8E2022=E5=B9=B410=E6=9C=88= 10=E6=97=A5=E5=91=A8=E4=B8=80 04:33=E5=86=99=E9=81=93=EF=BC=9A > > On Sat, 2022-10-08 at 08:51 -0400, Rita wrote: > > > I have primary and standby replication setup. > > >=20 > > > On my primary the archive directory is rather large (30GB) and growin= g. On my standby I have recovery.conf which has=C2=A0 > > > archive_cleanup_command =3D 'pg_archivecleanup -d /var/lib/pgsql/11/d= ata/archive %r' > > >=20 > > > I was under the impression this line would remove data from my primar= y AND standby. Is that not the case? > >=20 > > That depends on your PostgreSQL version, for instance. > >=20 > > Also, it depends on whether the standby server is running and actually = recovering. > > Finally, it depends on whether the standby can execute the command succ= essfully or not. > >=20 > > Did you look at the standby's logs? > > I am using PostgreSQL Version 15 now, however, archive_cleanup_command on= ly triggered on standby box, not on primary. > Is that expected as designing? Yes. It is a recovery parameter, and they are only used if PostgreSQL is i= n recovery. The parameter makes no sense unless you are recovering. Yours, Laurenz Albe