Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit
Etsuro Fujita <etsuro.fujita@gmail.com>
From: Etsuro Fujita <etsuro.fujita@gmail.com>
To: David Zhang <david.zhang@highgo.ca>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-05-02T08:25:31Z
Lists: pgsql-hackers
Attachments
- v8-postgres-fdw-Add-support-for-parallel-abort.patch (application/octet-stream) patch v8
Hi,
On Wed, Apr 20, 2022 at 4:55 AM David Zhang <david.zhang@highgo.ca> wrote:
> I tried to apply the patch to master and plan to run some tests, but got
> below errors due to other commits.
I rebased the patch against HEAD. Attached is an updated patch.
> + * remote server in parallel at (sub)transaction end.
>
> Here, I think the comment above could potentially apply to multiple
> remote server(s).
I agree on that point, but I think it's correct to say "the remote
server" here, because we determine this for the given remote server.
Maybe I'm missing something, so could you elaborate on it?
> Not sure if there is a way to avoid repeated comments? For example, the
> same comment below appears in two places (line 231 and line 296).
>
> + /*
> + * If requested, consume whatever data is available from the socket.
> + * (Note that if all data is available, this allows
> + * pgfdw_get_cleanup_result to call PQgetResult without forcing the
> + * overhead of WaitLatchOrSocket, which would be large compared to the
> + * overhead of PQconsumeInput.)
> + */
IMO I think it's OK to have this in multiple places, because 1) IMO it
wouldn't be that long, and 2) we already duplicated comments like this
in the same file in v14 and earlier. Here is such an example in
pgfdw_xact_callback() and pgfdw_subxact_callback() in that file in
those versions:
/*
* If a command has been submitted to the remote server by
* using an asynchronous execution function, the command
* might not have yet completed. Check to see if a
* command is still being processed by the remote server,
* and if so, request cancellation of the command.
*/
Thanks for reviewing! Sorry for the delay.
Best regards,
Etsuro Fujita
Commits
-
postgres_fdw: Add support for parallel abort.
- 983ec23007bd 16.0 landed
-
Refine the definition of page-level freezing.
- b37a08323964 16.0 cited
-
postgres_fdw: Update comments in make_new_connection().
- 4036bcbbb928 15.0 landed
-
postgres_fdw: Minor cleanup for pgfdw_abort_cleanup().
- 56566835039a 15.0 landed
-
postgres_fdw: Add support for parallel commit.
- 04e706d4238f 15.0 landed
-
Fix ruleutils.c's dumping of whole-row Vars in more contexts.
- 43c2175121c8 15.0 cited
-
postgres_fdw: Refactor transaction rollback code to avoid code duplication.
- 85c69611288f 15.0 cited