Re: [PATCH 0/2] Parallelizing the archiver

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Stepan Neretin <slpmcf(at)gmail(dot)com>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH 0/2] Parallelizing the archiver
Date: 2026-12-02 11:41:48
Message-ID: CA+TgmobKF_Jcxgq=g42KYvQDhbZD8OCybrXmMAkp_wXDgBZ7fQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 28, 2026 at 12:33 PM Stepan Neretin <slpmcf(at)gmail(dot)com> wrote:
> On Discord, Robert Haas and Christoph Berg said much the same about the
> jobs-pool draft. Robert did not want one short-lived child per file:
> warm connections and parallel transfer should live in one helper, or in
> a C module. Christoph wanted archive_library and a simple stdin
> protocol with per-file ok/fail answers. So please treat
> archive_command_jobs as superseded.

I think the tricky part here in terms of designing a C interface is
where the waiting happens. You've got a sort of main loop that
periodically calls into the callback functions, which works if the
callbacks are starting an external process, but what if they aren't?
Imagine an archive module that itself is pumping the data out via a
network connection. It can't afford to keep yielding control to the
main loop -- it needs to be able to keep working all the time and
somehow poll for new files.

I'm not trying to pretend I know how this should work, because I don't
think I do. But my preliminary impression is that what you've done
here only works for the specific case of wanting to launch an external
process, and for that case, we don't really need a callback interface
in the first place.

--
Robert Haas
Databricks

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2026-12-02 11:48:24 Re: Quickselect instead of a heap for ORDER BY ... LIMIT N large bounded sorts
Previous Message Rajesh Kumar Thandapani 2026-12-02 11:37:45 Re: Add aborted_txns and aborted_bytes to pg_stat_replication_slots