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.96) (envelope-from ) id 1w3UTW-001Gz3-0f for pgsql-novice@arkaria.postgresql.org; Fri, 20 Mar 2026 07:40:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w3UTU-004pNa-1C for pgsql-novice@arkaria.postgresql.org; Fri, 20 Mar 2026 07:40:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w3UTU-004pNQ-0G for pgsql-novice@lists.postgresql.org; Fri, 20 Mar 2026 07:40:52 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w3UTR-000000008qS-2os7 for pgsql-novice@lists.postgresql.org; Fri, 20 Mar 2026 07:40:52 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4852c9b4158so12328635e9.0 for ; Fri, 20 Mar 2026 00:40:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1773992444; x=1774597244; darn=lists.postgresql.org; 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=w+LM4CzLV/pOs0PwXzj6mHbq1QKkmGtFQcbc7JTm63o=; b=UkUGfOjhxtdhP6KspP2QHD0OFJAxHQXJfe8OOg/l19sYw+RFTIRTciHSRiMvsIqF31 rhuaUIg4sWeDVCb+YwV/Cjv6r4ZZqh9S0plC+GvSrjJnCfzj3Eqg4k6+9ukvqU9tBXkg B3axzIl8eIdsLBrwzY5F7j3xVjLz9HSmSeLKo/MDhPdpQFODRjRX2grw3mO6a2P7F06g Qbsu7FXP48Oddom7VziisFqJ91tBRol5Ku2z+QCqq+kGjWPhM8N5eFCVOt6EFziXOI0P Sxalr/NH/U/R+VlFZNzdbuRhhN1rVEo9akgjQX0CkuuGoxFy9BA3kEhYLszm74PSH3Du sKhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773992444; x=1774597244; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w+LM4CzLV/pOs0PwXzj6mHbq1QKkmGtFQcbc7JTm63o=; b=QDoksiT+hNPWK8HS2XuABnUN0OZ39BhhjEB/aC3mVkBc1ARgjFLBVjm/R0CxKNsySs HU6Ye3slN83B50+cZjVqSjhynfFjgb9IFQzOaL1lsdJ8x77ik8QvyUsaA8gefsqmCUng F8N66gsArXNM04aepc3k0J/dZu9EQ48yJAsHofHNRiA8f8C5i5ypyJpgx+RBzT5MAjyF M642HHVQUv0RYHROD4xwCZaDskT+hfDFBMQLB+7s9x/g8z3iBh9v//0lhTsleU+nh5PR OICaYKAVEreI1ZEj0BhTAuzuyUUG03Qpqzat+b7ENOhefd/vlp0IhlyHRKjMc6WDJr0f V7jA== X-Forwarded-Encrypted: i=1; AJvYcCUmRzm4XSr/4BOYcqJdxGhIJyLthFqWUa9bciuDmhi9DXuBFA7ZG+50UP6EV1yxlWIFRI1xUWQePd323YI=@lists.postgresql.org X-Gm-Message-State: AOJu0YxZ9v8S0LFpYTerBZNVe6jQaK/vzNjY5OgP0s/upuVCVNpQS+q2 goUmOhUD+nhtdoLZcuXHonMFfC0lUHnvhUHulfh5Ppj5R1GLkBYJvXUs/t+SW/s9xa9l/iTjcaC JynnR X-Gm-Gg: ATEYQzyoKu4HLKCVG9U/2hTH4zT3vcZlzk9yzfld8x/252/mlmo5uucJkgHs+p0FT3J k11s5TSlssxuJfCSfSJlmBctQrITkj9v24YPDrJr8YoLPjVabsLf+tkqV39fqnu6uoZ0tqg8AQ7 ydYNkN2IFp/+U1itr+iYDwuUwrdLIZDTQOEHaPje9vX9nwqc9DxBcgbmlEIoIFRhO6155eTOvbR 0EcxWAEWvx6YvWmzOwFOhW1Uo8PDkzSTYDqRbxavi2pCSCwGjBEIO1eXcQIPxxsTAW9KsLtZYGA i/xZisLRYAfXgyO/7+lA4Wu75H+Gw2WwPLGh+MKnN5E3v1BhE0dfOkhs8z2Uz9RGelwetQ2f8zb NVHRlEXJG5Tit7/fT3VY1HI1BbZTcQci5YRk6hT0X9aGl6cN4mpzqqRSisYbscj/ipq19LOzRSo N+gpWVl3GWbuyj42ES9xkLbftP87MSyhuh9v4W+3xZfNmQQ/ANJkc= X-Received: by 2002:a05:600d:8401:b0:483:709e:f238 with SMTP id 5b1f17b1804b1-486fee297demr22717085e9.29.1773992443850; Fri, 20 Mar 2026 00:40:43 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:70:e90e:121b:3a33:bb9b:f66]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-487017210dcsm9708595e9.10.2026.03.20.00.40.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2026 00:40:43 -0700 (PDT) Message-ID: Subject: Re: Replication Testing- How to introduce a Lag From: Laurenz Albe To: "Subramanian,Ramachandran" , "pgsql-novice@lists.postgresql.org" Date: Fri, 20 Mar 2026 08:40:43 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2026-03-20 at 06:33 +0000, Subramanian,Ramachandran wrote: > I have set up streaming replication in a our test environment and it is w= orking OK . >=20 > 1. Is there a way to =C2=A0force a lag between the source and the stand-b= y in an environment where there is NO load? Yes, set "recovery_min_apply_delay" on the standby. > 2. During the set up process as I was thrashing around from server to ser= ver I received this message > in the stand-by if I make the standby follow a new server B after it h= ad been following a server A. > =C2=A0what seems to work is, additionally clearing out the archive logs= dir of the standby server along > with the data dir, before running the pg_basebackup from the standby. = =C2=A0I am extremely new to > postgres and =C2=A0I want to make sure that what I am doing is not a d= angerous practice. >=20 > FATAL: requested timeline 2 is not a child of this server's history You have "recovery_timeline =3D 'latest'" on the standby, right? Then the standby that gives you that error probably followed the original p= rimary to a point past where the new primary forked off timeline 1. You need to shutdown the standby that gives you the error message and run "= pg_rewind" to reposition it to follow the new primary. Prerequisite: "wal_log_hints = =3D on" or data checksums enabled. Otherwise you need to rebuild the standby with a new pg_basebackup. Yours, Laurenz Albe