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 1vrsUI-00Al4J-1F for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 06:53:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vrsUG-0040D2-2W for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 06:53:40 +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 1vrsUG-0040Cu-1K for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 06:53:40 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vrsUD-00000000qSf-3yr1 for pgsql-hackers@postgresql.org; Mon, 16 Feb 2026 06:53:39 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-b8845cb580bso480119366b.3 for ; Sun, 15 Feb 2026 22:53:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771224817; cv=none; d=google.com; s=arc-20240605; b=k88FVM263DZDI7ONYMT33i6J8DdNbCDboOL1CfsMBgEz2oYXPSFm/GWHgjp7NW4r1r 9dw7wAlkDH7yEYSadCf/KsxYlPXV9X8Doe/lHwD16wDWwjd+xEY5O2uinuWta87ek8gd 4jKIbt7cq8uoSFyZXh1ukzUzjvENgFnFaoD9Gh6KRK64f2m3xDUyproTL2GnLkXMzwLV inxN1X8XkvUjDeshZURGXPa3IROvc92dGFJeggTJaBsLh0ChLU/Ou9JQeTuvcnGiid0D jpCI+pU4QjjrrWT1wdQirLm4KeGKLyGkaIa8je8RCs4z9wn6yegiBdYlkk/I4MPOel0f sa5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=YXSEWM7cI3gGI4QIK++OQAmFCAe51JbWx+cRsnXlEZM=; fh=LJKWB2MgW6+UZlv5XJpqr9sgUNK5RMVzzy626sLRT64=; b=VcDFW+fcKdsJ5NXE8kstF2l3NfJYPIyxGjZ3B33SrL/KfaxNSzF6NEVJdY+15ldDYM xs/LOd2n8z+XtWjqSBfKxOnkdMuUIrCfgNUd6Pc60RpYYAuoBHMb2D3Ksz86yLKEpYzF aLG7EFt5UQxX+Ms1g7x6C3d2XHWaavmalkYk8+LSLi29EQGQobuMYx1bI1A9qvEAWpBp tIHrnA0ZKpgKGijVlcgWeJY8tq2hmQ5bH/HVFelqeClfHOSrHZHs8Jvmxb7tuliAnmMu dBgofzAEKChR3AtgyDIOpEmW8JmveZqxlAs0WeaWv6dFS7b1Kmzrfmp9QyrNlw3ON34J aVnQ==; darn=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=20230601; t=1771224817; x=1771829617; darn=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=YXSEWM7cI3gGI4QIK++OQAmFCAe51JbWx+cRsnXlEZM=; b=JAA4pQ9EHA724/+LKn3bhd3BaQQlRskBxletw5d8pTHz5Ujk/LmYklpxBAbfBvmfZo ikJxnxcWxOydLjMyBTk3D/3GmmhzaA7qTsJ9EXkyuLruvUouYv40znPpB6VKGchOrIyb aBu2zcitcWg7MRscLjvpOoiXfwp58h6Tofo/fT6ZfrQitTsZ6gnpVVSKmUUpa1IzBkEw TVNXyLv95G/ULmOww/Qd4ftWvST2UherqC9U1XMVnP46JK1MKtY/Fxg7B0/wK5vDrXEp jZZsePkGE8u9ruWFT+J+eY5c9u75KgniFSN1iD0U6Ah6tdEkH/vHZx2ybp76Onpiks0m 0m4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771224817; x=1771829617; h=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=YXSEWM7cI3gGI4QIK++OQAmFCAe51JbWx+cRsnXlEZM=; b=TOr2kmGKRNR/N4PbHZdZt3xLukxWGgqGRmPgVZUVcZIVKMTNTjaemjbRFeq6wsm5Wu VZXa0Md8yMk+UY2NIqRN5fhcuuNXn/YpZaeRLb1nHwbR+e+w0gbQy71hZNRHfYggpA/5 sTx+jzytRP0fSqsa+3qYlYXkILA8QuVJYzRJu/ME8nST50i9HEDcpk9bW1zoFsnw2IAe y7yyXvWScxqqN6+tPICPbNvSH5107/0mvfpnyetr/4sOXw2aki2lBUSgyTWEdMnvzYKm jK7g+9sbUyDZtj0GbjKdQtLd+MKFAFLddeqMsUncpMtDrFBEbvpZHAl7RhrKzrjhy8xx 94IA== X-Gm-Message-State: AOJu0YzF6+SMijnt6OekfW6Gg4ToFYm99wGP5nr/40x/ZBuGkKCp44BV CyPeByPPO4jKKgRnG3+jWSLoQjn2Z2iW6aM68wXbKrPPk/M61IydpCHzpWvgneBpNb/T/E22bMx /grigV4umxyZt59H/0fF8e0SZWr2dRu0= X-Gm-Gg: AZuq6aIEQK9P5i9GI9b94VtOVWRKEEdgiesMaoEMOuUh/BRipYPii4hRxzyHBBpmlUg CyvR3UDTOiEbcKOTI7lR0M8zjvUhXQxljUv8clijxbkFWKxv1/IC7sMRYXpo0bZ+XJuP2ilUey8 Leb/UZlMGpDCYbgBBTprH/BLfmIi6l9RXKlS5c7JXFVSm7MiImRocOy7svyJ+t/epAddHcoc13o Jb/Cw2MkGI0j+v/nTJ4da1yW6B8FdlfXlIsmA9mbYDW3iDY+rnYElfHL9G5nUzjYyoqgOPdPtn/ ok0V X-Received: by 2002:a17:907:961f:b0:b87:1e94:ef6a with SMTP id a640c23a62f3a-b8fc3cb95b1mr308786466b.47.1771224816975; Sun, 15 Feb 2026 22:53:36 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Imran Zaheer Date: Mon, 16 Feb 2026 11:53:25 +0500 X-Gm-Features: AaiRm518z140N3jaoBcShuKeipG_TZhs8Cw8huEeV1yJSdrfMBCXTp32KpSr5xQ Message-ID: Subject: Re: [WIP] Pipelined Recovery To: "Hayato Kuroda (Fujitsu)" Cc: pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Kuroda. Thanks for the feedback. > 01. > I feel the patch looks large and it is bit difficult to be reviewed. Can you > separate it into several parts, e.g., producer and consumer parts? > Ok I will try to split it. > 02. > The file name seems to be "xlogpipeline.{h|c}" per others. > Noted, thanks. > 03. > Can you add tests? it's also helpful to understand the patch. > Right now I am trying to fix the existing tests under `src/test/recovery/`. But sure we should add some pipeline specific tests. > 04. > Some Assert() are commented out but they won't be accepted. Can you added a > function like AmWalPipelineProducer() and call there? > Noted. Sure I will add AmWalPipelineProducer(). > 05. > Producer is implemented as the bgworker process, but we have another option to > be as a background process. Which one is better and why? > Yes I myself don't have any good answer for this question. For me the bgworker api looked simple and good enough to start the pipeline implementation. > 06. > Can we enable the pipeline with the streaming replication? I've tried but it > did not work well - the producer exit and recovery finished without any promote > signals. My expectation was that producer waits till new record was arrived. > > ``` > ... > LOG: starting backup recovery with redo LSN 0/02000028, checkpoint LSN 0/02000080, on timeline ID 1 > LOG: entering standby mode > LOG: [walpipeline] started. > LOG: redo starts at 0/02000028 > LOG: completed backup recovery with redo LSN 0/02000028 and end LSN 0/02000128 > LOG: consistent recovery state reached at 0/02000128 > LOG: database system is ready to accept read-only connections > LOG: [walpipeline] consumer: received shutdown message from the producer > LOG: [walpipeline] producer: exiting: sent=4 received=4 > LOG: WAL pipeline stopped > LOG: redo done at 0/02000128 system usage: CPU: user: 0.00 s, system: 0.02 s, elapsed: 0.03 s > ... > ``` Yes am working to fix the streaming replication, so far the testing/benchmarking were done with archive recovery. > > 07. > As mentioned by Jakub, it is better to profile per process (startup and producer). > Noted. > 08. > I suggest to benchmark on larger environment. Do let me know if difficult - I can > try on my env instead. > Yes, that would be very helpful. I myself tried very hard to collect some good benchmarks but have some hardware limitations. If you can help me with this , that would be great. You can use the scripts[1] that I used. Let me know if you need any help understanding or using the scripts. [1]: https://github.com/imranzaheer612/pg-recovery-testing Thanks for your valuable feedback. That was very helpful. Regards, Imran Zaheer