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 1wwfAK-0027VH-0M for pgsql-admin@arkaria.postgresql.org; Wed, 19 Aug 2026 12:13:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wwfAI-003qd6-2c for pgsql-admin@arkaria.postgresql.org; Wed, 19 Aug 2026 12:13:06 +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.96) (envelope-from ) id 1wwfAI-003qcy-1N for pgsql-admin@lists.postgresql.org; Wed, 19 Aug 2026 12:13:06 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wwfAG-00000001OEc-0uP8 for pgsql-admin@lists.postgresql.org; Wed, 19 Aug 2026 12:13:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description; bh=n20Q6kALLZ52xk4M4LpdTkQ7AQBq2CQvh5i77fjRGdA=; b=qEOU4xShzWoXqiBPa2wWZEVm94 AKyCePwoMQyVgKIszsPY2Rul/IhdJEQP8GXrYPCCd+k9Yapn/uRUmU4SFRrsBBLLpD97S63AMEuwM pD/TwT9ffePr2G9WFKgHbIx/FMZ1/kvxWjiu9LvIxS10nh7RN314zAje7OWA1pmT5Ilg=; Received: from depesz by depesz.com with local (Exim 4.98.2) (envelope-from ) id 1wwfAD-0000000FDEX-2BYc; Wed, 19 Aug 2026 14:13:01 +0200 Date: Wed, 19 Aug 2026 14:13:01 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Simon Musila - Localhost Cc: pgsql-admin@lists.postgresql.org Subject: Re: PostgreSQL Replication =?utf-8?Q?Lag_?= =?utf-8?B?4oCT?= WALs Streaming but Not Being Applied Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 18, 2026 at 09:03:39PM +0300, Simon Musila - Localhost wrote: > *My questions are:* > 1. What could cause WALs to be successfully streamed to the standby but > not applied/replayed? Concurrent "traffic" (queries). Or special operations in wal that take "a while" to apply. > 2. What are the best steps to identify what the WAL replay process is > waiting on? I'd start with: a. `ps uwf -u postgres` shell command (as long as the underlying os is linux-ish. b. `select * from pg_stat_activity` c. `sudo strace -f -tt -T -s 256 -p PID-OF-PG-STARTUP-PROCESS` - again, on linux hosts d. pg_waldump of the wal file that takes long time, and check what is going on there Best regards, depesz