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.94.2) (envelope-from ) id 1sBJV2-00Flky-OR for pgsql-general@arkaria.postgresql.org; Sun, 26 May 2024 19:25:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sBJV2-004XwL-CF for pgsql-general@arkaria.postgresql.org; Sun, 26 May 2024 19:25:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sBJV1-004XwC-Uy for pgsql-general@lists.postgresql.org; Sun, 26 May 2024 19:25:44 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sBJUz-00271l-51 for pgsql-general@lists.postgresql.org; Sun, 26 May 2024 19:25:42 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52905ff2a9eso3221017e87.0 for ; Sun, 26 May 2024 12:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716751539; x=1717356339; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gFkoGNyWKVc6xvvr+/dIM/rK+fbQ5GpdzJOBJskgwnU=; b=iSFP1PK35Tlce5p+WFaOWUrUaKjnp55juCe0Fa4QWeWGY7KRjJonOurQKQ9CZKkJ4S 6/RBc9eKpqotZReOj2OTIkRKDvTKwMwZkkPcsxjJXgxF7rJtPRWyyMykc/H6WJk0SFaf cCCiLsrQ4G9uCB7kC9Rh0mZ5ptbIkLW57Iy1bJj/0we26viVF8C3ubF+L2+MQ2tDTg5r e7Ff2ofPcGHQyqcfF+zkGpBnY9v4lGxaaVV0Ybot6L0ShZpyMBn+EAexIQmYQF2o6ecb PVPLRkxWYjO6KprLgYuMic0GXw/pCDB6XIEEKciUmRcT+lIhdHKaPKPYMx6TUPm8rDH0 wVJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716751539; x=1717356339; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gFkoGNyWKVc6xvvr+/dIM/rK+fbQ5GpdzJOBJskgwnU=; b=gijNjq9EXxcj88OS0zuENRTwoPj6ZgXEL6ZIFzwFSE8fZyIx6HEWvFFI5F0bXNlaw/ ho2/b8cmu/bvThERILfMAzQ18X9vLkvIhI0vP68nsgCrQq6HDb0/Tw+0z6VKAcKvW7cZ 1K6Y8lRjWbyr+ekTnamT4+ZpiakQ1SxtobIpfIFWiyNFO9pHPLfPaDmvK1++6XFHXvuh gVDpBjNT7rQYhRSFGQC/bAovhOaq3YiHYwrtPxw42hOYNmzBEoU24kAt+mfEo7vcCHr5 MJFzSVz4jNRuLa3mjjmh/U3JsDjvYT0bo8coej9YzTksQ/UY529wOko8SSjjB5UZM+nh 433Q== X-Gm-Message-State: AOJu0YzlEmg4SO/D/8/4gFW0rhMQgK6QbS64W7MQUy6wtBm2EzbcRi23 coN7J5UU8EA0xOVjj0n5SzoP/0AvQqDZ7TPWt2sfxLMVairidEtkA+Oe7IykHAfMQj2aGXyVYKp irtgOX22b6wGlYqbipI7V5le/5A== X-Google-Smtp-Source: AGHT+IEIOYmpdrMlXtdY7VgDyA7ECxNLAAS8do/2WnsyDfcr+C0/Eq0xSWvoFHKFaN0NQp6NB2bngfg+CFVpJteXbf0= X-Received: by 2002:a05:6512:224c:b0:528:5dfa:fc8 with SMTP id 2adb3069b0e04-529644ec099mr5891962e87.2.1716751538397; Sun, 26 May 2024 12:25:38 -0700 (PDT) MIME-Version: 1.0 References: <891bcfec74f7358ef0212caf6565a35153dd2941.camel@cybertec.at> In-Reply-To: From: =?UTF-8?Q?Torsten_F=C3=B6rtsch?= Date: Sun, 26 May 2024 21:25:26 +0200 Message-ID: Subject: Re: Long running query causing XID limit breach To: sud Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000009d2d900619605d8f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009d2d900619605d8f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, May 26, 2024 at 8:46=E2=80=AFPM sud wrote: > Would you agree that we should have two standby, one with default > max_standby_streaming_delay (say 10 sec ) which will be mainly used as hi= gh > availability and thus will be having minimal lag. and another standby wit= h > max_standby_streaming_delay as "-1" i.e. it will wait indefinitely for th= e > SELECT queries to finish without caring about the lag, which will be > utilized for the long running SELECT queries. > > And keep the hot_standby_feedback as ON for the first standby which is > used as HA/high availability. And keep the hot_standby_feedback as OFF fo= r > the second standby which is utilized for long running SELECT queries, so > that primary won't be waiting for the response/feedback from this standby > to vacuum its old transactions and that will keep the transaction id wrap > around issue from not happening because of the Read/Select queries on any > of the standby. > Sure. That could work. Perhaps also set statement_timeout on the first replica, just in case. --0000000000009d2d900619605d8f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, May 26, 2024 at 8:46=E2=80=AFPM s= ud <suds1434@gmail.com> wro= te:
Would you agree that we sh= ould have two standby, one with default max_standby_streaming_delay (say 10= sec ) which will be mainly used as high availability and thus will be havi= ng minimal lag. and another standby with max_standby_streaming_delay as &qu= ot;-1" i.e. it will wait indefinitely for the SELECT queries to finish= without caring about the lag, which will be utilized for the long running = SELECT queries.

And keep the h= ot_standby_feedback as ON for the first standby which is used as HA/high av= ailability. And keep the hot_standby_feedback as OFF for the second standby= which is utilized for long running SELECT queries, so that primary won'= ;t be waiting for the response/feedback from this standby to vacuum its old= transactions and that will keep the transaction id wrap around issue from = not happening because of the Read/Select queries on any of the standby.=C2= =A0

Sure. That could work= . Perhaps also set statement_timeout on the first replica, just in case.
--0000000000009d2d900619605d8f--