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 1wEjvH-004Ljb-2v for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2026 08:24:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wEjvH-001W8V-0C for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2026 08:24:03 +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 1wEjvG-001W8M-2S for pgsql-hackers@lists.postgresql.org; Mon, 20 Apr 2026 08:24:02 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wEjvE-000000026Ll-35yC for pgsql-hackers@lists.postgresql.org; Mon, 20 Apr 2026 08:24:02 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-38dd9f11a09so25123541fa.2 for ; Mon, 20 Apr 2026 01:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776673439; cv=none; d=google.com; s=arc-20240605; b=Mz5ZfCDOpYyDNMQ2qaiufBp9crSInbs2jl65pHOgYlD0Jaq0ftjAgBvp/KpKluknBJ yOan7C/AiKR2tJ/Q2IT/+AfFSDiLVhMgWuCPPK+FBcWzZRPrP+5NKN1sknkIbTWb2F0J qlNe7KPBDsMA7pFsaNujhtPu2SA2QRnBDEdVaSQzTkyeAIKovBHcA5wIaT+fIV9QrwFO P3gaF45vpamzVpZ54MN+uNL2OBW8Tu55KZ20tBLHHSjAP57/U54YDvlNReEauwAXYuT+ Pvx4JdNMp6AllaZqmBI0FfITQ6S9KYEvLozGuDXgE1weurlwduioFCu69x8b6OMtSHTh lQuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QKJweofTG2lvSIWDRLGKmqTRgneQhCgHDbI0l41RfRk=; fh=Ti5UUWWnIawXjRDrxK96yl2MCM81GcRJ2EeXAktfwrY=; b=dMrfwTOL7iQ+DypCnfaU+6qTYGnLX9WhMzvHhpm48GoGGb1qwTk+mhpXV+TgKluxCW PaYIbAPSeiiRM+zEa6ZFj37W/5wdwICk+fPGkeqKN8Hb3AfSjZK7s12At618wStmM6MF XIuL9BsRpoqyHYW3mlr7Ocd6MX6bDd6UUQzU7Krr9zspRzRYZlA2Q7XqzuAhFH3e9MtJ +41rNkGyXWCEWqnkUpd6UakLmvpht4hFrgQf0evUcW0mVjhlwKgDXJW6b6wqLXkLBA3i cpa2mozrfq6tBE9Yg0+XNYkqmKh+z1TaGEXcp82FW0i82J1i4s9WTSgYR8qjNxUN9t9a KEiQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776673439; x=1777278239; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QKJweofTG2lvSIWDRLGKmqTRgneQhCgHDbI0l41RfRk=; b=dprTlGlQkxLs+HCJvPa8THXyhGQGcsTrqkTpHDLZzpfuQ93NbSlKt+M+hCdoZLJS6g OZIZXwcInax5RkuKmzJiSrtop561GhgeePpaQlnsx9OOB6h3MmlSle4YhrjfIaGcj3Mn 5eoRLe9sraXhTW6EOq2o6eJJulbfAVk1jIu7bfFFAxpQxfCkliK+g2lOZi4j9ErSxGcf DUpWWapX4w2jgxrHSM+SmSj1orppNsFpNtv3DppQeGyycOuuq9WendlozIlBsoXWPl0O tCRVdQ0g0VbD8F9DBMV87MMezB28zUH4T4t1gIVc2uIgyMHmhDfqW8nlK/poSt8+xV9i ZEag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776673439; x=1777278239; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QKJweofTG2lvSIWDRLGKmqTRgneQhCgHDbI0l41RfRk=; b=MaAbVy6qndYmf/0J4nSn4U85iRkidow/skSPaKMzrjorn59TBV8L3YRdoHPIRwcrue z/dky9sIr13FI2juPngrvGqniydqKysf2MGhujj/vyy6AcAqdYd4ypTfyufG/nYrH3Zn yc8UJYHrtNnrw4jCY6+qmac/RQPtvKTTKPJt6etNRdlDSK+KVGmlx5DMrcCTQvhICToj N7+OewGdoD6YDYWLfJXWQSsgfAGJ2LeS5kqo8dQpx77XvQsfN0wiOS0qT40OLpmd5S6T kQRrDwY07MW/8PpAeppGSAfzwyz7VB5TJMTp4B3Wj39BQPJ8s5VlUEYXlvhtF/SqIAJ0 zRJg== X-Gm-Message-State: AOJu0YxY/uFmtPqxuOYe4siGnyo2qGNNf8KbJ6DG0ShvXf5J8xda2lYN 0XZVVGREuyPtu+S1mpP23rnpwuAaarUyZQaZq8Goo5GFrLu1pGKwt5Xj5NIFVM15Zhx3oHiC9XF fdAVd87SXD6aHcgsmT4CgQAQYrGaBtpE= X-Gm-Gg: AeBDiesAbgCLILliMDJykiwbG3H4qcsxPhjFOky/BzdwQYNoXbcnfrdDQ2L5g0hFhuE 73+vKiULobKiplUyaOCw0pLsLddOuNtrNp55VxOLAskQVVcQVllPGtiKtvlZ6yVw21bw2sxD0fN WN9DR9/5mbYPYCnc6EcNNiqQf/tr1CKUG9+k6gRuxV6+Xb9qWEYdBkPgowTUi8Vl5mqwhfr3uth 1DcGfAa4MtXRRVuZewsO6BSbu4T43Ong3U9xqUFwiiEBnSWtGV3mdQ1Ds5NmBQ5PioS/ZqyZroB cbLYIGRj1oDy+tsrMStvWhUIUNgikEig8Inp6nkm9jrHwtcz1/ya X-Received: by 2002:a05:651c:1114:b0:38e:bfa2:27d1 with SMTP id 38308e7fff4ca-38ec7b4ed67mr36017701fa.33.1776673439030; Mon, 20 Apr 2026 01:23:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Mon, 20 Apr 2026 13:53:47 +0530 X-Gm-Features: AQROBzCXIL0jy2d1CJJLZFjTtic_YCenJY_LGq1wwH-WYJ5Aq_upya1eoXudIT8 Message-ID: Subject: Re: Fix stats reporting delays in logical parallel apply worker To: "Zhijie Hou (Fujitsu)" Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Apr 17, 2026 at 12:49=E2=80=AFPM Amit Kapila wrote: > > On Fri, Apr 17, 2026 at 8:31=E2=80=AFAM Zhijie Hou (Fujitsu) > wrote: > > > > When implementing another feature, I noticed that parallel apply worker= s > > currently do not report statistics while idle in their main loop. This = can cause > > stats from the last processed transaction to be arbitrarily delayed, es= pecially > > when there are long gaps between streamed transactions. > > > > The issue is demonstrated in 0002, where a TAP test fails when attempti= ng to > > collect stats from a parallel apply worker that has no subsequent trans= action to > > trigger a stats report. > > > > 0001 fixes this issue by forcing a stats report when the worker is idle= in the > > main loop, matching the behavior already present in LogicalRepApplyLoop= () for > > regular logical apply workers. > > > > LGTM. We should backpatch this change. > Pushed now. --=20 With Regards, Amit Kapila.