Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xMNLZ-00000001ziA-20Nk for pgsql-general@arkaria.postgresql.org; Thu, 29 Oct 2026 10:27:01 +0000 Received: from localhost ([127.0.0.1]:39822 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xMNLY-00000003peo-41Dn for pgsql-general@arkaria.postgresql.org; Thu, 29 Oct 2026 10:27:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:36618) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xMNLY-00000003ped-2gcg for pgsql-general@lists.postgresql.org; Thu, 29 Oct 2026 10:27:00 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xMNLW-00000001ZSy-1Jfd for pgsql-general@lists.postgresql.org; Thu, 29 Oct 2026 10:27:00 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-6b1ab2ad719so2466050a12.3 for ; Thu, 29 Oct 2026 03:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793269617; x=1793874417; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=mIF28hbLxlf0o2P3UAwcT7Vu/EyCPo/ldqx95Rtt6gg=; b=PB0Er6uR9LD9dk2OjdzgZvKOlMsStdAx17Ffdjq6iSxI+Zo/iWw93Wk22vWGr1eWkW n4Hne0xnnKlqYUhGj4575V/K3Q4c/S/kCv+Oj2RvS+FKLOilonuiQ8g7Vl9eK2a/Wb1r ROgLVWOid0sBy9CX4XFN0IXJn+fa0q3xCXBGjmkkL6BKvX5oreefoPyJVoV5xD5dQH1Y PisRWymLGnpCLECPh+nFU+Go5tNvbqyXOGVORtfOs71O+x9sd5DRmCXgjGRlgCYBXBJA Ifivd5kWNI05Q923iiG5pudySAR+RZ2Mv2hVcNFqJGFl3rrlc4KW8CaXLJl1f8QCf8/k 7CgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793269617; x=1793874417; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mIF28hbLxlf0o2P3UAwcT7Vu/EyCPo/ldqx95Rtt6gg=; b=rblpTjeNnz51dhQZ3NZHGUsdA3/6lupHJJl5di3e0yt2C2Ud81nNwMh6qRrNoR/Wgw gCke0kfun1z1+M6zvU5lr4o7klrUX0PXQYPQFzg0Hk55o6APcLhrh8TxqAnDtdVqVPoh mIz607tgCj4WHOZiW3lnDkcSi1R1lJJ7kBhgrwcDbcQYbuLtKV6jmf5UQkYNe5mP0f6U VZHEWVeyR5A95wlwGEHY9OvGnNYSMZkVATMLXvv4sUwV+NFSQRKgxH20KmWH9ox+IoEU W5/gqj3olcaSC/QTLuVS4MF8hqeiufL41VEaUDdNMZt+Td+Fq6gD0b/yvjvatdPwDOZU LySA== X-Gm-Message-State: AFq9FYIQt7+5yJ5UBBzpEyL62WuKWTggj7w3fCJD6djSTSEBauKmh5c3 QLBePa2FKd3V6Xg/59BAwXCvgEQE65Frd+RKkchgyukij+gEQV3eCqnAXhs7bg== X-Gm-Gg: AYBFou1eYaJ1kB+shfn6DL06rnuCAiTiIsP/qeyi8YBZF7VcAdGN/mmRBDB3MaC3oja 4DkfPh7COaRhMcdq9vZsDe3abeOlKdmFpZDpVNGCUluOYNfXd2vqlHdT/M44R4Kpd4WRsTg1uPx mZiif2z7a+mzOK2CX8yRO6PjCNzki3y5ykFKd90hQ6ztk7YgFaZbazPIe7daChZIbL/z8/87WX+ xgHeXYzxLMhwiUtm6qiORcrXHA32sKluwo3ag3f9nbhsO7XEuK6BDbTITK3GpmBnhrwfZlDXq10 ugyxknpG+hrNAQQXMIknTO5dqTd5VEn/gG/vBSdBKGuKAiohiioGfqWLJPRLRk8x/LOcEOgCV8H 1/OYIaTbGmFSZNRQH/VYkyWCPF6Lj5dlrV7KGdUpUHofHjsYDRBJ/R/1oqGKeQKSbsQwQZb5YhI fPXAtVLTYfWBXY1KhHtc/0leH3UZfnKGWipasHSgpEBfdPux4dwIOHBYmSPNX3ZbY+My+4pb2L6 30s5Fu4Z6U7Gw/81iQMlStMG8Wa7OptzAUvz7pf5DEp2h1HkAbkpj2qQXfnx8eLHP4+26Np1jm/ e4o9W9AZ7OgHWXn6yei+v8EJ4NTLCm0aEDlWUB9nkTJxqSXxxCUZoA== X-Received: by 2002:a17:907:2d21:b0:c43:bf29:1517 with SMTP id a640c23a62f3a-c49bded1779mr437864666b.12.1793269617205; Thu, 29 Oct 2026 03:26:57 -0700 (PDT) Received: from smtpclient.apple ([192.87.39.141]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c46bd520838sm717188766b.31.2026.10.29.03.26.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2026 03:26:57 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.1\)) Subject: Re: max_standby_streaming_delay or hot_standby_feedback From: Jan Karremans In-Reply-To: <140108b8-2861-4d98-ba14-a7a6d8f3be78@arvin.dk> Date: Thu, 29 Oct 2026 11:26:46 +0100 Cc: "pgsql-general@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <681B4877-5117-4C7F-80C8-6B50C5062D08@gmail.com> References: <140108b8-2861-4d98-ba14-a7a6d8f3be78@arvin.dk> To: Troels Arvin X-Mailer: Apple Mail (2.3864.700.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Troels, The question is how long your pg_dump run takes, as that is the duration = you need to have the delay set to. After the delay runs out, the system = will start applying WAL again, and to do that, it will end all queries = that run against the system/tables to allow for the apply to take place. Alternatively, you can indeed activate hot_standby_feedback, which will = sort of do the same, and retain WAL on the primary, both cases require = space monitoring to ensure you continue to have enough free space for = the accumulating WAL. Cheers, Jan > On 29 Oct 2026, at 10:45, Troels Arvin wrote: >=20 > Hello, >=20 > I have a setup with a rather busy and semi-large primary Postgres = server which uses physical streaming replication to a secondary server. = The secondary server is to be used for read-only queries (reporting), = and I've starting running pg_dumps towards the secondary. >=20 > I now run into error messages like the following when pg_dump works = against the secondary: >=20 > pg_dump: error: Dumping the contents of table "sometable" failed: = PQgetResult() failed. > pg_dump: detail: Error message from server: ERROR: canceling statement = due to conflict with recovery > DETAIL: User query might have needed to see row versions that must be = removed. > pg_dump: detail: Command was: COPY someschema.sometable (col1, col2, = col3) TO stdout; >=20 > I have tried setting > max_standby_streaming_delay =3D 5min > (Default is 30s.) That doesn't help. >=20 > I'm wondering: Should I further raise max_standby_streaming_delay, for = example to 30min? >=20 > Or should I set hot_standby_feedback to "on"? = https://postgresqlco.nf/doc/en/param/hot_standby_feedback/ recommends it = stay off for my use case: "Turn it off for a replica which does = long-running reports and is allowed to lag." But having heard = https://postgres.fm/episodes/hot_standby_feedback I get the impression = hot_standby_feedback should almost always be on when using streaming = replication. >=20 > Would it make sense with a combination, i.e. setting = max_standby_streaming_delay to 10 minutes and activating = hot_standby_feedback? >=20 > --=20 > Kind regards, > Troels Arvin >=20 >=20 >=20 >=20 >=20 >=20