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 1wgpwr-006RZY-2h for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2026 20:29:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wgpwq-002rvn-2I for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2026 20:29:48 +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 1wgpwq-002rvf-0S for pgsql-hackers@lists.postgresql.org; Mon, 06 Jul 2026 20:29:48 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wgpwo-00000001u2N-1Nsh for pgsql-hackers@postgresql.org; Mon, 06 Jul 2026 20:29:47 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2cc8e87f29bso12559955ad.2 for ; Mon, 06 Jul 2026 13:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1783369785; x=1783974585; darn=postgresql.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vYnKRWB8ha/uifT7YtzkNtFhu7GLecfXyaFFNKWGuaU=; b=KQUEFXYbTYyPM6QbEXNWreuj5snXI/ENtADjMRtAQFbuhNLHE9LNzbB8Bm2EZXhogl QLL6vesxbp7FFgG/DsiyrvVDSatgRXeQXpluMPFd3mh7+TmY4lPYMFT4hf/59rj6tDZo dYqcs0C78jZeceRBglwKEIHlaQdcDT3xFgpHE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783369785; x=1783974585; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vYnKRWB8ha/uifT7YtzkNtFhu7GLecfXyaFFNKWGuaU=; b=f9yf7OKVSQGCZPrHgv6WyrDGNfGNGS+5B2sLMVa/hWrmJfqH5+GJAQAMvHdpn9eQFh J1hKL2/PX8kDXBdANUvYZ+gbwK2prwN/12xjxnKSgqjq23Q7JK7ZYObPzOk/Rk+M45da wAFCkuYuj0oq3YKBk21VzC3gBZt22t72q/USjiZH3KfIGTrztCuZLgfxzanY6xbMrYwQ WhtrrwZ/nG4ruGUSQwwuCoicTs8EqS0gcoqq6DYKv6EHbQ6/z9CqjmD7+V8bAvvtX7HZ zLoCd3Xm9CEb6/ZUwp+e8xp9pjEKGNwbMVUw/apjM6uYnS1xqX83EnnVx+qti3EWAEda AlkQ== X-Forwarded-Encrypted: i=1; AHgh+RoVbejw6DSpU7GGXc7LXfCBMawxzDUOZLmCWNWqjgF96CIed1Qzl5ky+5cVetKJSWsnw/VAcXI+80vFBPzg@postgresql.org X-Gm-Message-State: AOJu0YwIUeF2IuLMo8cXIThuwTgWxPdukoES9AS1xyd70ho1frYA6wDJ q44P/UFEuTt2VjqaaNHRFUAUjsAUSGiVzfh3MWpGRA39ci0n0jM6v5KlvipAIM0lwaBLVqucngB d2qbsWQ== X-Gm-Gg: AfdE7cnlFLfsk+8U8wuVc4cQEGzzhj+AcFwTcxqwOPNabSlHJ61WHE6tWxesiW8pC4w JYeB4zQvPI/caHPObDplKHkYO1WoY4GuBwXDksQmEW/zzIqIT3SWElVKcdN3wi8kYiGbXUEOIto fBjhR+I8uGwlNMjqodhj0BsPcH5OUpFc9gzyEJPPNUp3HZkiz3xYevFraQS8A50jO3VazpYWiZh bOIpeIvNnvnuWO9B2JXaUNV38WrIT73x6G06PtzZ5S8MllU7mJNkHyB9Dog1lK2m9uPss96idmE sMDT3QK8U/hO0BgHumLgNLq7XT9rTNcTeRbjogDZQ4GciQJ0ckndyBm9/8YJe5/AjIonKyOKF0O THb5prLTWjg+mJ4S4myL010pc85U01aTm+LKnxxHkcL16LWUJALFZRIEl1cqkDG/0jj6CebpRw9 5xNNCCPdNVidKjN4qObaB7WJ3xbVRHFiKz2BSkCp4qLG9Z X-Received: by 2002:a17:902:d490:b0:2ca:ef4c:e553 with SMTP id d9443c01a7336-2ccbe40b1d7mr22799045ad.3.1783369785292; Mon, 06 Jul 2026 13:29:45 -0700 (PDT) Received: from microsoft.com (c-73-15-160-255.hsd1.ca.comcast.net. [73.15.160.255]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b659fa13bsm98085c88.15.2026.07.06.13.29.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2026 13:29:44 -0700 (PDT) Date: Mon, 6 Jul 2026 13:29:42 -0700 From: Noah Misch To: Xuneng Zhou Cc: aekorotkov@gmail.com, pgsql-hackers@postgresql.org Subject: Re: wait_event_type for WAIT FOR LSN Message-ID: <20260706202942.97.noahmisch@microsoft.com> References: <20260706012642.f9.noahmisch@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.3.0 (2026-01-25) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 06, 2026 at 01:41:35PM +0800, Xuneng Zhou wrote: > On Mon, Jul 6, 2026 at 9:26 AM Noah Misch wrote: > > commit 7a39f43 wrote: > > > --- a/src/backend/utils/activity/wait_event_names.txt > > > +++ b/src/backend/utils/activity/wait_event_names.txt > > > @@ -76,34 +76,35 @@ ABI_compatibility: > > > # Wait Events - Client > > > # > > > # Use this category when a process is waiting to send data to or receive data > > > # from the frontend process to which it is connected. This is never used for > > > # a background process, which has no client connection. > > > # > > > > > > Section: ClassName - WaitEventClient > > > > > > CLIENT_READ "Waiting to read data from the client." > > > CLIENT_WRITE "Waiting to write data to the client." > > > GSS_OPEN_SERVER "Waiting to read data from the client while establishing a GSSAPI session." > > > LIBPQWALRECEIVER_CONNECT "Waiting in WAL receiver to establish connection to remote server." > > > LIBPQWALRECEIVER_RECEIVE "Waiting in WAL receiver to receive data from remote server." > > > SSL_OPEN_SERVER "Waiting for SSL while attempting connection." > > > WAIT_FOR_STANDBY_CONFIRMATION "Waiting for WAL to be received and flushed by the physical standby." > > > -WAIT_FOR_WAL_FLUSH "Waiting for WAL flush to reach a target LSN on a primary." > > > +WAIT_FOR_WAL_FLUSH "Waiting for WAL flush to reach a target LSN on a primary or standby." > > > WAIT_FOR_WAL_REPLAY "Waiting for WAL replay to reach a target LSN on a standby." > > > +WAIT_FOR_WAL_WRITE "Waiting for WAL write to reach a target LSN on a standby." > > > WAL_SENDER_WAIT_FOR_WAL "Waiting for WAL to be flushed in WAL sender process." > > > WAL_SENDER_WRITE_DATA "Waiting for any activity when processing replies from WAL receiver in WAL sender process." > > > > > > ABI_compatibility: > > > > WaitEventClient is about waiting for a socket to become readable or writable, > > so I think WAIT_FOR_WAL_* events don't fit in its scope. Sockets are just one > > of the ways to be in WAIT_FOR_WAL_*; other delay sources include local fsync > > and local replay, which could be disk-bound or CPU-bound. > > > > I think WAIT_FOR_WAL_* belong in WaitEventIPC. In the absence of objections, > > I'll change it that way: > > Thanks for raising this. It makes sense to me to move these events to > the WaitEventIPC session. I'm wondering whether this reasoning also > applies to WAIT_FOR_STANDBY_CONFIRMATION. It partially does. In favor of WAIT_FOR_STANDBY_CONFIRMATION in WaitEventIPC: - It's much like SYNC_REP, which is in WaitEventIPC. - It's a condition variable wait, not a socket wait. In favor of keeping WAIT_FOR_STANDBY_CONFIRMATION in WaitEventClient: - The standard for reclassifying a wait event post-release is higher, since it impedes comparing waits across versions. - The condition variable is set based on a socket read, and it's fair to treat the condition variable layer as an implementation detail of little concern to users. Overall, I lean toward not changing WAIT_FOR_STANDBY_CONFIRMATION.